public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/16294] New: Missed delay slot scheduling opportunity
@ 2004-06-30 11:09 ebotcazou at gcc dot gnu dot org
  2004-07-01  1:06 ` [Bug target/16294] [3.5 Regression] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2004-06-30 11:09 UTC (permalink / raw)
  To: gcc-bugs

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.

-- 
           Summary: Missed delay slot scheduling opportunity
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ebotcazou at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: sparc*-*-*
  GCC host triplet: sparc*-*-*
GCC target triplet: sparc*-*-*


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16294


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-07-17 18:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-30 11:09 [Bug target/16294] New: Missed delay slot scheduling opportunity ebotcazou at gcc dot gnu dot org
2004-07-01  1:06 ` [Bug target/16294] [3.5 Regression] " pinskia at gcc dot gnu dot org
2004-07-07 13:44 ` ebotcazou at gcc dot gnu dot org
2004-07-11 12:43 ` [Bug rtl-optimization/16294] " ebotcazou at gcc dot gnu dot org
2004-07-11 23:16 ` giovannibajo at libero dot it
2004-07-17 18:12 ` cvs-commit at gcc dot gnu dot org
2004-07-17 18:15 ` ebotcazou at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).