This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[testsuite] i386 sibcall miscompilation
- To: gcc-patches at gcc dot gnu dot org
- Subject: [testsuite] i386 sibcall miscompilation
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Thu, 22 Jun 2000 14:04:58 +0200
- Reply-To: Jakub Jelinek <jakub at redhat dot com>
Hi!
This testcase is miscompiled on i386 with -O2 (-O2 -fno-optimize-sibling-calls or
-O2 -fno-strict-aliasing cure it though).
The issue is that one of the arguments gets into alias set 6 (and all other
args are in alias set 5, including write to the same location to prepare
sibcall arguments) and the read from 16(%ebp) gets scheduled after the write
from the same location, eventhough we're interested in the old, not new,
value.
No fix yet.
2000-06-22 Jakub Jelinek <jakub@redhat.com>
* gcc.c-torture/execute/20000622-1.c: New test.
--- gcc/testsuite/gcc.c-torture/execute/20000622-1.c.jj Thu Jun 22 13:33:08 2000
+++ gcc/testsuite/gcc.c-torture/execute/20000622-1.c Thu Jun 22 12:42:29 2000
@@ -0,0 +1,21 @@
+long foo(long a, long b, long c)
+{
+ if (a != 12 || b != 1 || c != 11)
+ abort();
+ return 0;
+}
+long bar (long a, long b)
+{
+ return b;
+}
+void baz (long a, long b, void *c)
+{
+ long d;
+ d = (long)c;
+ foo(d, bar (a, 1), b);
+}
+int main()
+{
+ baz (10, 11, (void *)12);
+ exit(0);
+}
Jakub