tree-ssa-dom.c (propagate_rhs_into_lhs): Don't call update_stmt directly.
* tree-ssa-dom.c (propagate_rhs_into_lhs): Don't call update_stmt directly. Call mark_new_vars_to_rename slightly earlier. * gcc.c-torture/pr26840.c: New test. From-SVN: r112365
This commit is contained in:
parent
58df1c413d
commit
3ae194cd59
@ -1,3 +1,8 @@
|
||||
2006-03-24 Jeff Law <law@redhat.com>
|
||||
|
||||
* tree-ssa-dom.c (propagate_rhs_into_lhs): Don't call update_stmt
|
||||
directly. Call mark_new_vars_to_rename slightly earlier.
|
||||
|
||||
2006-03-24 Geoffrey Keating <geoffk@apple.com>
|
||||
|
||||
PR 26793
|
||||
|
@ -1,3 +1,7 @@
|
||||
2006-03-24 Jeff Law <law@redhat.com>
|
||||
|
||||
* gcc.c-torture/pr26840.c: New test.
|
||||
|
||||
2006-03-24 Geoffrey Keating <geoffk@apple.com>
|
||||
|
||||
* g++.old-deja/g++.other/init19.C: New.
|
||||
|
42
gcc/testsuite/gcc.c-torture/compile/pr26840.c
Normal file
42
gcc/testsuite/gcc.c-torture/compile/pr26840.c
Normal file
@ -0,0 +1,42 @@
|
||||
extern int f1 (void **);
|
||||
extern void f2 (void *);
|
||||
|
||||
struct s
|
||||
{
|
||||
unsigned char field1;
|
||||
int field2;
|
||||
};
|
||||
|
||||
static inline struct s *
|
||||
get_globals (void)
|
||||
{
|
||||
struct s * r;
|
||||
void * rr;
|
||||
|
||||
if (f1 (&rr))
|
||||
return 0;
|
||||
r = rr;
|
||||
if (! r)
|
||||
{
|
||||
extern struct s t;
|
||||
r = &t;
|
||||
}
|
||||
r->field1 = 1;
|
||||
return r;
|
||||
}
|
||||
|
||||
void
|
||||
atexit_common (const void *dso)
|
||||
{
|
||||
struct s *g = get_globals ();
|
||||
|
||||
if (! g)
|
||||
return;
|
||||
if (g->field1)
|
||||
{
|
||||
g->field2 = 0;
|
||||
f2 (g);
|
||||
}
|
||||
else
|
||||
f2 (g);
|
||||
}
|
@ -2160,7 +2160,11 @@ propagate_rhs_into_lhs (tree stmt, tree lhs, tree rhs, bitmap interesting_names)
|
||||
collapse control statements. */
|
||||
propagate_value (use_p, rhs);
|
||||
fold_stmt_inplace (use_stmt);
|
||||
update_stmt (use_stmt);
|
||||
|
||||
/* Sometimes propagation can expose new operands to the
|
||||
renamer. Note this will call update_stmt at the
|
||||
appropriate time. */
|
||||
mark_new_vars_to_rename (use_stmt);
|
||||
|
||||
/* Dump details. */
|
||||
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||
@ -2170,10 +2174,6 @@ propagate_rhs_into_lhs (tree stmt, tree lhs, tree rhs, bitmap interesting_names)
|
||||
fprintf (dump_file, "\n");
|
||||
}
|
||||
|
||||
/* Sometimes propagation can expose new operands to the
|
||||
renamer. */
|
||||
mark_new_vars_to_rename (use_stmt);
|
||||
|
||||
/* If we replaced a variable index with a constant, then
|
||||
we would need to update the invariant flag for ADDR_EXPRs. */
|
||||
if (TREE_CODE (use_stmt) == MODIFY_EXPR
|
||||
|
Loading…
Reference in New Issue
Block a user