diff options
author | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-01-27 04:45:20 +0000 |
---|---|---|
committer | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-01-27 04:45:20 +0000 |
commit | ba7236baa534f39ec615795db14885dcd5253094 (patch) | |
tree | 839beaf956bc6b73ae54db4610def572b171b9e0 /gcc/testsuite/gcc.dg/pr19633.c | |
parent | a607ffb19c99cfa6acf803b51544b334c9f2fef7 (diff) | |
download | gcc-ba7236baa534f39ec615795db14885dcd5253094.tar.gz |
PR tree-optimization/19633
* tree-ssa-alias.c (ptr_is_dereferenced_by): Also handle
CALL_EXPRs.
(maybe_create_global_var): Do not create .GLOBAL_VAR if there
are no call-clobbered variables.
* tree-outof-ssa.c (check_replaceable): Return false for calls
with side-effects.
testsuite/ChangeLog
PR tree-optimization/19633
* gcc.dg/pr19633.c: New test.
* gcc.dg/tree-ssa/pr19633.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94311 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr19633.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr19633.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr19633.c b/gcc/testsuite/gcc.dg/pr19633.c new file mode 100644 index 00000000000..4e18375656f --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr19633.c @@ -0,0 +1,40 @@ +/* { dg-do link } */ +/* { dg-options "-O2" } */ + +struct S +{ + int w, x, y, z; +}; + +struct T +{ + int r; + struct S s; +}; + +void +foo (int a, struct T b) +{ + struct S x; + struct S *c = &x; + if (a) + c = &b.s; + b.s.w = 3; + bar (*c, a); + if (b.s.w != 3) + link_error (); +} + +int main () +{ + struct T b; + foo (3, b); + return 0; +} + +int X; + +int bar (struct S x, int i) +{ + X = 3; +} |