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

            Bug ID: 97189
           Summary: [11 Regression] ICE in attr_access::array_as_string at
                    gcc/attribs.c:2276 since r11-3303-g6450f07388f9fe57
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: msebor at gcc dot gnu.org
  Target Milestone: ---

The following fails:

$ cat attr.c
#define RW(...) __attribute__((access(read_write, __VA_ARGS__)))
RW(2, 3) void f1(int n, int[n], int);
RW(2) void f2(int, int[*], int);
RW(2, 3) void f2(int, int[], int);

$ gcc attr.c -c
attr.c:2:22: warning: attribute ‘access (read_write, 2, 3)’ positional argument
2 conflicts with previous designation by argument 3 [-Wattributes]
    2 | RW(2, 3) void f1(int n, int[n], int);
      |                  ~~~~^
attr.c:2:22: note: designating the bound of variable length array argument 2
attr.c:4:1: internal compiler error: Segmentation fault
    4 | RW(2, 3) void f2(int, int[], int);
      | ^~
0xd9e6ff crash_signal
        /home/marxin/Programming/gcc/gcc/toplev.c:329
0x7ffff788652f ???
       
/usr/src/debug/glibc-2.31-6.3.x86_64/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x7e3304 tree_check(tree_node*, char const*, int, char const*, tree_code)
        /home/marxin/Programming/gcc/gcc/tree.h:3298
0x7e3304 attr_access::array_as_string[abi:cxx11](tree_node*) const
        /home/marxin/Programming/gcc/gcc/attribs.c:2276
0x8e96fe warn_parm_array_mismatch(unsigned int, tree_node*, tree_node*)
        /home/marxin/Programming/gcc/gcc/c-family/c-warn.c:3424
0x85c5dc c_parser_declaration_or_fndef
        /home/marxin/Programming/gcc/gcc/c/c-parser.c:2346
0x865383 c_parser_external_declaration
        /home/marxin/Programming/gcc/gcc/c/c-parser.c:1777
0x865e81 c_parser_translation_unit
        /home/marxin/Programming/gcc/gcc/c/c-parser.c:1650
0x865e81 c_parse_file()
        /home/marxin/Programming/gcc/gcc/c/c-parser.c:21821
0x8c054d c_common_parse_file()
        /home/marxin/Programming/gcc/gcc/c-family/c-opts.c:1188
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