diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-10-12 07:10:22 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-10-12 07:10:22 +0000 |
commit | a93b21ea450bb4af28f6d4f8b10956947ad3d51a (patch) | |
tree | 474026ffd420a838b23e399107df7fd8abcaea1a /gcc/testsuite/gcc.dg/pr33645-3.c | |
parent | 3dac447cd688525d64979440d1201913a75c2efa (diff) | |
download | gcc-a93b21ea450bb4af28f6d4f8b10956947ad3d51a.tar.gz |
PR tree-optimization/33645
* tree-ssa-live.c (mark_all_vars_used): Add data argument,
pass it to walk_tree.
(mark_all_vars_used_1): Pass data through to mark_all_vars_used.
When calling set_is_used on a VAR_DECL, if data is not NULL and
its DECL_UID is in the bitmap, call mark_all_vars_used on its
DECL_INITIAL after clearing the bit in bitmap.
(remove_unused_locals): Adjust mark_all_vars_used callers.
Instead of removing unused global vars from unexpanded_var_list
immediately record them in bitmap, call mark_all_vars_used on
all used global vars from unexpanded_var_list and only purge
global vars that weren't found used even during that step.
* gcc.dg/pr33645-1.c: New test.
* gcc.dg/pr33645-2.c: New test.
* gcc.dg/pr33645-3.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@129254 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr33645-3.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr33645-3.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr33645-3.c b/gcc/testsuite/gcc.dg/pr33645-3.c new file mode 100644 index 00000000000..28b933c412c --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr33645-3.c @@ -0,0 +1,20 @@ +/* PR tree-optimization/33645 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-unit-at-a-time" } */ + +__attribute__((noinline)) int +bar (int *x) +{ + return *x++; +} + +int +main () +{ + static int var1_s; + static int *const var1_t = &var1_s; + + return bar (var1_t) != 0; +} + +/* { dg-final { scan-assembler-not "var1_t" } } */ |