This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [PATCH][GCC][ARM] Fix failing testcase pragma_fpu_attribute.c
- From: Tamar Christina <Tamar dot Christina at arm dot com>
- To: Christophe Lyon <christophe dot lyon at linaro dot org>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, nd <nd at arm dot com>, Ramana Radhakrishnan <Ramana dot Radhakrishnan at arm dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>, "nickc at redhat dot com" <nickc at redhat dot com>, "Kyrylo Tkachov" <Kyrylo dot Tkachov at arm dot com>
- Date: Mon, 11 Dec 2017 11:37:06 +0000
- Subject: RE: [PATCH][GCC][ARM] Fix failing testcase pragma_fpu_attribute.c
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Tamar dot Christina at arm dot com;
- Nodisclaimer: True
- References: <20171208145315.GA25009@arm.com> <CAKdteObOkozJG=JXZS3L5XHmA8iVgwzHZP6wCEj3RJPgfsJUmg@mail.gmail.com> <HE1PR08MB0507E3972DC337178FDA10E0FF370@HE1PR08MB0507.eurprd08.prod.outlook.com> <CAKdteObfDYKhpuwUe_LJ0jc+PpbS2k9kPO5VMV-722G94NkfnQ@mail.gmail.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
> -----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