This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[tree-ssa] New test for dominator optimizations bug


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;
+}



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]