http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58630
Bug ID: 58630 Summary: [4.9 Regression] Revision 203171 breaks several MS-ABI tests Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: dominiq at lps dot ens.fr CC: hjl.tools at gmail dot com, iains at gcc dot gnu.org, jh at suse dot cz, ktietz at gcc dot gnu.org Target: i?86-*-* x86_64-*-* Revision 203171 breaks several MS-ABI tests: FAIL: gcc.target/i386/pr43662.c (internal compiler error) FAIL: gcc.target/i386/pr43662.c (test for excess errors) FAIL: gcc.target/i386/pr43869.c (internal compiler error) FAIL: gcc.target/i386/pr43869.c (test for excess errors) FAIL: gcc.target/i386/pr57003.c (internal compiler error) FAIL: gcc.target/i386/pr57003.c (test for excess errors) FAIL: gcc.target/i386/pr9771-1.c (test for excess errors) FAIL: gcc.target/x86_64/abi/callabi/func-1.c (test for excess errors) FAIL: gcc.target/x86_64/abi/callabi/func-2a.c (test for excess errors) FAIL: gcc.target/x86_64/abi/callabi/func-indirect-2a.c (internal compiler error) FAIL: gcc.target/x86_64/abi/callabi/func-indirect-2a.c (test for excess errors) FAIL: gcc.target/x86_64/abi/callabi/func-indirect.c (test for excess errors) FAIL: gcc.target/x86_64/abi/callabi/vaarg-1.c (test for excess errors) FAIL: gcc.target/x86_64/abi/callabi/vaarg-2.c (test for excess errors) FAIL: gcc.target/x86_64/abi/callabi/vaarg-3.c (test for excess errors) FAIL: gcc.target/x86_64/abi/callabi/vaarg-4a.c (test for excess errors) FAIL: gcc.target/x86_64/abi/callabi/vaarg-5a.c (test for excess errors) (see http://gcc.gnu.org/ml/gcc-regression/2013-10/msg00026.html or http://gcc.gnu.org/ml/gcc-testresults/2013-10/msg00388.html ). The failure for gcc.target/i386/pr9771-1.c is [macbook] f90/bug% gfc -O2 -fomit-frame-pointer -ffixed-ebp /opt/gcc/work/gcc/testsuite/gcc.target/i386/pr9771-1.c -m32 /opt/gcc/work/gcc/testsuite/gcc.target/i386/pr9771-1.c: In function 'test': /opt/gcc/work/gcc/testsuite/gcc.target/i386/pr9771-1.c:46:1: error: bp cannot be used in asm here } and the others are of the kind sorry, unimplemented: ms_abi attribute requires -maccumulate-outgoing-args or subtarget optimization implying it Notes: (1) Compiling the failing gcc.target/i386/pr4* and gcc.target/x86_64/abi/callabi/func-indirect-2a.c gives an ICE: /opt/gcc/work/gcc/testsuite/gcc.target/i386/pr43662.c:20:9: internal compiler error: in expand_call, at calls.c:3153 or internal compiler error: in expand_call, at calls.c:3453 for the others. (2) Some tests are restricted to Linux but can be run on Darwin without failure. (3) The following patch fixes the failures related to -maccumulate-outgoing-args diff -up ../_clean/gcc/testsuite/gcc.target/i386/pr43662.c gcc/testsuite/gcc.target/i386/pr43662.c --- ../_clean/gcc/testsuite/gcc.target/i386/pr43662.c 2011-08-01 14:36:41.000000000 +0200 +++ gcc/testsuite/gcc.target/i386/pr43662.c 2013-10-05 16:51:56.000000000 +0200 @@ -1,5 +1,5 @@ /* { dg-do compile { target lp64 } } */ -/* { dg-options "-O2" } */ +/* { dg-options "-O2 -maccumulate-outgoing-args" } */ void __attribute__ ((ms_abi)) foo (void) { diff -up ../_clean/gcc/testsuite/gcc.target/i386/pr43869.c gcc/testsuite/gcc.target/i386/pr43869.c --- ../_clean/gcc/testsuite/gcc.target/i386/pr43869.c 2011-08-01 14:36:41.000000000 +0200 +++ gcc/testsuite/gcc.target/i386/pr43869.c 2013-10-05 16:53:09.000000000 +0200 @@ -1,4 +1,5 @@ /* { dg-do compile { target lp64 } } */ +/* { dg-options "-maccumulate-outgoing-args" } */ int __attribute__((__noinline__)) bugged(float f1, float f2, float f3, float f4, diff -up ../_clean/gcc/testsuite/gcc.target/i386/pr57003.c gcc/testsuite/gcc.target/i386/pr57003.c --- ../_clean/gcc/testsuite/gcc.target/i386/pr57003.c 2013-04-26 11:07:25.000000000 +0200 +++ gcc/testsuite/gcc.target/i386/pr57003.c 2013-10-05 16:53:52.000000000 +0200 @@ -1,6 +1,6 @@ /* PR rtl-optimization/57003 */ /* { dg-do run } */ -/* { dg-options "-O2" } */ +/* { dg-options "-O2 -maccumulate-outgoing-args" } */ #define N 2001 unsigned short *b, *c, *d; diff -up ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/func-1.c gcc/testsuite/gcc.target/x86_64/abi/callabi/func-1.c --- ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/func-1.c 2009-11-25 18:14:50.000000000 +0100 +++ gcc/testsuite/gcc.target/x86_64/abi/callabi/func-1.c 2013-10-05 16:45:39.000000000 +0200 @@ -2,7 +2,7 @@ */ /* Origin: Kai Tietz <kai.ti...@onevision.com> */ /* { dg-do run } */ -/* { dg-options "-std=gnu99 -ffast-math" } */ +/* { dg-options "-std=gnu99 -ffast-math -maccumulate-outgoing-args" } */ #include "callabi.h" extern void abort (void); diff -up ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/func-2a.c gcc/testsuite/gcc.target/x86_64/abi/callabi/func-2a.c --- ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/func-2a.c 2009-11-25 18:14:50.000000000 +0100 +++ gcc/testsuite/gcc.target/x86_64/abi/callabi/func-2a.c 2013-10-05 16:46:00.000000000 +0200 @@ -1,6 +1,6 @@ /* Test for cross x86_64<->w64 abi standard calls. */ -/* { dg-do run { target i?86-*-linux* x86_64-*-linux* } } */ -/* { dg-options "-O2 -mabi=ms -std=gnu99 -ffast-math -fno-builtin" } */ +/* { dg-do run { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-O2 -mabi=ms -std=gnu99 -ffast-math -fno-builtin -maccumulate-outgoing-args" } */ /* { dg-additional-sources "func-2b.c" } */ extern void __attribute__ ((sysv_abi)) abort (void); diff -up ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/func-2b.c gcc/testsuite/gcc.target/x86_64/abi/callabi/func-2b.c --- ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/func-2b.c 2009-11-25 18:14:50.000000000 +0100 +++ gcc/testsuite/gcc.target/x86_64/abi/callabi/func-2b.c 2013-10-05 16:46:09.000000000 +0200 @@ -1,5 +1,5 @@ /* Test for cross x86_64<->w64 abi standard calls. */ -/* { dg-options "-mabi=ms -std=gnu99 -ffast-math -fno-builtin" } */ +/* { dg-options "-mabi=ms -std=gnu99 -ffast-math -fno-builtin -maccumulate-outgoing-args" } */ long double func_cross (long double a, double b, float c, long d, int e, char f) diff -up ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/func-indirect-2a.c gcc/testsuite/gcc.target/x86_64/abi/callabi/func-indirect-2a.c --- ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/func-indirect-2a.c 2009-11-25 18:14:50.000000000 +0100 +++ gcc/testsuite/gcc.target/x86_64/abi/callabi/func-indirect-2a.c 2013-10-05 16:46:36.000000000 +0200 @@ -1,6 +1,6 @@ /* Test for cross x86_64<->w64 abi standard calls via variable. */ -/* { dg-do run { target i?86-*-linux* x86_64-*-linux* } } */ -/* { dg-options "-O2 -mabi=ms -std=gnu99 -ffast-math -fno-builtin" } */ +/* { dg-do run { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-O2 -mabi=ms -std=gnu99 -ffast-math -fno-builtin -maccumulate-outgoing-args" } */ /* { dg-additional-sources "func-indirect-2b.c" } */ extern void __attribute__ ((sysv_abi)) abort (void); diff -up ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/func-indirect-2b.c gcc/testsuite/gcc.target/x86_64/abi/callabi/func-indirect-2b.c --- ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/func-indirect-2b.c 2009-11-25 18:14:50.000000000 +0100 +++ gcc/testsuite/gcc.target/x86_64/abi/callabi/func-indirect-2b.c 2013-10-05 16:46:45.000000000 +0200 @@ -1,5 +1,5 @@ /* Test for cross x86_64<->w64 abi standard calls via variable. */ -/* { dg-options "-O2 -mabi=ms -std=gnu99 -ffast-math -fno-builtin" } */ +/* { dg-options "-O2 -mabi=ms -std=gnu99 -ffast-math -fno-builtin -maccumulate-outgoing-args" } */ typedef int (*func)(void *, char *, char *, short, long long); diff -up ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/func-indirect.c gcc/testsuite/gcc.target/x86_64/abi/callabi/func-indirect.c --- ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/func-indirect.c 2009-11-25 18:14:50.000000000 +0100 +++ gcc/testsuite/gcc.target/x86_64/abi/callabi/func-indirect.c 2013-10-05 16:46:55.000000000 +0200 @@ -2,7 +2,7 @@ */ /* Origin: Kai Tietz <kai.ti...@onevision.com> */ /* { dg-do run } */ -/* { dg-options "-std=gnu99 -ffast-math" } */ +/* { dg-options "-std=gnu99 -ffast-math -maccumulate-outgoing-args" } */ #include "callabi.h" extern void abort (void); diff -up ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-1.c gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-1.c --- ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-1.c 2009-11-25 18:14:50.000000000 +0100 +++ gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-1.c 2013-10-05 16:42:30.000000000 +0200 @@ -2,7 +2,7 @@ */ /* Origin: Kai Tietz <kai.ti...@onevision.com> */ /* { dg-do run } */ -/* { dg-options "-std=gnu99" } */ +/* { dg-options "-std=gnu99 -maccumulate-outgoing-args" } */ #include "callabi.h" extern __SIZE_TYPE__ strlen (const char *); diff -up ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-2.c gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-2.c --- ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-2.c 2009-11-25 18:14:50.000000000 +0100 +++ gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-2.c 2013-10-05 16:42:44.000000000 +0200 @@ -2,7 +2,7 @@ */ /* Origin: Kai Tietz <kai.ti...@onevision.com> */ /* { dg-do run } */ -/* { dg-options "-std=gnu99" } */ +/* { dg-options "-std=gnu99 -maccumulate-outgoing-args" } */ #include "callabi.h" extern void abort (void); diff -up ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-3.c gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-3.c --- ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-3.c 2009-11-25 18:14:50.000000000 +0100 +++ gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-3.c 2013-10-05 16:42:54.000000000 +0200 @@ -2,7 +2,7 @@ */ /* Origin: Kai Tietz <kai.ti...@onevision.com> */ /* { dg-do run } */ -/* { dg-options "-std=gnu99" } */ +/* { dg-options "-std=gnu99 -maccumulate-outgoing-args" } */ #include "callabi.h" extern void abort (void); diff -up ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-4a.c gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-4a.c --- ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-4a.c 2009-11-25 18:14:50.000000000 +0100 +++ gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-4a.c 2013-10-05 16:43:27.000000000 +0200 @@ -1,6 +1,6 @@ /* Test for cross x86_64<->w64 abi va_list calls. */ -/* { dg-do run { target i?86-*-linux* x86_64-*-linux* } } */ -/* { dg-options "-O2 -mabi=ms -std=gnu99 -fno-builtin" } */ +/* { dg-do run { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-O2 -mabi=ms -std=gnu99 -fno-builtin -maccumulate-outgoing-args" } */ /* { dg-additional-sources "vaarg-4b.c" } */ extern __SIZE_TYPE__ __attribute__ ((sysv_abi)) strlen (const char *); diff -up ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-4b.c gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-4b.c --- ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-4b.c 2009-11-25 18:14:50.000000000 +0100 +++ gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-4b.c 2013-10-05 16:43:50.000000000 +0200 @@ -1,5 +1,5 @@ /* Test for cross x86_64<->w64 abi va_list calls. */ -/* { dg-options "-O2 -mabi=ms -std=gnu99 -fno-builtin" } */ +/* { dg-options "-O2 -mabi=ms -std=gnu99 -fno-builtin -maccumulate-outgoing-args" } */ #include <stdarg.h> diff -up ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-5a.c gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-5a.c --- ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-5a.c 2009-11-25 18:14:50.000000000 +0100 +++ gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-5a.c 2013-10-05 16:44:16.000000000 +0200 @@ -1,6 +1,6 @@ /* Test for cross x86_64<->w64 abi va_list calls. */ -/* { dg-do run { target i?86-*-linux* x86_64-*-linux* } } */ -/* { dg-options "-O2 -mabi=ms -std=gnu99 -fno-builtin" } */ +/* { dg-do run { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-O2 -mabi=ms -std=gnu99 -fno-builtin -maccumulate-outgoing-args" } */ /* { dg-additional-sources "vaarg-5b.c" } */ extern void __attribute__ ((sysv_abi)) abort (void); diff -up ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-5b.c gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-5b.c --- ../_clean/gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-5b.c 2009-11-25 18:14:50.000000000 +0100 +++ gcc/testsuite/gcc.target/x86_64/abi/callabi/vaarg-5b.c 2013-10-05 16:44:27.000000000 +0200 @@ -1,5 +1,5 @@ /* Test for cross x86_64<->w64 abi va_list calls. */ -/* { dg-options "-O2 -mabi=ms -std=gnu99 -fno-builtin" } */ +/* { dg-options "-O2 -mabi=ms -std=gnu99 -fno-builtin -maccumulate-outgoing-args" } */ #include <stdarg.h>