First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 16294
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Eric Botcazou <ebotcazou@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Eric Botcazou <ebotcazou@gcc.gnu.org>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 16294 depends on: Show dependency tree
Show dependency graph
Bug 16294 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2004-07-07 13:44 Opened: 2004-06-30 11:02
The RTL prologue/epilogue patch for SPARC:

   http://gcc.gnu.org/ml/gcc-patches/2004-06/msg01049.html

introduced a regression with regard to delay slot scheduling and branches.


For the testcase:

void f (double*a, int m)
{
  int j;

  for(j=0; j<m; j++)
    a[j]=1;
}

compiled at -O2 -mcpu=ultrasparc, the diff looks like:

@@ -12,10 +12,9 @@
 	.type	f, #function
 	.proc	04
 f:
-	!#PROLOGUE# 0
-	!#PROLOGUE# 1
 	cmp	%o1, 0
-	ble,pn	%icc, .LL5
+	ble,pn	%icc, .LL8
+	nop
 	sethi	%hi(.LLC0), %g1
 	mov	0, %o5
 	ldd	[%g1+%lo(.LLC0)], %f8
@@ -25,9 +24,9 @@
 	cmp	%o1, %o5
 	bg,pt	%icc, .LL4
 	std	%f8, [%o0+%g1]
-.LL5:
-	retl
-	nop
+.LL8:
+	jmp	%o7+8
+	 nop
 	.size	f, .-f
 	.section	".rodata"
 	.align 8


For testsuite/gcc.c-torture/compile/990517-1.c, the diff is:

@@ -7,9 +7,7 @@
 	.type	sdbm__splpage, #function
 	.proc	020
 sdbm__splpage:
-	!#PROLOGUE# 0
 	save	%sp, -1168, %sp
-	!#PROLOGUE# 1
 	add	%fp, -1056, %l6
 	mov	%i0, %o1
 	mov	1024, %o2
@@ -26,7 +24,8 @@
 	mov	1024, %o2
 	ldsh	[%fp-1056], %l4
 	cmp	%l4, 0
-	ble,pn	%icc, .LL1
+	ble,pn	%icc, .LL10
+	nop
 	mov	1024, %l3
 	add	%fp, -1064, %i5
 	add	%fp, -1072, %l7
@@ -59,8 +58,8 @@
 	cmp	%l4, 0
 	bg,pt	%icc, .LL4
 	add	%l5, 4, %l5
-.LL1:
+.LL10:
 	return	%i7+8
-	nop
+	 nop
 	.size	sdbm__splpage, .-sdbm__splpage
 	.ident	"GCC: (GNU) 3.5.0 20040620 (experimental)"

It appears that the compiler fails to realize that the value of the register
doesn't matter on the non-fallthru edge pointing to the return.

------- Comment #1 From Eric Botcazou 2004-07-07 13:44 -------
Investigating.

------- Comment #2 From Eric Botcazou 2004-07-11 12:43 -------
Testing various patches against the reorg pass.

------- Comment #3 From Giovanni Bajo 2004-07-11 23:16 -------
Patch posted:
http://gcc.gnu.org/ml/gcc-patches/2004-07/msg01167.html

------- Comment #4 From CVS Commits 2004-07-17 18:12 -------
Subject: Bug 16294

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	ebotcazou@gcc.gnu.org	2004-07-17 18:12:38

Modified files:
	gcc            : ChangeLog resource.c 

Log message:
	PR rtl-optimization/16294
	* resource.c (return_insn_p): New predicate.
	(mark_target_live_regs): Use it.  Special-case return insns.
	(init_resource_info): Use it.  Don't scan the epilogue past
	a return.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.4586&r2=2.4587
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/resource.c.diff?cvsroot=gcc&r1=1.71&r2=1.72


------- Comment #5 From Eric Botcazou 2004-07-17 18:15 -------
Patch commited (with a slight tweak).

First Last Prev Next    No search results available      Search page      Enter new bug