summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr33645-2.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2007-10-12 07:10:22 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2007-10-12 07:10:22 +0000
commita93b21ea450bb4af28f6d4f8b10956947ad3d51a (patch)
tree474026ffd420a838b23e399107df7fd8abcaea1a /gcc/testsuite/gcc.dg/pr33645-2.c
parent3dac447cd688525d64979440d1201913a75c2efa (diff)
downloadgcc-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-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr33645-2.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr33645-2.c b/gcc/testsuite/gcc.dg/pr33645-2.c
new file mode 100644
index 00000000000..3c4bcb060e5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr33645-2.c
@@ -0,0 +1,20 @@
+/* PR tree-optimization/33645 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -funit-at-a-time" } */
+
+__attribute__((noinline)) int
+bar (int *x)
+{
+ return *x++;
+}
+
+int
+main ()
+{
+ static int var1_s;
+ static int *var1_t = &var1_s;
+
+ return bar (var1_t) != 0;
+}
+
+/* { dg-final { scan-assembler-not "var1_t" } } */