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

            Bug ID: 83257
           Summary: ICE with flexible array member and
                    -fchkp-narrow-to-innermost-array
           Product: gcc
           Version: 7.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eggert at gnu dot org
  Target Milestone: ---

Created attachment 42778
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42778&action=edit
Source file illustrating compiler bug

I ran into this while trying to compile an experimental version of GNU Emacs
with GCC 7.2.1 20170915 (Red Hat 7.2.1-2) on Fedora 27 x86-64. To reproduce,
compile the attached program v.i with:

gcc -mmpx -fcheck-pointer-bounds -fchkp-narrow-to-innermost-array -S v.i

Output is:

v.i: In function ‘main.chkp’:
v.i:14:1: internal compiler error: Segmentation fault
 }
 ^
Please submit a full bug report,
...

The problem appears to be the use of the flexible array member, in combination
with the -fchkp-narrow-to-innermost-array option.

Reply via email to