internal compiler error with -fprefetch-loop-arrays

Bug #1264962 reported by Marwijn Hessel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Arm Embedded Toolchain
Invalid
Critical
Terry Guo

Bug Description

When building XSDE (http://www.codesynthesis.com/projects/xsde/) the compiler crashes.
I'm using gcc-arm-none-eabi-4_8-2013q4-20131204-win32.

make -C ../xsde-3.2.0/libxsde
make[1]: Entering directory `/c/Alphatron/tools/xsde-3.2.0/libxsde'
make -C xsde
make[2]: Entering directory `/c/Alphatron/tools/xsde-3.2.0/libxsde/xsde'
generating config.h
arm-none-eabi-gcc -I.. -Wall -O3 -g3 -falign-functions=16 -fdata-sections -ffunction-sections -fomit-frame-pointer -fshort-enums -fsigned-char -fsingle-precision-constant -fprefetch-loop-arrays -funroll-loops -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -mthumb -fexceptions -c c/expat/xmlparse.c -o c/expat/xmlparse.o
arm-none-eabi-gcc -I.. -Wall -O3 -g3 -falign-functions=16 -fdata-sections -ffunction-sections -fomit-frame-pointer -fshort-enums -fsigned-char -fsingle-precision-constant -fprefetch-loop-arrays -funroll-loops -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -mthumb -fexceptions -c c/expat/xmlrole.c -o c/expat/xmlrole.o
arm-none-eabi-gcc -I.. -Wall -O3 -g3 -falign-functions=16 -fdata-sections -ffunction-sections -fomit-frame-pointer -fshort-enums -fsigned-char -fsingle-precision-constant -fprefetch-loop-arrays -funroll-loops -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -mthumb -fexceptions -c c/expat/xmltok.c -o c/expat/xmltok.o
arm-none-eabi-gcc -I.. -Wall -O3 -g3 -falign-functions=16 -fdata-sections -ffunction-sections -fomit-frame-pointer -fshort-enums -fsigned-char -fsingle-precision-constant -fprefetch-loop-arrays -funroll-loops -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -mthumb -fexceptions -c c/genx/genx.c -o c/genx/genx.o
c/genx/genx.c: In function 'genxScrubText':
c/genx/genx.c:808:1: internal compiler error: in reg_overlap_mentioned_p, at rtlanal.c:1469
 }
 ^

c/genx/genx.c:808:1: internal compiler error: Segmentation fault
make[2]: *** [c/genx/genx.o] Error 1
make[2]: Leaving directory `/c/Alphatron/tools/xsde-3.2.0/libxsde/xsde'
make[1]: Leaving directory `/c/Alphatron/tools/xsde-3.2.0/libxsde'
make[1]: *** [xsde] Error 2
make: *** [../xsde-3.2.0/libxsde] Error 2

Terry Guo (terry.guo)
Changed in gcc-arm-embedded:
assignee: nobody → Terry Guo (terry.guo)
Revision history for this message
Terry Guo (terry.guo) wrote :

I am new to this library and unable to find a way to build it for arm baremetal targets. Can you please share your steps to build this lib?

Revision history for this message
Joey Ye (jinyun-ye) wrote : Re: [Bug 1264962] [NEW] internal compiler error
Download full text (5.1 KiB)

Marwijn, can you please generate a case that we can reproduce? Typically
this can be done by adding -E in command line and post the output file.

Thanks
Joey
On Dec 30, 2013 6:15 PM, "Marwijn Hessel" <email address hidden> wrote:

> Public bug reported:
>
> When building XSDE (http://www.codesynthesis.com/projects/xsde/) the
> compiler crashes.
> I'm using gcc-arm-none-eabi-4_8-2013q4-20131204-win32.
>
>
> make -C ../xsde-3.2.0/libxsde
> make[1]: Entering directory `/c/Alphatron/tools/xsde-3.2.0/libxsde'
> make -C xsde
> make[2]: Entering directory `/c/Alphatron/tools/xsde-3.2.0/libxsde/xsde'
> generating config.h
> arm-none-eabi-gcc -I.. -Wall -O3 -g3 -falign-functions=16 -fdata-sections
> -ffunction-sections -fomit-frame-pointer -fshort-enums -fsigned-char
> -fsingle-precision-constant -fprefetch-loop-arrays -funroll-loops
> -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -mthumb -fexceptions
> -c c/expat/xmlparse.c -o c/expat/xmlparse.o
> arm-none-eabi-gcc -I.. -Wall -O3 -g3 -falign-functions=16 -fdata-sections
> -ffunction-sections -fomit-frame-pointer -fshort-enums -fsigned-char
> -fsingle-precision-constant -fprefetch-loop-arrays -funroll-loops
> -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -mthumb -fexceptions
> -c c/expat/xmlrole.c -o c/expat/xmlrole.o
> arm-none-eabi-gcc -I.. -Wall -O3 -g3 -falign-functions=16 -fdata-sections
> -ffunction-sections -fomit-frame-pointer -fshort-enums -fsigned-char
> -fsingle-precision-constant -fprefetch-loop-arrays -funroll-loops
> -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -mthumb -fexceptions
> -c c/expat/xmltok.c -o c/expat/xmltok.o
> arm-none-eabi-gcc -I.. -Wall -O3 -g3 -falign-functions=16 -fdata-sections
> -ffunction-sections -fomit-frame-pointer -fshort-enums -fsigned-char
> -fsingle-precision-constant -fprefetch-loop-arrays -funroll-loops
> -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -mthumb -fexceptions
> -c c/genx/genx.c -o c/genx/genx.o
> c/genx/genx.c: In function 'genxScrubText':
> c/genx/genx.c:808:1: internal compiler error: in reg_overlap_mentioned_p,
> at rtlanal.c:1469
> }
> ^
>
> c/genx/genx.c:808:1: internal compiler error: Segmentation fault
> make[2]: *** [c/genx/genx.o] Error 1
> make[2]: Leaving directory `/c/Alphatron/tools/xsde-3.2.0/libxsde/xsde'
> make[1]: Leaving directory `/c/Alphatron/tools/xsde-3.2.0/libxsde'
> make[1]: *** [xsde] Error 2
> make: *** [../xsde-3.2.0/libxsde] Error 2
>
> ** Affects: gcc-arm-embedded
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are a member of GCC ARM
> Embedded Maintainers, which is subscribed to GCC ARM Embedded.
> https://bugs.launchpad.net/bugs/1264962
>
> Title:
> internal compiler error
>
> Status in GNU Tools for ARM Embedded Processors:
> New
>
> Bug description:
> When building XSDE (http://www.codesynthesis.com/projects/xsde/) the
> compiler crashes.
> I'm using gcc-arm-none-eabi-4_8-2013q4-20131204-win32.
>
>
> make -C ../xsde-3.2.0/libxsde
> make[1]: Entering directory `/c/Alphatron/tools/xsde-3.2.0/libxsde'
> make -C xsde
> make[2]: Entering directory `/c/Alphatron/tools/xsde-3.2.0/libxsde/xsde'
> generatin...

Read more...

Revision history for this message
Marwijn Hessel (marwijn-hessel) wrote :

Hi,

The requested logging.
Strangely the compiler does not fail when adding the option -E.
I made two log files, one with and one without the -E option.
Also I added the used configuration file for the XSDE project.
You can download the XSDE project code from 'http://www.codesynthesis.com/download/xsde/3.2/xsde-3.2.0.tar.bz2'.
When changing the 'xsde-3.2.0\config\config,make' into the attached 'config.make' you should be able to reproduce the failure.

Kind regards,
Marwijn

Revision history for this message
Terry Guo (terry.guo) wrote : Re: internal compiler error

Hi,

Thanks for providing information. But there is no path "xsde-3.2.0\config\config,make" after I decompress the bz2 file. And I think you mean config.mak, not "config,make". Here is what I got:

terguo01@terry-pc01:xsde-3.2.0$ ls
build documentation GPLv2 libxsde makefile README version
dist examples INSTALL LICENSE NEWS tests xsde
terguo01@terry-pc01:xsde-3.2.0$

Should I run some commands after decompression?

Revision history for this message
Marwijn Hessel (marwijn-hessel) wrote : RE: [Bug 1264962] Re: internal compiler error

Oeps,sorry I send you the wrong link.
Try this one 'http://www.codesynthesis.com/download/xsde/3.2/windows/i686/xsde-3.2.0-i686-windows.zip'.
Then it will work ...

Kind regards,
Marwijn

Revision history for this message
Terry Guo (terry.guo) wrote : Re: internal compiler error

OK. This time I can reproduce the issue.

By the way, the -E option will make gcc stop and exit right after the preprocess stage. The source won't be compiled.

Terry Guo (terry.guo)
Changed in gcc-arm-embedded:
status: New → Confirmed
importance: Undecided → Critical
milestone: none → 4.8-2014-q1-update
Revision history for this message
Terry Guo (terry.guo) wrote :

I can confirm it is a bug of gcc 4.8 including upstream gcc 4.8. It is caused by compiler option -fprefetch-loop-arrays which will generate following rtx for pld instruction:

(insn 99 100 105 10 (prefetch (plus:SI (reg/v/f:SI 3 r3 [orig:143 last ] [143])
            (const_int 34 [0x22]))
        (const_int 0 [0])
        (const_int 3 [0x3])) 343 {prefetch}
     (nil))

Current gcc 4.8 can't handle it very well, thus trigger internal compiler error. The related gcc mainline function is improved and can handle it well, thus no such error. In next Q1 update release, we will back port the fix to 4.8 and solve this issue.

For the time being, you can workaround the issue by removing option -fprefetch-loop-arrays.

Terry Guo (terry.guo)
Changed in gcc-arm-embedded:
status: Confirmed → Fix Committed
Revision history for this message
Terry Guo (terry.guo) wrote :

As discussed here http://gcc.gnu.org/ml/gcc-patches/2014-01/msg00847.html and here http://gcc.gnu.org/ml/gcc-patches/2014-01/msg01055.html. The fix is now submitted to upstream 4.8 branch and merged to embedded 4.8 branch after a recent sync up.

Joey Ye (jinyun-ye)
summary: - internal compiler error
+ internal compiler error with -fprefetch-loop-arrays
Terry Guo (terry.guo)
Changed in gcc-arm-embedded:
status: Fix Committed → Fix Released
Revision history for this message
Marwijn Hessel (marwijn-hessel) wrote :

Unfortunately this bug isn’t fixed, the is still compiler crashing.
When removing the ‘-fprefetch-loop-arrays’ the issue is gone.

Reopen this bug?

Changed in gcc-arm-embedded:
status: Fix Released → Opinion
status: Opinion → Invalid
Revision history for this message
Terry Guo (terry.guo) wrote :

I can successfully build the whole xsde project with your config.mak and 4.8 2014q1 release. Please make sure you are using this latest released tool chain.

terguo01@terry-pc01:xsde$ /work/terguo01/tasks/launchpad-1301322/gcc-arm-none-eabi-4_8-2014q1/bin/arm-none-eabi-gcc -I.. -Wall -O3 -g3 -falign-functions=16 -fdata-sections -ffunction-sections -fomit-frame-pointer -fshort-enums -fsigned-char -fsingle-precision-constant -fprefetch-loop-arrays -funroll-loops -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -mthumb -fexceptions -c c/genx/genx.c -o c/genx/genx.o
terguo01@terry-pc01:xsde$ /work/terguo01/tasks/launchpad-1301322/gcc-arm-none-eabi-4_8-2014q1/bin/arm-none-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=/work/terguo01/tasks/launchpad-1301322/gcc-arm-none-eabi-4_8-2014q1/bin/arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/work/terguo01/tasks/launchpad-1301322/gcc-arm-none-eabi-4_8-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/lto-wrapper
Target: arm-none-eabi
Configured with: /home/build/work/GCC-4-8-build/src/gcc/configure --target=arm-none-eabi --prefix=/home/build/work/GCC-4-8-build/install-native --libexecdir=/home/build/work/GCC-4-8-build/install-native/lib --infodir=/home/build/work/GCC-4-8-build/install-native/share/doc/gcc-arm-none-eabi/info --mandir=/home/build/work/GCC-4-8-build/install-native/share/doc/gcc-arm-none-eabi/man --htmldir=/home/build/work/GCC-4-8-build/install-native/share/doc/gcc-arm-none-eabi/html --pdfdir=/home/build/work/GCC-4-8-build/install-native/share/doc/gcc-arm-none-eabi/pdf --enable-languages=c,c++ --enable-plugins --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-newlib --with-headers=yes --with-python-dir=share/gcc-arm-none-eabi --with-sysroot=/home/build/work/GCC-4-8-build/install-native/arm-none-eabi --build=i686-linux-gnu --host=i686-linux-gnu --with-gmp=/home/build/work/GCC-4-8-build/build-native/host-libs/usr --with-mpfr=/home/build/work/GCC-4-8-build/build-native/host-libs/usr --with-mpc=/home/build/work/GCC-4-8-build/build-native/host-libs/usr --with-isl=/home/build/work/GCC-4-8-build/build-native/host-libs/usr --with-cloog=/home/build/work/GCC-4-8-build/build-native/host-libs/usr --with-libelf=/home/build/work/GCC-4-8-build/build-native/host-libs/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='GNU Tools for ARM Embedded Processors' --with-multilib-list=armv6-m,armv7-m,armv7e-m,armv7-r
Thread model: single
gcc version 4.8.3 20140228 (release) [ARM/embedded-4_8-branch revision 208322] (GNU Tools for ARM Embedded Processors)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.