]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR debug/46338 (-fcompare-debug failure (length) with -O -fprofile-generate)
authorAlexandre Oliva <aoliva@redhat.com>
Mon, 29 Nov 2010 19:18:24 +0000 (19:18 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Mon, 29 Nov 2010 19:18:24 +0000 (19:18 +0000)
PR debug/46338
* g++.dg/debug/pr46338.C: New.

From-SVN: r167263

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/debug/pr46338.C [new file with mode: 0644]

index c4bf6203e78cecf5c3986a70e28f27e14e10127f..cfa16d3e2e6b5456227aa0107621eca308e00063 100644 (file)
@@ -1,3 +1,8 @@
+2010-11-29  Alexandre Oliva  <aoliva@redhat.com>
+
+       PR debug/46338
+       * g++.dg/debug/pr46338.C: New.
+
 2010-11-29  Richard Guenther  <rguenther@suse.de>
            Zdenek Dvorak  <rakdver@kam.uniff.cz>
 
diff --git a/gcc/testsuite/g++.dg/debug/pr46338.C b/gcc/testsuite/g++.dg/debug/pr46338.C
new file mode 100644 (file)
index 0000000..dfa9245
--- /dev/null
@@ -0,0 +1,24 @@
+// PR debug/46338
+// { dg-do compile }
+// { dg-options "-O -fprofile-generate -fcompare-debug" }
+
+void bar ();
+
+struct S
+{
+  int f ()
+  {
+  }
+};
+
+S *s;
+
+void
+foo (int x)
+{
+  if (x)
+    return;
+  bar ();
+  for (int j = 0; j < s->f (); j++)
+    ;
+}