This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/25196] [4.0/4.1 Regression] i386: wrong arguments passed
- From: "belyshev at depni dot sinp dot msu dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Dec 2005 09:17:32 -0000
- Subject: [Bug rtl-optimization/25196] [4.0/4.1 Regression] i386: wrong arguments passed
- References: <bug-25196-4672@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from belyshev at depni dot sinp dot msu dot ru 2005-12-20 09:17 -------
// short testcase, compile with "-m32 -march=i386 -O3 -fomit-frame-pointer"
extern void abort (void);
static int j;
static void __attribute__((noinline))
f1 (int a, int b, int c, int d, int e)
{
j = a;
}
int __attribute__((noinline))
f2 (int a, int b, int c, int d, int e)
{
if ((b & 0x1111) != 1)
f1 (a, b, c, d, e);
return 0;
}
int main (void)
{
f2 (123, 0, 0, 0, 0);
if (j != 123)
abort ();
return 0;
}
---
Note that this bug disappears with -fno-gcse-after-reload, here is difference
in generated assembly between -fno-gcse-after-reload (---) and
-fgcse-after-reload (+++):
$ diff -U 5 1.s 2.s
--- 1.s 2005-12-20 12:10:44.000000000 +0300
+++ 2.s 2005-12-20 12:10:41.000000000 +0300
@@ -14,13 +14,13 @@
movl 12(%esp), %ecx
movl %edx, %eax
andl $4369, %eax
decl %eax
je .L4
+ movl %ecx, %eax
pushl 20(%esp)
pushl 20(%esp)
- movl 12(%esp), %eax
call f1
popl %eax
popl %edx
.L4:
xorl %eax, %eax
$
So this bug looks very much like bug 23453.
--
belyshev at depni dot sinp dot msu dot ru changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Component|target |rtl-optimization
Ever Confirmed|0 |1
GCC host triplet|i386-pc-linux |
GCC target triplet| |i386-pc-linux
Last reconfirmed|0000-00-00 00:00:00 |2005-12-20 09:17:31
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25196