diff mbox

[PR,debug/46576] don't reset prev_nonjump_insn at debug insns

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

Commit Message

Alexandre Oliva Dec. 8, 2010, 4:11 a.m. UTC
mark_all_labels() retains information from the prior insn to attempt to
fill in the JUMP_LABEL of a computed jump.  If there happens to be a
debug insn between them, we won't fill in the JUMP_LABEL, and
-fcompare-debug fails.  Presumably in larger testcases this may also
lead to codegen differences.

This patch skips debug insns while scanning basic blocks, so that we
don't reset prev_nonjump_insn and don't otherwise waste time at them.

Regstrapped on x86_64-linux-gnu.  Ok to install?

Comments

Richard Biener Dec. 8, 2010, 9:57 a.m. UTC | #1
On Wed, Dec 8, 2010 at 5:11 AM, Alexandre Oliva <aoliva@redhat.com> wrote:
> mark_all_labels() retains information from the prior insn to attempt to
> fill in the JUMP_LABEL of a computed jump.  If there happens to be a
> debug insn between them, we won't fill in the JUMP_LABEL, and
> -fcompare-debug fails.  Presumably in larger testcases this may also
> lead to codegen differences.
>
> This patch skips debug insns while scanning basic blocks, so that we
> don't reset prev_nonjump_insn and don't otherwise waste time at them.
>
> Regstrapped on x86_64-linux-gnu.  Ok to install?

Ok.

Thanks,
Richard.

>
>
> --
> Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
> You must be the change you wish to see in the world. -- Gandhi
> Be Free! -- http://FSFLA.org/   FSF Latin America board member
> Free Software Evangelist      Red Hat Brazil Compiler Engineer
>
>
Dave Korn Dec. 15, 2010, 10:39 a.m. UTC | #2
On 08/12/2010 04:11, Alexandre Oliva wrote:

> 	PR debug/46576
> 	* jump.c (mark_all_labels): Skip debug insns.

> 	PR debug/46576
> 	* gfortran.dg/debug/pr46576.f: New.


  Wrong PR number all round there!  I think you meant 46756.

    cheers,
      DaveK
H.J. Lu Dec. 15, 2010, 3:17 p.m. UTC | #3
On Wed, Dec 15, 2010 at 2:39 AM, Dave Korn <dave.korn.cygwin@gmail.com> wrote:
> On 08/12/2010 04:11, Alexandre Oliva wrote:
>
>>       PR debug/46576
>>       * jump.c (mark_all_labels): Skip debug insns.
>
>>       PR debug/46576
>>       * gfortran.dg/debug/pr46576.f: New.
>
>
>  Wrong PR number all round there!  I think you meant 46756.
>

I checked in

http://gcc.gnu.org/ml/gcc-cvs/2010-12/msg00538.html
http://gcc.gnu.org/ml/gcc-cvs/2010-12/msg00539.html
Alexandre Oliva Dec. 15, 2010, 8:21 p.m. UTC | #4
On Dec 15, 2010, Dave Korn <dave.korn.cygwin@gmail.com> wrote:

> On 08/12/2010 04:11, Alexandre Oliva wrote:
>> PR debug/46576
>> * jump.c (mark_all_labels): Skip debug insns.

>> PR debug/46576
>> * gfortran.dg/debug/pr46576.f: New.

>   Wrong PR number all round there!  I think you meant 46756.

Indeed :-(

Hey, at least I was self-consistent!  :-)

Thanks!
diff mbox

Patch

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

	PR debug/46576
	* jump.c (mark_all_labels): Skip debug insns.
	
for  gcc/testsuite/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	PR debug/46576
	* gfortran.dg/debug/pr46576.f: New.

Index: gcc/jump.c
===================================================================
--- gcc/jump.c.orig	2010-12-06 13:00:19.389495577 -0200
+++ gcc/jump.c	2010-12-06 13:01:29.801552684 -0200
@@ -193,7 +193,7 @@  mark_all_labels (rtx f)
   rtx prev_nonjump_insn = NULL;
 
   for (insn = f; insn; insn = NEXT_INSN (insn))
-    if (INSN_P (insn))
+    if (NONDEBUG_INSN_P (insn))
       {
 	mark_jump_label (PATTERN (insn), insn, 0);
 
Index: gcc/testsuite/gfortran.dg/debug/pr46576.f
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ gcc/testsuite/gfortran.dg/debug/pr46576.f	2010-12-07 14:04:17.522493939 -0200
@@ -0,0 +1,29 @@ 
+C PR debug/46576, reduced from ../20010519-1.f
+C { dg-do compile }
+C { dg-options "-O -fcompare-debug" }
+      LOGICAL QDISK,QDW,QCMPCT
+      LOGICAL LNOMA,LRAISE,LSCI,LBIG
+      ASSIGN 801 TO I800 ! { dg-warning "Deleted feature: ASSIGN" "Deleted feature: ASSIGN" }
+      GOTO 800
+ 801  CONTINUE
+      ASSIGN 761 TO I760 ! { dg-warning "Deleted feature: ASSIGN" "Deleted feature: ASSIGN" }
+ 761  CONTINUE
+      IF(LSCI) THEN
+         DO I=1,LENCM
+         ENDDO
+      ENDIF
+      DO WHILE((CVGMX.GT.TOLDIM).AND.(ITER.LT.ITMX))
+         IF(.NOT.QDW) THEN
+            ASSIGN 641 to I640 ! { dg-warning "Deleted feature: ASSIGN" "Deleted feature: ASSIGN" }
+            GOTO 640
+ 641        CONTINUE
+         ENDIF
+      ENDDO
+      GOTO 700
+ 640  CONTINUE
+      GOTO I640 ! { dg-warning "Deleted feature: Assigned" "Assigned GO TO" }
+ 700  CONTINUE
+      GOTO I760 ! { dg-warning "Deleted feature: Assigned" "Assigned GO TO" }
+ 800  CONTINUE
+      GOTO I800 ! { dg-warning "Deleted feature: Assigned" "Assigned GO TO" }
+      END