Hello!
>> gcc.target/i386/pr59099.c fails on x86_64-redhat-linux-gnu with
>> --disable-multilib because linking -m32 code is not supported. The
>> test case passes in 64-bit mode as well. The other -m32 tests do
>> not use dg-do run, so they do not exhibit this problem.
>>
>> Okay for trunk?
>
> No, this IMHO really should be:
> /* { dg-do run { target { ia32 && fpic } } } */
> /* { dg-options "-O2 -fPIC" } */
>
> All tests in gcc.target/i386 having -m32 (or -m64) in dg-options
> are buggy and should be fixed, either by adding { target ia32 }
> to their dg-do compile or whatever other dg-do they have, or
> adding
> /* { dg-require-effective-target ia32 } */
> line and dropping the -m32 from dg-options.
I have committed following testsuite patch that removes -m32 from
options. Also, the patch includes check for fpic effective target when
-fpic is used.
2014-01-08 Uros Bizjak <[email protected]>
* gcc.target/i386/asm-1.c: Remove dg-options.
* gcc.target/i386/incoming-5.c (dg-options): Remove -m32.
* gcc.target/i386/pr55433.c (dg-options): Ditto.
* gcc.target/i386/pr57848.c (dg-options): Ditto.
* gcc.target/i386/pr59099.c (dg-options): Ditto.
Require fpic effective target.
* gcc.target/i386/pr56246.c (dg-do): Compile for fpic target only.
Tested on x86_64-pc-linux-gnu {,-m32}, will be committed to mainline
in a moment.
Uros.
Index: gcc.target/i386/asm-1.c
===================================================================
--- gcc.target/i386/asm-1.c (revision 206436)
+++ gcc.target/i386/asm-1.c (working copy)
@@ -1,6 +1,5 @@
/* { dg-do compile } */
/* { dg-require-effective-target ia32 } */
-/* { dg-options "-m32" } */
register unsigned int EAX asm ("r14"); /* { dg-error "register name" } */
Index: gcc.target/i386/incoming-5.c
===================================================================
--- gcc.target/i386/incoming-5.c (revision 206436)
+++ gcc.target/i386/incoming-5.c (working copy)
@@ -1,6 +1,6 @@
/* PR middle-end/37009 */
/* { dg-do compile { target { { ! *-*-darwin* } && ia32 } } } */
-/* { dg-options "-m32 -mincoming-stack-boundary=2
-mpreferred-stack-boundary=2" } */
+/* { dg-options "-mincoming-stack-boundary=2 -mpreferred-stack-boundary=2" } */
extern void bar (double *);
Index: gcc.target/i386/pr55433.c
===================================================================
--- gcc.target/i386/pr55433.c (revision 206436)
+++ gcc.target/i386/pr55433.c (working copy)
@@ -1,5 +1,5 @@
-/* { dg-do compile {target { *-*-darwin* } } } */
-/* { dg-options "-O1 -m32" } */
+/* { dg-do compile { target { *-*-darwin* } } } */
+/* { dg-options "-O1" } */
typedef unsigned long long tick_t;
extern int foo(void);
Index: gcc.target/i386/pr56246.c
===================================================================
--- gcc.target/i386/pr56246.c (revision 206436)
+++ gcc.target/i386/pr56246.c (working copy)
@@ -1,5 +1,5 @@
/* PR target/56225 */
-/* { dg-do compile { target { ia32 } } } */
+/* { dg-do compile { target { ia32 && fpic } } } */
/* { dg-options "-O2 -fno-omit-frame-pointer -march=i686 -fpic" } */
void NoBarrier_AtomicExchange (long long *ptr) {
Index: gcc.target/i386/pr57848.c
===================================================================
--- gcc.target/i386/pr57848.c (revision 206436)
+++ gcc.target/i386/pr57848.c (working copy)
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -m32" } */
+/* { dg-options "-O1" } */
extern unsigned int __builtin_ia32_crc32si (unsigned int, unsigned int);
#pragma GCC target("sse4.2")
Index: gcc.target/i386/pr59099.c
===================================================================
--- gcc.target/i386/pr59099.c (revision 206436)
+++ gcc.target/i386/pr59099.c (working copy)
@@ -1,5 +1,6 @@
/* { dg-do run } */
-/* { dg-options "-O2 -fPIC -m32" } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O2 -fPIC" } */
void (*pfn)(void);