Fix PR46528

Submitted by Alexandre Oliva on Nov. 26, 2010, 8:04 p.m.

Details

Message ID or39qnluln.fsf@livre.localdomain
State New
Headers show

Commit Message

Alexandre Oliva Nov. 26, 2010, 8:04 p.m.
On Nov 25, 2010, Richard Guenther <rguenther@suse.de> wrote:

> 	PR tree-optimization/46528
> 	* profile.c (branch_prob): Do not split blocks based on locations
> 	from debug statements.

I see you noticed this is also debug/46338, for which I posted an
identical patch, save for whitespace and Zdenek's reduced testcase.
Sorry that it took me so long to post the patch in its final form, I'd
had it for quite a while, but was having trouble completing testing
because of other unrelated problems.

Ok to install the testcase?

for gcc/testsuite/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	PR debug/46338
	* g++.dg/debug/pr46338.C: New.

Comments

Richard Henderson Nov. 26, 2010, 8:29 p.m.
On 11/26/2010 12:04 PM, Alexandre Oliva wrote:
> 	PR debug/46338
> 	* g++.dg/debug/pr46338.C: New.

Ok.


r~

Patch hide | download patch | download mbox

Index: gcc/testsuite/g++.dg/debug/pr46338.C
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ gcc/testsuite/g++.dg/debug/pr46338.C	2010-11-26 03:15:26.561728156 -0200
@@ -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++)
+    ;
+}