This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] New test for dominator optimizations bug
- From: Diego Novillo <dnovillo at redhat dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 23 Aug 2003 15:37:33 -0400
- Subject: [tree-ssa] New test for dominator optimizations bug
- Organization: Red Hat Canada
This test case exposes a bug in the dominator optimizer. We are
exposing symbols without SSA version numbers.
A fix is in progress. I'm going to factor out some code out of
optimize_stmt. It's a bit difficult to follow as it is now.
Diego.
* gcc.c-torture/compile/20030823-1.c: New test.
Index: gcc.c-torture/compile/20030823-1.c
===================================================================
RCS file: gcc.c-torture/compile/20030823-1.c
diff -N gcc.c-torture/compile/20030823-1.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gcc.c-torture/compile/20030823-1.c 23 Aug 2003 19:34:03 -0000
@@ -0,0 +1,18 @@
+struct A
+{
+ int a;
+};
+
+int foo (struct A *a)
+{
+ static int c = 30;
+ int x;
+
+ a->a = c;
+ /* Dominator optimizations will replace the use of 'a->a' with 'c', but
+ they won't copy the virtual operands for 'c' from its originating
+ statement. This exposes symbol 'c' without a correct SSA version
+ number. */
+ x = a->a;
+ return x;
+}