diff options
author | Richard Guenther <rguenther@suse.de> | 2010-07-05 12:20:00 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-07-05 12:20:00 +0000 |
commit | 5d65726326a543c6203dc6c033fd9aba31be5c15 (patch) | |
tree | 76ccfe242e5f15fb4cbc6fe32f20a7346bc63b50 | |
parent | 3cd0d4fa96b392b70a6b44aa5072a69512d4fbae (diff) | |
download | gcc-5d65726326a543c6203dc6c033fd9aba31be5c15.zip gcc-5d65726326a543c6203dc6c033fd9aba31be5c15.tar.gz gcc-5d65726326a543c6203dc6c033fd9aba31be5c15.tar.bz2 |
re PR middle-end/44784 (Failed to build 403.gcc in SPEC CPU 2006)
2010-07-05 Richard Guenther <rguenther@suse.de>
PR tree-optimization/44784
* tree-ssa-pre.c (bitmap_find_leader): Fix dominance check
for inserted stmts.
(find_or_generate_expression): Fix SCCVN insertion check.
* gcc.c-torture/compile/pr44784.c: New testcase.
From-SVN: r161829
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr44784.c | 47 | ||||
-rw-r--r-- | gcc/tree-ssa-pre.c | 10 |
4 files changed, 66 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8776d34..a5d97fc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2010-07-05 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/44784 + * tree-ssa-pre.c (bitmap_find_leader): Fix dominance check + for inserted stmts. + (find_or_generate_expression): Fix SCCVN insertion check. + 2010-07-05 Nathan Sidwell <nathan@codesourcery.com> * config/rs6000/e500crtsavg64gprctr.asm: Correct done label name. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 59ac23e..b05391a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-07-05 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/44784 + * gcc.c-torture/compile/pr44784.c: New testcase. + 2010-07-05 Ira Rosen <irar@il.ibm.com> * gcc.dg/vect/costmodel/i386/costmodel-fast-math-vect-pr29925.c: diff --git a/gcc/testsuite/gcc.c-torture/compile/pr44784.c b/gcc/testsuite/gcc.c-torture/compile/pr44784.c new file mode 100644 index 0000000..54d531a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr44784.c @@ -0,0 +1,47 @@ +typedef struct rtx_def *rtx; +enum rtx_code { SUBREG }; +typedef union rtunion_def { + long rtint; + unsigned long rtuint; + rtx rtx; +} rtunion; +struct rtx_def { + enum rtx_code code: 8; + rtunion fld[1]; +}; +typedef struct simple_bitmap_def { + unsigned long long elms[1]; +} *sbitmap; +struct df_link { + struct df_link *next; + rtx reg; +}; +typedef enum { UNDEFINED, CONSTANT, VARYING } latticevalue; +typedef struct { + latticevalue lattice_val; +} value; +static value *values; +static sbitmap ssa_edges; +void defs_to_varying (struct df_link *start) +{ + struct df_link *currdef; + for (currdef = start; + currdef; + currdef = currdef->next) + { + rtx reg = currdef->reg; + if (values[(reg->code == SUBREG + ? reg->fld[0].rtx + : reg)->fld[0].rtuint].lattice_val != VARYING) + ssa_edges->elms [(reg->code == SUBREG + ? reg->fld[0].rtx + : reg)->fld[0].rtuint / 64] + |= ((unsigned long long) 1 + << (reg->code == SUBREG + ? reg->fld[0].rtx + : reg)->fld[0].rtuint % 64); + values[(reg->code == SUBREG + ? reg->fld[0].rtx + : reg)->fld[0].rtuint].lattice_val = VARYING; + } +} diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 97eb7d2..c864eac 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -1955,7 +1955,10 @@ bitmap_find_leader (bitmap_set_t set, unsigned int val, gimple stmt) gimple def_stmt = SSA_NAME_DEF_STMT (PRE_EXPR_NAME (val)); if (gimple_code (def_stmt) != GIMPLE_PHI && gimple_bb (def_stmt) == gimple_bb (stmt) - && gimple_uid (def_stmt) >= gimple_uid (stmt)) + /* PRE insertions are at the end of the basic-block + and have UID 0. */ + && (gimple_uid (def_stmt) == 0 + || gimple_uid (def_stmt) >= gimple_uid (stmt))) continue; } return val; @@ -3021,9 +3024,10 @@ find_or_generate_expression (basic_block block, pre_expr expr, } /* If it's still NULL, it must be a complex expression, so generate - it recursively. Not so for FRE though. */ + it recursively. Not so if inserting expressions for values generated + by SCCVN. */ if (genop == NULL - && !in_fre) + && !domstmt) { bitmap_set_t exprset; unsigned int lookfor = get_expr_value_id (expr); |