[Bug c/97206] [11 Regression] internal compiler error: in composite_type, at c/c-typeck.c:447 since r11-3303-g6450f07388f9fe57

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Sep 25 17:40:57 GMT 2020


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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |msebor at gcc dot gnu.org

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
Hmm, this one is strange.  Somehow the qualifiers on the pointer argument (but
not the type it points to) in the function argument list are ending up in the
type of the array with unspecified bound.  The error is then issued in
diagnose_mismatched_decls when verifying that the qualifiers on the array type
are the same between the two declarations of b.

Something about the change to handle_access_attribute in r11-3303 is causing
the restrict qualifier (or any other qualifier on the pointer argument,
including const and volatile) to be set on the type of the array.

Another test case that reproduces it is:

$ cat pr97206.c && gcc -O2 -S -Wall pr97206.c
void a (char * volatile);
__attribute__((__access__ (__read_only__, 1))) void a (char *volatile);

extern const char b[];
extern const char b[1];
pr97206.c:5:19: error: conflicting type qualifiers for ‘b’
    5 | extern const char b[1];
      |                   ^
pr97206.c:4:19: note: previous declaration of ‘b’ was here
    4 | extern const char b[];
      |                   ^


More information about the Gcc-bugs mailing list