https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79480

            Bug ID: 79480
           Summary: -O3 and -mfpu=neon produces crashing code on ARM
           Product: gcc
           Version: 7.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tulipawn at gmail dot com
  Target Milestone: ---

The gl-117 binary (source link attached) compiled with:

-mcpu=cortex-a5 -O3 -marm -fomit-frame-pointer -mfpu=neon -ftree-vectorize

crashes with a SIGBUS plus this kernel info:

 Alignment trap: not handling instruction f4620adf at [<00067c8c>]
 Unhandled fault: alignment exception (0x001) at 0x0048fcb1

Moreover, using LTO prints a warning about undefined behaviour:

main.cpp: In function ‘_ZL11myTimerFunci.isra.26’:
main.cpp:4762:29: warning: iteration 256 invokes undefined behavior
[-Waggressive-loop-optimizations]
      int h = heat [yind] [i2];
                             ^
main.cpp:4757:5: note: containing loop
     for (i2 = 0; i2 < maxfx + 1; i2 ++)
     ^

The code is rather old C++ (g++ warns: ISO C++ forbids converting a string
constant to ‘char*’) but as long as -mfpu=neon is not used it doesn't crash,
even with the above warning. Reporting just in case.

Reply via email to