Re: [arm-gnu] Possible bug in g++ frontend (G++ Lite arm-2009q1-203)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [arm-gnu] Possible bug in g++ frontend (G++ Lite arm-2009q1-203)



ext ext Daniel Jacobowitz wrote:
On Tue, Oct 13, 2009 at 05:23:44PM +0300, Juha Kallioinen wrote:
-march=armv7-a -mcpu=cortex-a8 %{!mfpu:-mfpu=vfp} -mfloat-abi=softfp

Does %{!mfpu=*:-mfpu=vfp} work better?

Yes, that works! Thanks :)

Similar line works with cc1 spec.

There really should be no difference in specs processing between
gcc/cc1 and g++/cc1plus.  I'm confused by your results; for example,
the above shouldn't have worked in either case.

Well, I'm just reporting what I've observed. I'm using the downloaded toolchain as-is and in this case there is some difference in the way gcc and g++ follow the spec rules when the rules are identical.

To me it looks like g++ inserts the spec file rule twice and gcc only once and is this might be the reason why they behave differently. I don't know if this is the correct way to observe it, but it can be seen in the logs below.

Here's a snippet from the output of:

$ echo | bin/arm-none-linux-gnueabi-g++ -xc++ -specs=./gcc.specs -v -
...
gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203)
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-funwind-tables'

/home/kaltsi/tmp/cs/arm-2009q1/bin/../libexec/gcc/arm-none-linux-gnueabi/4.3.3/cc1plus -quiet -v -iprefix /home/kaltsi/tmp/cs/arm-2009q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/ -isysroot /home/kaltsi/tmp/cs/arm-2009q1/bin/../arm-none-linux-gnueabi/libc -D_GNU_SOURCE - -march=armv7-a -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wno-poison-system-directories -quiet -dumpbase - -auxbase - -version -funwind-tables -march=armv7-a -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wno-poison-system-directories -o /tmp/ccUSlt1v.s
...

See that the -march and -mcpu etc options that come from the specs file are there twice.

Now with gcc:

$  echo | bin/arm-none-linux-gnueabi-gcc -xc -specs=./gcc.specs -v -
...
gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203)
COLLECT_GCC_OPTIONS='-v' '-funwind-tables'

/home/kaltsi/tmp/cs/arm-2009q1/bin/../libexec/gcc/arm-none-linux-gnueabi/4.3.3/cc1 -quiet -v -iprefix /home/kaltsi/tmp/cs/arm-2009q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/ -isysroot /home/kaltsi/tmp/cs/arm-2009q1/bin/../arm-none-linux-gnueabi/libc - -march=armv7-a -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wno-poison-system-directories -quiet -dumpbase - -auxbase - -version -funwind-tables -o /tmp/ccy7783x.s
...

those same options are there only once.

When I was using my original specs file, g++ would insert the -mfpu=vfp there twice and the latter one would override user's command line option. Gcc would not.

Here's what the same output looks like with the original spec file:

$ echo | bin/arm-none-linux-gnueabi-g++ -xc++ -specs=orig.specs -v -mfpu=neon -

...
gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203)
COLLECT_GCC_OPTIONS='-v' '-mfpu=neon' '-shared-libgcc' '-funwind-tables'

/home/kaltsi/tmp/cs/arm-2009q1/bin/../libexec/gcc/arm-none-linux-gnueabi/4.3.3/cc1plus -quiet -v -iprefix /home/kaltsi/tmp/cs/arm-2009q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/ -isysroot /home/kaltsi/tmp/cs/arm-2009q1/bin/../arm-none-linux-gnueabi/libc -D_GNU_SOURCE -isystem /usr/local/include -isystem /usr/include - -march=armv7-a -mcpu=cortex-a8 -mfloat-abi=softfp -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wno-poison-system-directories -quiet -dumpbase - -mfpu=neon -auxbase - -version -funwind-tables -march=armv7-a -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=softfp -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wno-poison-system-directories -o /tmp/ccbYJKSV.s
...

The -mfpu=vfp from the spec file ends up being the last mfpu option on the command line.

--
Juha Kallioinen