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
This commit is contained in:
Richard Guenther 2010-07-05 12:20:00 +00:00 committed by Richard Biener
parent 3cd0d4fa96
commit 5d65726326
4 changed files with 66 additions and 3 deletions

View File

@ -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.

View File

@ -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:

View File

@ -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;
}
}

View File

@ -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);