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

            Bug ID: 96171
           Summary: ICE on invalid VLA argument declaration and attribute
                    access
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

Specifying attribute access on an invalid function declaration involving a VLA
and an only subsequently declared bound parameter triggers an ICE:

$ cat q.c && gcc -S -Wall q.c
__attribute__ ((access (read_write, 1))) void f (int[n], int n);

q.c:1:54: error: ā€˜n’ undeclared here (not in a function)
    1 | __attribute__ ((access (read_write, 1))) void f (int[n], int n);
      |                                                      ^
ā€˜
in print_type, at c/c-objc-common.c:188
    1 | __attribute__ ((access (read_write, 1))) void f (int[n], int n);
      | ^~~~~~~~~~~~~
0x969bd2 print_type
        /src/gcc/master/gcc/c/c-objc-common.c:188
0x96a268 c_tree_printer
        /src/gcc/master/gcc/c/c-objc-common.c:310
0x23bd4d5 pp_format(pretty_printer*, text_info*)
        /src/gcc/master/gcc/pretty-print.c:1475
0x2397247 diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
        /src/gcc/master/gcc/diagnostic.c:1159
0x239786b diagnostic_impl
        /src/gcc/master/gcc/diagnostic.c:1309
0x2398ad6 error(char const*, ...)
        /src/gcc/master/gcc/diagnostic.c:1605
0xa6789d handle_access_attribute
        /src/gcc/master/gcc/c-family/c-attribs.c:4134
0x8df64f decl_attributes(tree_node**, tree_node*, int, tree_node*)
        /src/gcc/master/gcc/attribs.c:714
0x8f895e c_decl_attributes
        /src/gcc/master/gcc/c/c-decl.c:5002
0x8f8ea9 start_decl(c_declarator*, c_declspecs*, bool, tree_node*)
        /src/gcc/master/gcc/c/c-decl.c:5141
0x96e7d8 c_parser_declaration_or_fndef
        /src/gcc/master/gcc/c/c-parser.c:2299
0x96d426 c_parser_external_declaration
        /src/gcc/master/gcc/c/c-parser.c:1773
0x96cf47 c_parser_translation_unit
        /src/gcc/master/gcc/c/c-parser.c:1646
0x9ab605 c_parse_file()
        /src/gcc/master/gcc/c/c-parser.c:21822
0xa375d1 c_common_parse_file()
        /src/gcc/master/gcc/c-family/c-opts.c:1194
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Reply via email to