diff mbox

skip gcc.target/i386/pr53249.c on darwin

Message ID 20121101134705.GA14886@bromo.med.uc.edu
State New
Headers show

Commit Message

Jack Howarth Nov. 1, 2012, 1:47 p.m. UTC
On Fri, Aug 24, 2012 at 04:13:20PM +0200, Rainer Orth wrote:
> Jack Howarth <howarth@bromo.med.uc.edu> writes:
> 
> >    Currently the new testcase for gcc.target/i386/pr53249.c is failing
> > on darwin due to the absence of -mx32 support on that target. The following
> > patch skips this testcase on darwin. Tested on x86_64-apple-darwin12...
> 
> This also fails on Solaris/x86 (cf. PR testsuite/53365) and
> i686-unknown-linux-gnu.  I'd strongly prefer if HJ could devise a real
> fix instead of just skipping the test on an explicit list of systems.
> 
> 	Rainer

Rainer,
   What about using...


This converts the failure at -m64 into an unsupported testcase on x86_64-apple-darwin12.
           Jack

> 
> -- 
> -----------------------------------------------------------------------------
> Rainer Orth, Center for Biotechnology, Bielefeld University

Comments

H.J. Lu Nov. 1, 2012, 9:41 p.m. UTC | #1
On Thu, Nov 1, 2012 at 6:47 AM, Jack Howarth <howarth@bromo.med.uc.edu> wrote:
> On Fri, Aug 24, 2012 at 04:13:20PM +0200, Rainer Orth wrote:
>> Jack Howarth <howarth@bromo.med.uc.edu> writes:
>>
>> >    Currently the new testcase for gcc.target/i386/pr53249.c is failing
>> > on darwin due to the absence of -mx32 support on that target. The following
>> > patch skips this testcase on darwin. Tested on x86_64-apple-darwin12...
>>
>> This also fails on Solaris/x86 (cf. PR testsuite/53365) and
>> i686-unknown-linux-gnu.  I'd strongly prefer if HJ could devise a real
>> fix instead of just skipping the test on an explicit list of systems.
>>
>>       Rainer
>
> Rainer,
>    What about using...
>
> Index: gcc/testsuite/gcc.target/i386/pr53249.c
> ===================================================================
> --- gcc/testsuite/gcc.target/i386/pr53249.c     (revision 193061)
> +++ gcc/testsuite/gcc.target/i386/pr53249.c     (working copy)
> @@ -1,4 +1,4 @@
> -/* { dg-do compile { target { ! { ia32 } } } } */
> +/* { dg-do compile { target { ! { ia32 || llp64 } } } } */
>  /* { dg-options "-O2 -mx32 -ftls-model=initial-exec -maddress-mode=short" } */
>
>  struct gomp_task
>
> This converts the failure at -m64 into an unsupported testcase on x86_64-apple-darwin12.

This will disable test on Linux/x86-64.
H.J. Lu Nov. 1, 2012, 10:38 p.m. UTC | #2
On Thu, Nov 1, 2012 at 2:41 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, Nov 1, 2012 at 6:47 AM, Jack Howarth <howarth@bromo.med.uc.edu> wrote:
>> On Fri, Aug 24, 2012 at 04:13:20PM +0200, Rainer Orth wrote:
>>> Jack Howarth <howarth@bromo.med.uc.edu> writes:
>>>
>>> >    Currently the new testcase for gcc.target/i386/pr53249.c is failing
>>> > on darwin due to the absence of -mx32 support on that target. The following
>>> > patch skips this testcase on darwin. Tested on x86_64-apple-darwin12...
>>>
>>> This also fails on Solaris/x86 (cf. PR testsuite/53365) and
>>> i686-unknown-linux-gnu.  I'd strongly prefer if HJ could devise a real
>>> fix instead of just skipping the test on an explicit list of systems.
>>>
>>>       Rainer
>>
>> Rainer,
>>    What about using...
>>
>> Index: gcc/testsuite/gcc.target/i386/pr53249.c
>> ===================================================================
>> --- gcc/testsuite/gcc.target/i386/pr53249.c     (revision 193061)
>> +++ gcc/testsuite/gcc.target/i386/pr53249.c     (working copy)
>> @@ -1,4 +1,4 @@
>> -/* { dg-do compile { target { ! { ia32 } } } } */
>> +/* { dg-do compile { target { ! { ia32 || llp64 } } } } */
>>  /* { dg-options "-O2 -mx32 -ftls-model=initial-exec -maddress-mode=short" } */
>>
>>  struct gomp_task
>>
>> This converts the failure at -m64 into an unsupported testcase on x86_64-apple-darwin12.
>
> This will disable test on Linux/x86-64.
>
> --
> H.J.

We can add

# Return 1 if -mx32 can compile, 0 otherwise.

proc check_effective_target_maybe_x32 { } {
    return [check_no_compiler_messages maybe_x32 object {
        void foo (void) {}
    } {-mx32}]
}

and check it before compiling with -mx32.
Jakub Jelinek Nov. 1, 2012, 10:43 p.m. UTC | #3
On Thu, Nov 01, 2012 at 03:38:13PM -0700, H.J. Lu wrote:
> >> --- gcc/testsuite/gcc.target/i386/pr53249.c     (revision 193061)
> >> +++ gcc/testsuite/gcc.target/i386/pr53249.c     (working copy)
> >> @@ -1,4 +1,4 @@
> >> -/* { dg-do compile { target { ! { ia32 } } } } */
> >> +/* { dg-do compile { target { ! { ia32 || llp64 } } } } */
> >>  /* { dg-options "-O2 -mx32 -ftls-model=initial-exec -maddress-mode=short" } */
> >>
> >>  struct gomp_task

I don't think you should put -mx32 into dg-options, that's the same why
-m64 or -m32 isn't desirable in dg-options.  Those options should be
given just from --target_board=unix/-mx32 or similar (or compiler's
-default).

	Jakub
H.J. Lu Nov. 1, 2012, 10:55 p.m. UTC | #4
On Thu, Nov 1, 2012 at 2:41 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, Nov 1, 2012 at 6:47 AM, Jack Howarth <howarth@bromo.med.uc.edu> wrote:
>> On Fri, Aug 24, 2012 at 04:13:20PM +0200, Rainer Orth wrote:
>>> Jack Howarth <howarth@bromo.med.uc.edu> writes:
>>>
>>> >    Currently the new testcase for gcc.target/i386/pr53249.c is failing
>>> > on darwin due to the absence of -mx32 support on that target. The following
>>> > patch skips this testcase on darwin. Tested on x86_64-apple-darwin12...
>>>
>>> This also fails on Solaris/x86 (cf. PR testsuite/53365) and
>>> i686-unknown-linux-gnu.  I'd strongly prefer if HJ could devise a real
>>> fix instead of just skipping the test on an explicit list of systems.
>>>
>>>       Rainer
>>
>> Rainer,
>>    What about using...
>>
>> Index: gcc/testsuite/gcc.target/i386/pr53249.c
>> ===================================================================
>> --- gcc/testsuite/gcc.target/i386/pr53249.c     (revision 193061)
>> +++ gcc/testsuite/gcc.target/i386/pr53249.c     (working copy)
>> @@ -1,4 +1,4 @@
>> -/* { dg-do compile { target { ! { ia32 } } } } */
>> +/* { dg-do compile { target { ! { ia32 || llp64 } } } } */
>>  /* { dg-options "-O2 -mx32 -ftls-model=initial-exec -maddress-mode=short" } */
>>
>>  struct gomp_task
>>
>> This converts the failure at -m64 into an unsupported testcase on x86_64-apple-darwin12.
>
> This will disable test on Linux/x86-64.
>
> --
> H.J.

We can add

# Return 1 if -mx32 can compile, 0 otherwise.

proc check_effective_target_maybe_x32 { } {
    return [check_no_compiler_messages maybe_x32 object {
        void foo (void) {}
    } {-mx32}]
}

and check it before compiling with -mx32.
H.J. Lu Nov. 1, 2012, 11:16 p.m. UTC | #5
On Thu, Nov 1, 2012 at 3:43 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Thu, Nov 01, 2012 at 03:38:13PM -0700, H.J. Lu wrote:
>> >> --- gcc/testsuite/gcc.target/i386/pr53249.c     (revision 193061)
>> >> +++ gcc/testsuite/gcc.target/i386/pr53249.c     (working copy)
>> >> @@ -1,4 +1,4 @@
>> >> -/* { dg-do compile { target { ! { ia32 } } } } */
>> >> +/* { dg-do compile { target { ! { ia32 || llp64 } } } } */
>> >>  /* { dg-options "-O2 -mx32 -ftls-model=initial-exec -maddress-mode=short" } */
>> >>
>> >>  struct gomp_task
>
> I don't think you should put -mx32 into dg-options, that's the same why
> -m64 or -m32 isn't desirable in dg-options.  Those options should be
> given just from --target_board=unix/-mx32 or similar (or compiler's
> -default).
>

That is done on purpose since  --target_board=unix/-mx32 is only useful
if x32 run-time is available.  However, -mx32 compiling doesn't need
x32 run-time support.  We can use maybe_x32 effective target to check
if -mx32 can compile.
Jack Howarth Nov. 2, 2012, 12:09 a.m. UTC | #6
On Thu, Nov 01, 2012 at 03:38:13PM -0700, H.J. Lu wrote:
> On Thu, Nov 1, 2012 at 2:41 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> > On Thu, Nov 1, 2012 at 6:47 AM, Jack Howarth <howarth@bromo.med.uc.edu> wrote:
> >> On Fri, Aug 24, 2012 at 04:13:20PM +0200, Rainer Orth wrote:
> >>> Jack Howarth <howarth@bromo.med.uc.edu> writes:
> >>>
> >>> >    Currently the new testcase for gcc.target/i386/pr53249.c is failing
> >>> > on darwin due to the absence of -mx32 support on that target. The following
> >>> > patch skips this testcase on darwin. Tested on x86_64-apple-darwin12...
> >>>
> >>> This also fails on Solaris/x86 (cf. PR testsuite/53365) and
> >>> i686-unknown-linux-gnu.  I'd strongly prefer if HJ could devise a real
> >>> fix instead of just skipping the test on an explicit list of systems.
> >>>
> >>>       Rainer
> >>
> >> Rainer,
> >>    What about using...
> >>
> >> Index: gcc/testsuite/gcc.target/i386/pr53249.c
> >> ===================================================================
> >> --- gcc/testsuite/gcc.target/i386/pr53249.c     (revision 193061)
> >> +++ gcc/testsuite/gcc.target/i386/pr53249.c     (working copy)
> >> @@ -1,4 +1,4 @@
> >> -/* { dg-do compile { target { ! { ia32 } } } } */
> >> +/* { dg-do compile { target { ! { ia32 || llp64 } } } } */
> >>  /* { dg-options "-O2 -mx32 -ftls-model=initial-exec -maddress-mode=short" } */
> >>
> >>  struct gomp_task
> >>
> >> This converts the failure at -m64 into an unsupported testcase on x86_64-apple-darwin12.
> >
> > This will disable test on Linux/x86-64.
> >
> > --
> > H.J.
> 
> We can add
> 
> # Return 1 if -mx32 can compile, 0 otherwise.
> 
> proc check_effective_target_maybe_x32 { } {
>     return [check_no_compiler_messages maybe_x32 object {
>         void foo (void) {}
>     } {-mx32}]
> }
> 
> and check it before compiling with -mx32.
> 
> -- 
> H.J.

H.J.,
   I tried that approach before and when using...

/* { dg-do compile { target { ! { ia32 } } } } */
/* { dg-require-effective-target maybe_x32 } */
/* { dg-options "-O2 -mx32 -ftls-model=initial-exec -maddress-mode=short" } */

at the top of gcc/testsuite/gcc.target/i386/pr53249.c, I still get an excessive error
failure at -m64 on x86_64-apple-darwin11...

Executing on host: /sw/src/fink.build/gcc48-4.8.0-1000/darwin_objdir/gcc/xgcc -B/sw/src/fink.build/gcc48-4.8.0-1000/darwin_objdir/gcc/ /sw/src/fink.build/gcc48-4.8.0-1000/gcc-4.8-20121031/gcc/testsuite/gcc.target/i386/pr53249.c  -fno-diagnostics-show-caret   -O2 -mx32 -ftls-model=initial-exec -maddress-mode=short -S  -m64 -o pr53249.s    (timeout = 300)
/sw/src/fink.build/gcc48-4.8.0-1000/gcc-4.8-20121031/gcc/testsuite/gcc.target/i386/pr53249.c:1:0: error: address mode 'short' not supported in the 64 bit mode
compiler exited with status 1
output is:
/sw/src/fink.build/gcc48-4.8.0-1000/gcc-4.8-20121031/gcc/testsuite/gcc.target/i386/pr53249.c:1:0: error: address mode 'short' not supported in the 64 bit mode

FAIL: gcc.target/i386/pr53249.c (test for excess errors)
Excess errors:
/sw/src/fink.build/gcc48-4.8.0-1000/gcc-4.8-20121031/gcc/testsuite/gcc.target/i386/pr53249.c:1:0: error: address mode 'short' not supported in the 64 bit mode

testcase /sw/src/fink.build/gcc48-4.8.0-1000/gcc-4.8-20121031/gcc/testsuite/gcc.target/i386/i386.exp completed in 1 seconds

I believe you will have do a linkage test since for...

% more mx32_test.c
int foo (void) {}
% gcc-fsf-4.8 -m32 -mx32 -c mx32_test.c
% gcc-fsf-4.8 -m64 -mx32 -c mx32_test.c
% gcc-fsf-4.8 -m32 -mx32 mx32_test.c
ld: sectionForAddress(0x50000002D) address not in any section for architecture x86_64
collect2: error: ld returned 1 exit status
% gcc-fsf-4.8 -m64 -mx32 mx32_test.c
ld: sectionForAddress(0x50000002D) address not in any section for architecture x86_64
collect2: error: ld returned 1 exit status

but I don't see a way to do that in target-supports.exp.
         Jack
diff mbox

Patch

Index: gcc/testsuite/gcc.target/i386/pr53249.c
===================================================================
--- gcc/testsuite/gcc.target/i386/pr53249.c     (revision 193061)
+++ gcc/testsuite/gcc.target/i386/pr53249.c     (working copy)
@@ -1,4 +1,4 @@ 
-/* { dg-do compile { target { ! { ia32 } } } } */
+/* { dg-do compile { target { ! { ia32 || llp64 } } } } */
 /* { dg-options "-O2 -mx32 -ftls-model=initial-exec -maddress-mode=short" } */
 
 struct gomp_task