diff mbox series

[ARM] Fix failing testcase pragma_fpu_attribute.c

Message ID 20171208145315.GA25009@arm.com
State New
Headers show
Series [ARM] Fix failing testcase pragma_fpu_attribute.c | expand

Commit Message

Tamar Christina Dec. 8, 2017, 2:53 p.m. UTC
Hi All,

My previous patch had two issues with the new test cases.
It seems that depending on which DejaGnu version you have 
dg-additional-options will add the options before or after the
ones added by the test suite. Which means I can't use it to override
the default options.

For this I use a pragma now and place the pragma before GCC needs to emit
any code. Which in turn means it doesn't emit the .fpu directive for the first
switching of fpus.

Secondly, because of the usage of neon I also need to guard against arm_neon_ok.

Regtested on arm-none-eabi and no regressions.

Ok for trunk?


gcc/testsuite/
2017-12-08  Tamar Christina  <tamar.christina@arm.com>

	PR target/82641
	* gcc.target/arm/pragma_fpu_attribute.c: New.
	* gcc.target/arm/pragma_fpu_attribute_2.c: New.

--

Comments

Christophe Lyon Dec. 11, 2017, 9:01 a.m. UTC | #1
On 8 December 2017 at 15:53, Tamar Christina <tamar.christina@arm.com> wrote:
> Hi All,
>
> My previous patch had two issues with the new test cases.
> It seems that depending on which DejaGnu version you have
> dg-additional-options will add the options before or after the
> ones added by the test suite. Which means I can't use it to override
> the default options.
>
> For this I use a pragma now and place the pragma before GCC needs to emit
> any code. Which in turn means it doesn't emit the .fpu directive for the first
> switching of fpus.
>
> Secondly, because of the usage of neon I also need to guard against arm_neon_ok.
>
> Regtested on arm-none-eabi and no regressions.
>
> Ok for trunk?
>
>
> gcc/testsuite/
> 2017-12-08  Tamar Christina  <tamar.christina@arm.com>
>
>         PR target/82641
>         * gcc.target/arm/pragma_fpu_attribute.c: New.
>         * gcc.target/arm/pragma_fpu_attribute_2.c: New.
>
> --

Hi Tamar,

We must be testing/building differently, since your patch doesn't work for me.

The compiler complains when including arm_neon.h because:
"NEON intrinsics not available with the soft-float ABI."

I'm using a recent dejagnu (1.6+). and for instance on arm-none-eabi,
the testcase
is compiled with -std=gnu99, but no other ABI-related option. Why does
it work for you?

Christophe
Tamar Christina Dec. 11, 2017, 10:35 a.m. UTC | #2
Hi Christoph,

> -----Original Message-----

> From: Christophe Lyon [mailto:christophe.lyon@linaro.org]

> Sent: Monday, December 11, 2017 09:02

> To: Tamar Christina <Tamar.Christina@arm.com>

> Cc: gcc-patches@gcc.gnu.org; nd <nd@arm.com>; Ramana Radhakrishnan

> <Ramana.Radhakrishnan@arm.com>; Richard Earnshaw

> <Richard.Earnshaw@arm.com>; nickc@redhat.com; Kyrylo Tkachov

> <Kyrylo.Tkachov@arm.com>

> Subject: Re: [PATCH][GCC][ARM] Fix failing testcase pragma_fpu_attribute.c

> 

> On 8 December 2017 at 15:53, Tamar Christina <tamar.christina@arm.com>

> wrote:

> > Hi All,

> >

> > My previous patch had two issues with the new test cases.

> > It seems that depending on which DejaGnu version you have

> > dg-additional-options will add the options before or after the ones

> > added by the test suite. Which means I can't use it to override the

> > default options.

> >

> > For this I use a pragma now and place the pragma before GCC needs to

> > emit any code. Which in turn means it doesn't emit the .fpu directive

> > for the first switching of fpus.

> >

> > Secondly, because of the usage of neon I also need to guard against

> arm_neon_ok.

> >

> > Regtested on arm-none-eabi and no regressions.

> >

> > Ok for trunk?

> >

> >

> > gcc/testsuite/

> > 2017-12-08  Tamar Christina  <tamar.christina@arm.com>

> >

> >         PR target/82641

> >         * gcc.target/arm/pragma_fpu_attribute.c: New.

> >         * gcc.target/arm/pragma_fpu_attribute_2.c: New.

> >

> > --

> 

> Hi Tamar,

> 

> We must be testing/building differently, since your patch doesn't work for

> me.

> 

> The compiler complains when including arm_neon.h because:

> "NEON intrinsics not available with the soft-float ABI."

> 

> I'm using a recent dejagnu (1.6+). and for instance on arm-none-eabi, the

> testcase is compiled with -std=gnu99, but no other ABI-related option. Why

> does it work for you?


This is a good question, it also works on our internal overnight testing infrastructure.
At least the neon bit, it was the reason I noticed the discrepancy with the Dejagnu versions.

It also works when I build natively using just configure && make. Could be something in the configure flags.
Looking back at it, if the vanilla compiler doesn't support neon I can see the test failing. But fixing it means
Turning on neon and then turning it off after the include. Which makes the test do too many things.

I will try to think of  a testcase that doesn't require neon, if I can't I'll just remove the tests.
They weren't being tested before and if there's no way to reliably test changing fpu options on ARM
Then there's no point having them.

Thanks,
Tamar

> 

> Christophe
Christophe Lyon Dec. 11, 2017, 11:23 a.m. UTC | #3
On 11 December 2017 at 11:35, Tamar Christina <Tamar.Christina@arm.com> wrote:
> Hi Christoph,
>
>> -----Original Message-----
>> From: Christophe Lyon [mailto:christophe.lyon@linaro.org]
>> Sent: Monday, December 11, 2017 09:02
>> To: Tamar Christina <Tamar.Christina@arm.com>
>> Cc: gcc-patches@gcc.gnu.org; nd <nd@arm.com>; Ramana Radhakrishnan
>> <Ramana.Radhakrishnan@arm.com>; Richard Earnshaw
>> <Richard.Earnshaw@arm.com>; nickc@redhat.com; Kyrylo Tkachov
>> <Kyrylo.Tkachov@arm.com>
>> Subject: Re: [PATCH][GCC][ARM] Fix failing testcase pragma_fpu_attribute.c
>>
>> On 8 December 2017 at 15:53, Tamar Christina <tamar.christina@arm.com>
>> wrote:
>> > Hi All,
>> >
>> > My previous patch had two issues with the new test cases.
>> > It seems that depending on which DejaGnu version you have
>> > dg-additional-options will add the options before or after the ones
>> > added by the test suite. Which means I can't use it to override the
>> > default options.
>> >
>> > For this I use a pragma now and place the pragma before GCC needs to
>> > emit any code. Which in turn means it doesn't emit the .fpu directive
>> > for the first switching of fpus.
>> >
>> > Secondly, because of the usage of neon I also need to guard against
>> arm_neon_ok.
>> >
>> > Regtested on arm-none-eabi and no regressions.
>> >
>> > Ok for trunk?
>> >
>> >
>> > gcc/testsuite/
>> > 2017-12-08  Tamar Christina  <tamar.christina@arm.com>
>> >
>> >         PR target/82641
>> >         * gcc.target/arm/pragma_fpu_attribute.c: New.
>> >         * gcc.target/arm/pragma_fpu_attribute_2.c: New.
>> >
>> > --
>>
>> Hi Tamar,
>>
>> We must be testing/building differently, since your patch doesn't work for
>> me.
>>
>> The compiler complains when including arm_neon.h because:
>> "NEON intrinsics not available with the soft-float ABI."
>>
>> I'm using a recent dejagnu (1.6+). and for instance on arm-none-eabi, the
>> testcase is compiled with -std=gnu99, but no other ABI-related option. Why
>> does it work for you?
>
> This is a good question, it also works on our internal overnight testing infrastructure.
> At least the neon bit, it was the reason I noticed the discrepancy with the Dejagnu versions.
>
> It also works when I build natively using just configure && make. Could be something in the configure flags.
> Looking back at it, if the vanilla compiler doesn't support neon I can see the test failing. But fixing it means
> Turning on neon and then turning it off after the include. Which makes the test do too many things.

What are your configure flags?
Can you can&paste the command line used to compile the testcase (from gcc.log) ?

Thanks

>
> I will try to think of  a testcase that doesn't require neon, if I can't I'll just remove the tests.
> They weren't being tested before and if there's no way to reliably test changing fpu options on ARM
> Then there's no point having them.
>

Yes, that's becoming way too complex for the purpose :(

> Thanks,
> Tamar
>
>>
>> Christophe
Tamar Christina Dec. 11, 2017, 11:37 a.m. UTC | #4
> -----Original Message-----

> From: Christophe Lyon [mailto:christophe.lyon@linaro.org]

> Sent: Monday, December 11, 2017 11:24

> To: Tamar Christina <Tamar.Christina@arm.com>

> Cc: gcc-patches@gcc.gnu.org; nd <nd@arm.com>; Ramana Radhakrishnan

> <Ramana.Radhakrishnan@arm.com>; Richard Earnshaw

> <Richard.Earnshaw@arm.com>; nickc@redhat.com; Kyrylo Tkachov

> <Kyrylo.Tkachov@arm.com>

> Subject: Re: [PATCH][GCC][ARM] Fix failing testcase pragma_fpu_attribute.c

> 

> On 11 December 2017 at 11:35, Tamar Christina <Tamar.Christina@arm.com>

> wrote:

> > Hi Christoph,

> >

> >> -----Original Message-----

> >> From: Christophe Lyon [mailto:christophe.lyon@linaro.org]

> >> Sent: Monday, December 11, 2017 09:02

> >> To: Tamar Christina <Tamar.Christina@arm.com>

> >> Cc: gcc-patches@gcc.gnu.org; nd <nd@arm.com>; Ramana Radhakrishnan

> >> <Ramana.Radhakrishnan@arm.com>; Richard Earnshaw

> >> <Richard.Earnshaw@arm.com>; nickc@redhat.com; Kyrylo Tkachov

> >> <Kyrylo.Tkachov@arm.com>

> >> Subject: Re: [PATCH][GCC][ARM] Fix failing testcase

> >> pragma_fpu_attribute.c

> >>

> >> On 8 December 2017 at 15:53, Tamar Christina

> >> <tamar.christina@arm.com>

> >> wrote:

> >> > Hi All,

> >> >

> >> > My previous patch had two issues with the new test cases.

> >> > It seems that depending on which DejaGnu version you have

> >> > dg-additional-options will add the options before or after the ones

> >> > added by the test suite. Which means I can't use it to override the

> >> > default options.

> >> >

> >> > For this I use a pragma now and place the pragma before GCC needs

> >> > to emit any code. Which in turn means it doesn't emit the .fpu

> >> > directive for the first switching of fpus.

> >> >

> >> > Secondly, because of the usage of neon I also need to guard against

> >> arm_neon_ok.

> >> >

> >> > Regtested on arm-none-eabi and no regressions.

> >> >

> >> > Ok for trunk?

> >> >

> >> >

> >> > gcc/testsuite/

> >> > 2017-12-08  Tamar Christina  <tamar.christina@arm.com>

> >> >

> >> >         PR target/82641

> >> >         * gcc.target/arm/pragma_fpu_attribute.c: New.

> >> >         * gcc.target/arm/pragma_fpu_attribute_2.c: New.

> >> >

> >> > --

> >>

> >> Hi Tamar,

> >>

> >> We must be testing/building differently, since your patch doesn't

> >> work for me.

> >>

> >> The compiler complains when including arm_neon.h because:

> >> "NEON intrinsics not available with the soft-float ABI."

> >>

> >> I'm using a recent dejagnu (1.6+). and for instance on arm-none-eabi,

> >> the testcase is compiled with -std=gnu99, but no other ABI-related

> >> option. Why does it work for you?

> >

> > This is a good question, it also works on our internal overnight testing

> infrastructure.

> > At least the neon bit, it was the reason I noticed the discrepancy with the

> Dejagnu versions.

> >

> > It also works when I build natively using just configure && make. Could be

> something in the configure flags.

> > Looking back at it, if the vanilla compiler doesn't support neon I can

> > see the test failing. But fixing it means Turning on neon and then turning it

> off after the include. Which makes the test do too many things.

> 

> What are your configure flags?

> Can you can&paste the command line used to compile the testcase (from

> gcc.log) ?


They are:

Schedule of variations:
    arm-eabi-aem/-marm/-march=armv7-a/-mfpu=vfpv3-d16/-mfloat-abi=softfp
    arm-eabi-aem/-mthumb/-march=armv8-a/-mfpu=crypto-neon-fp-armv8/-mfloat-abi=hard


/build-arm-none-eabi/obj/gcc2/gcc/xgcc -B/build-arm-none-eabi/obj/gcc2/gcc/ /src/gcc/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute_2.c -marm -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -fno-diagnostics-show-caret -fdiagnostics-color=never -ansi -pedantic-errors -std=gnu99 -ffat-lto-objects -S -specs=aprofile-validation.specs -Wa,-mno-warn-deprecated -o pragma_fpu_attribute_2.s

/build-arm-none-eabi/obj/gcc2/gcc/xgcc -B/build-arm-none-eabi/obj/gcc2/gcc/ /src/gcc/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute.c -marm -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -fno-diagnostics-show-caret -fdiagnostics-color=never -ansi -pedantic-errors -std=gnu99 -ffat-lto-objects -S -specs=aprofile-validation.specs -Wa,-mno-warn-deprecated -o pragma_fpu_attribute.s

/build-arm-none-eabi/obj/gcc2/gcc/xgcc -B/build-arm-none-eabi/obj/gcc2/gcc/ /src/gcc/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute_2.c  -mthumb -march=armv8-a -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard   -fno-diagnostics-show-caret -fdiagnostics-color=never  -ansi -pedantic-errors -std=gnu99 -ffat-lto-objects -S -specs=aprofile-validation.specs -Wa,-mno-warn-deprecated   -o pragma_fpu_attribute_2.s

/build-arm-none-eabi/obj/gcc2/gcc/xgcc -B/build-arm-none-eabi/obj/gcc2/gcc/ /src/gcc/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute.c -mthumb -march=armv8-a -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard -fno-diagnostics-show-caret -fdiagnostics-color=never -ansi -pedantic-errors -std=gnu99 -ffat-lto-objects -S -specs=aprofile-validation.specs -Wa,-mno-warn-deprecated -o pragma_fpu_attribute.s

It's also weird that you only see one of the testcases failing.
The pragma_fpu_attribute.c and pragma_fpu_attribute_2.c should have the exact same issues.

> 

> Thanks

> 

> >

> > I will try to think of  a testcase that doesn't require neon, if I can't I'll just

> remove the tests.

> > They weren't being tested before and if there's no way to reliably

> > test changing fpu options on ARM Then there's no point having them.

> >

> 

> Yes, that's becoming way too complex for the purpose :(


I think I can do one using the fmla instructions. So will try that next.

> 

> > Thanks,

> > Tamar

> >

> >>

> >> Christophe
Tamar Christina Dec. 11, 2017, 11:56 a.m. UTC | #5
> > >

> > > It also works when I build natively using just configure && make.

> > > Could be

> > something in the configure flags.

> > > Looking back at it, if the vanilla compiler doesn't support neon I

> > > can see the test failing. But fixing it means Turning on neon and

> > > then turning it

> > off after the include. Which makes the test do too many things.

> >

> > What are your configure flags?

> > Can you can&paste the command line used to compile the testcase (from

> > gcc.log) ?

> 


Ah, Richard pointed out to me that the difference is in "soft" abi, I was only testing 
Softfp and hard. I'll write a new testcase that should work for all.

Thanks

> They are:

> 

> Schedule of variations:

>     arm-eabi-aem/-marm/-march=armv7-a/-mfpu=vfpv3-d16/-mfloat-

> abi=softfp

>     arm-eabi-aem/-mthumb/-march=armv8-a/-mfpu=crypto-neon-fp-armv8/-

> mfloat-abi=hard

> 

> 

> /build-arm-none-eabi/obj/gcc2/gcc/xgcc -B/build-arm-none-

> eabi/obj/gcc2/gcc/

> /src/gcc/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute_2.c -marm -

> march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -fno-diagnostics-show-

> caret -fdiagnostics-color=never -ansi -pedantic-errors -std=gnu99 -ffat-lto-

> objects -S -specs=aprofile-validation.specs -Wa,-mno-warn-deprecated -o

> pragma_fpu_attribute_2.s

> 

> /build-arm-none-eabi/obj/gcc2/gcc/xgcc -B/build-arm-none-

> eabi/obj/gcc2/gcc/

> /src/gcc/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute.c -marm -

> march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -fno-diagnostics-show-

> caret -fdiagnostics-color=never -ansi -pedantic-errors -std=gnu99 -ffat-lto-

> objects -S -specs=aprofile-validation.specs -Wa,-mno-warn-deprecated -o

> pragma_fpu_attribute.s

> 

> /build-arm-none-eabi/obj/gcc2/gcc/xgcc -B/build-arm-none-

> eabi/obj/gcc2/gcc/

> /src/gcc/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute_2.c  -mthumb -

> march=armv8-a -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard   -fno-

> diagnostics-show-caret -fdiagnostics-color=never  -ansi -pedantic-errors -

> std=gnu99 -ffat-lto-objects -S -specs=aprofile-validation.specs -Wa,-mno-

> warn-deprecated   -o pragma_fpu_attribute_2.s

> 

> /build-arm-none-eabi/obj/gcc2/gcc/xgcc -B/build-arm-none-

> eabi/obj/gcc2/gcc/

> /src/gcc/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute.c -mthumb -

> march=armv8-a -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard -fno-

> diagnostics-show-caret -fdiagnostics-color=never -ansi -pedantic-errors -

> std=gnu99 -ffat-lto-objects -S -specs=aprofile-validation.specs -Wa,-mno-

> warn-deprecated -o pragma_fpu_attribute.s

> 

> It's also weird that you only see one of the testcases failing.

> The pragma_fpu_attribute.c and pragma_fpu_attribute_2.c should have the

> exact same issues.

> 

> >

> > Thanks

> >

> > >

> > > I will try to think of  a testcase that doesn't require neon, if I

> > > can't I'll just

> > remove the tests.

> > > They weren't being tested before and if there's no way to reliably

> > > test changing fpu options on ARM Then there's no point having them.

> > >

> >

> > Yes, that's becoming way too complex for the purpose :(

> 

> I think I can do one using the fmla instructions. So will try that next.

> 

> >

> > > Thanks,

> > > Tamar

> > >

> > >>

> > >> Christophe
Christophe Lyon Dec. 11, 2017, 12:11 p.m. UTC | #6
On 11 December 2017 at 12:56, Tamar Christina <Tamar.Christina@arm.com> wrote:
>> > >
>> > > It also works when I build natively using just configure && make.
>> > > Could be
>> > something in the configure flags.
>> > > Looking back at it, if the vanilla compiler doesn't support neon I
>> > > can see the test failing. But fixing it means Turning on neon and
>> > > then turning it
>> > off after the include. Which makes the test do too many things.
>> >
>> > What are your configure flags?
>> > Can you can&paste the command line used to compile the testcase (from
>> > gcc.log) ?
>>
>
> Ah, Richard pointed out to me that the difference is in "soft" abi, I was only testing
> Softfp and hard. I'll write a new testcase that should work for all.
>

Indeed, you override the float-abi flags in your RUNTESTFLAGS, which
I'm not doing.

I think your arm-none-eabi builds have soft, softfp and hard multilibs?

With arm-none-linux-gnueabi[hf], you cannot override float-abi as easily,
see for instance:
https://gcc.gnu.org/ml/gcc-patches/2017-11/msg02323.html

Thanks,

Christophe

> Thanks
>
>> They are:
>>
>> Schedule of variations:
>>     arm-eabi-aem/-marm/-march=armv7-a/-mfpu=vfpv3-d16/-mfloat-
>> abi=softfp
>>     arm-eabi-aem/-mthumb/-march=armv8-a/-mfpu=crypto-neon-fp-armv8/-
>> mfloat-abi=hard
>>
>>
>> /build-arm-none-eabi/obj/gcc2/gcc/xgcc -B/build-arm-none-
>> eabi/obj/gcc2/gcc/
>> /src/gcc/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute_2.c -marm -
>> march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -fno-diagnostics-show-
>> caret -fdiagnostics-color=never -ansi -pedantic-errors -std=gnu99 -ffat-lto-
>> objects -S -specs=aprofile-validation.specs -Wa,-mno-warn-deprecated -o
>> pragma_fpu_attribute_2.s
>>
>> /build-arm-none-eabi/obj/gcc2/gcc/xgcc -B/build-arm-none-
>> eabi/obj/gcc2/gcc/
>> /src/gcc/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute.c -marm -
>> march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -fno-diagnostics-show-
>> caret -fdiagnostics-color=never -ansi -pedantic-errors -std=gnu99 -ffat-lto-
>> objects -S -specs=aprofile-validation.specs -Wa,-mno-warn-deprecated -o
>> pragma_fpu_attribute.s
>>
>> /build-arm-none-eabi/obj/gcc2/gcc/xgcc -B/build-arm-none-
>> eabi/obj/gcc2/gcc/
>> /src/gcc/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute_2.c  -mthumb -
>> march=armv8-a -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard   -fno-
>> diagnostics-show-caret -fdiagnostics-color=never  -ansi -pedantic-errors -
>> std=gnu99 -ffat-lto-objects -S -specs=aprofile-validation.specs -Wa,-mno-
>> warn-deprecated   -o pragma_fpu_attribute_2.s
>>
>> /build-arm-none-eabi/obj/gcc2/gcc/xgcc -B/build-arm-none-
>> eabi/obj/gcc2/gcc/
>> /src/gcc/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute.c -mthumb -
>> march=armv8-a -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard -fno-
>> diagnostics-show-caret -fdiagnostics-color=never -ansi -pedantic-errors -
>> std=gnu99 -ffat-lto-objects -S -specs=aprofile-validation.specs -Wa,-mno-
>> warn-deprecated -o pragma_fpu_attribute.s
>>
>> It's also weird that you only see one of the testcases failing.
>> The pragma_fpu_attribute.c and pragma_fpu_attribute_2.c should have the
>> exact same issues.
>>
>> >
>> > Thanks
>> >
>> > >
>> > > I will try to think of  a testcase that doesn't require neon, if I
>> > > can't I'll just
>> > remove the tests.
>> > > They weren't being tested before and if there's no way to reliably
>> > > test changing fpu options on ARM Then there's no point having them.
>> > >
>> >
>> > Yes, that's becoming way too complex for the purpose :(
>>
>> I think I can do one using the fmla instructions. So will try that next.
>>
>> >
>> > > Thanks,
>> > > Tamar
>> > >
>> > >>
>> > >> Christophe
Tamar Christina Dec. 12, 2017, 5:30 p.m. UTC | #7
Hi All,

Please consider this patch abandoned. I have submitted a new version.

Thanks,
Tamar

> -----Original Message-----

> From: Christophe Lyon [mailto:christophe.lyon@linaro.org]

> Sent: Monday, December 11, 2017 12:11

> To: Tamar Christina <Tamar.Christina@arm.com>

> Cc: gcc-patches@gcc.gnu.org; nd <nd@arm.com>; Ramana Radhakrishnan

> <Ramana.Radhakrishnan@arm.com>; Richard Earnshaw

> <Richard.Earnshaw@arm.com>; nickc@redhat.com; Kyrylo Tkachov

> <Kyrylo.Tkachov@arm.com>

> Subject: Re: [PATCH][GCC][ARM] Fix failing testcase pragma_fpu_attribute.c

> 

> On 11 December 2017 at 12:56, Tamar Christina <Tamar.Christina@arm.com>

> wrote:

> >> > >

> >> > > It also works when I build natively using just configure && make.

> >> > > Could be

> >> > something in the configure flags.

> >> > > Looking back at it, if the vanilla compiler doesn't support neon

> >> > > I can see the test failing. But fixing it means Turning on neon

> >> > > and then turning it

> >> > off after the include. Which makes the test do too many things.

> >> >

> >> > What are your configure flags?

> >> > Can you can&paste the command line used to compile the testcase

> >> > (from

> >> > gcc.log) ?

> >>

> >

> > Ah, Richard pointed out to me that the difference is in "soft" abi, I

> > was only testing Softfp and hard. I'll write a new testcase that should work

> for all.

> >

> 

> Indeed, you override the float-abi flags in your RUNTESTFLAGS, which I'm not

> doing.

> 

> I think your arm-none-eabi builds have soft, softfp and hard multilibs?

> 

> With arm-none-linux-gnueabi[hf], you cannot override float-abi as easily, see

> for instance:

> https://gcc.gnu.org/ml/gcc-patches/2017-11/msg02323.html

> 

> Thanks,

> 

> Christophe

> 

> > Thanks

> >

> >> They are:

> >>

> >> Schedule of variations:

> >>     arm-eabi-aem/-marm/-march=armv7-a/-mfpu=vfpv3-d16/-mfloat-

> >> abi=softfp

> >>     arm-eabi-aem/-mthumb/-march=armv8-a/-mfpu=crypto-neon-fp-

> armv8/-

> >> mfloat-abi=hard

> >>

> >>

> >> /build-arm-none-eabi/obj/gcc2/gcc/xgcc -B/build-arm-none-

> >> eabi/obj/gcc2/gcc/

> >> /src/gcc/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute_2.c -marm

> >> - march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp

> >> -fno-diagnostics-show- caret -fdiagnostics-color=never -ansi

> >> -pedantic-errors -std=gnu99 -ffat-lto- objects -S

> >> -specs=aprofile-validation.specs -Wa,-mno-warn-deprecated -o

> >> pragma_fpu_attribute_2.s

> >>

> >> /build-arm-none-eabi/obj/gcc2/gcc/xgcc -B/build-arm-none-

> >> eabi/obj/gcc2/gcc/

> >> /src/gcc/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute.c -marm -

> >> march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp

> >> -fno-diagnostics-show- caret -fdiagnostics-color=never -ansi

> >> -pedantic-errors -std=gnu99 -ffat-lto- objects -S

> >> -specs=aprofile-validation.specs -Wa,-mno-warn-deprecated -o

> >> pragma_fpu_attribute.s

> >>

> >> /build-arm-none-eabi/obj/gcc2/gcc/xgcc -B/build-arm-none-

> >> eabi/obj/gcc2/gcc/

> >> /src/gcc/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute_2.c  -

> mthumb -

> >> march=armv8-a -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard   -fno-

> >> diagnostics-show-caret -fdiagnostics-color=never  -ansi

> >> -pedantic-errors -

> >> std=gnu99 -ffat-lto-objects -S -specs=aprofile-validation.specs -Wa,-mno-

> >> warn-deprecated   -o pragma_fpu_attribute_2.s

> >>

> >> /build-arm-none-eabi/obj/gcc2/gcc/xgcc -B/build-arm-none-

> >> eabi/obj/gcc2/gcc/

> >> /src/gcc/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute.c -mthumb

> >> - march=armv8-a -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard -fno-

> >> diagnostics-show-caret -fdiagnostics-color=never -ansi

> >> -pedantic-errors -

> >> std=gnu99 -ffat-lto-objects -S -specs=aprofile-validation.specs

> >> -Wa,-mno- warn-deprecated -o pragma_fpu_attribute.s

> >>

> >> It's also weird that you only see one of the testcases failing.

> >> The pragma_fpu_attribute.c and pragma_fpu_attribute_2.c should have

> >> the exact same issues.

> >>

> >> >

> >> > Thanks

> >> >

> >> > >

> >> > > I will try to think of  a testcase that doesn't require neon, if

> >> > > I can't I'll just

> >> > remove the tests.

> >> > > They weren't being tested before and if there's no way to

> >> > > reliably test changing fpu options on ARM Then there's no point

> having them.

> >> > >

> >> >

> >> > Yes, that's becoming way too complex for the purpose :(

> >>

> >> I think I can do one using the fmla instructions. So will try that next.

> >>

> >> >

> >> > > Thanks,

> >> > > Tamar

> >> > >

> >> > >>

> >> > >> Christophe
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute.c b/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute.c
index f47c745855e4acc099afd554838dcf7d031f798c..5f039d9bfb2b14f9134f138527fc395b8e273bbb 100644
--- a/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute.c
+++ b/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute.c
@@ -1,11 +1,14 @@ 
 /* Test for target attribute assembly extension generations.  */
 /* { dg-do compile } */
 /* { dg-require-effective-target arm_arch_v8a_ok } */
-/* { dg-additional-options "-std=gnu99 -mfpu=vfpv3-d16" } */
+/* { dg-require-effective-target arm_neon_ok } */
+/* { dg-additional-options "-std=gnu99" } */
 
 #include <stdint.h>
 #include <arm_neon.h>
 
+#pragma GCC target("fpu=vfpv3-d16")
+
 extern uint32_t bar();
 
 __attribute__((target("fpu=crypto-neon-fp-armv8"))) poly64x1_t vsricw(poly64x1_t crc, uint32_t val)
diff --git a/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute_2.c b/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute_2.c
index f23fd83779e57e48c0035b6688a21850d12cb4ab..b710de38612707b9109966f7bbc694a913121cb6 100644
--- a/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute_2.c
+++ b/gcc/testsuite/gcc.target/arm/pragma_fpu_attribute_2.c
@@ -1,11 +1,14 @@ 
 /* Test for #pragma assembly extension generations.  */
 /* { dg-do compile } */
 /* { dg-require-effective-target arm_arch_v8a_ok } */
-/* { dg-additional-options "-std=gnu99 -mfpu=vfpv3-d16" } */
+/* { dg-require-effective-target arm_neon_ok } */
+/* { dg-additional-options "-std=gnu99" } */
 
 #include <stdint.h>
 #include <arm_neon.h>
 
+#pragma GCC target("fpu=vfpv3-d16")
+
 extern uint32_t bar();
 
 #pragma GCC push_options