diff options
author | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-01-14 08:37:26 +0000 |
---|---|---|
committer | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-01-14 08:37:26 +0000 |
commit | 2487de1988f609a467b116368108cf6976f3b027 (patch) | |
tree | 1517ca48e72c65b525def1df518d9d44a6853228 /gcc/sese.c | |
parent | ece0be9d7429bfda35316296c501acb4ba33747a (diff) | |
download | gcc-2487de1988f609a467b116368108cf6976f3b027.tar.gz |
Fix PR42681.
2010-01-14 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/42681
* graphite-clast-to-gimple.c (gloog_error): New static variable.
(clast_to_gcc_expression): Do not build MULT_EXPR of POINTER_TYPE_P.
Set gloog_error when such an expression failed to be built.
(translate_clast): Early return when gloog_error is set.
(gloog): Clear gloog_error. When gloog_error is set, call
set_ifsese_condition to enable the original code. Return the status
of the code generation based on gloog_error.
* sese.c (set_ifsese_condition): New.
* sese.h (set_ifsese_condition): Declared.
* testsuite/g++.dg/graphite/pr42681.C: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155884 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sese.c')
-rw-r--r-- | gcc/sese.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/sese.c b/gcc/sese.c index 1c4686de3a2..f959bdb269e 100644 --- a/gcc/sese.c +++ b/gcc/sese.c @@ -1558,6 +1558,34 @@ move_sese_in_condition (sese region) return if_region; } +/* Replaces the condition of the IF_REGION with CONDITION: + | if (CONDITION) + | true_region; + | else + | false_region; +*/ + +void +set_ifsese_condition (ifsese if_region, tree condition) +{ + sese region = if_region->region; + edge entry = region->entry; + basic_block bb = entry->dest; + gimple last = last_stmt (bb); + gimple_stmt_iterator gsi = gsi_last_bb (bb); + gimple cond_stmt; + + gcc_assert (gimple_code (last) == GIMPLE_COND); + + gsi_remove (&gsi, true); + gsi = gsi_last_bb (bb); + condition = force_gimple_operand_gsi (&gsi, condition, true, NULL, + false, GSI_NEW_STMT); + cond_stmt = gimple_build_cond_from_tree (condition, NULL_TREE, NULL_TREE); + gsi = gsi_last_bb (bb); + gsi_insert_after (&gsi, cond_stmt, GSI_NEW_STMT); +} + /* Returns the scalar evolution of T in REGION. Every variable that is not defined in the REGION is considered a parameter. */ |