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

            Bug ID: 101702
           Summary: [12 Regression] ICE: in handle_argspec_attribute, at
                    c-family/c-attribs.c:3623
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat 44.c 

double foo(double x[!__builtin_copysignf(~2, 3)]);

double bar(double x)
{
  return foo(x);
}

----------------------------------------------------------------

$ gcc-sp12 --version
gcc (GCC) 12.0.0 20210718 (experimental)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

----------------------------------------------------------------

$ gcc-sp12 44.c 
44.c:2:1: internal compiler error: in handle_argspec_attribute, at
c-family/c-attribs.c:3623
    2 | double foo(double x[!__builtin_copysignf(~2, 3)]);
      | ^~~~~~
0x69526e handle_argspec_attribute
        ../../gcc-12-20210718/gcc/c-family/c-attribs.c:3623
0x873fcc decl_attributes(tree_node**, tree_node*, int, tree_node*)
        ../../gcc-12-20210718/gcc/attribs.c:720
0x891fc2 push_parm_decl(c_parm const*, tree_node**)
        ../../gcc-12-20210718/gcc/c/c-decl.c:5903
0x8e9a39 c_parser_parms_list_declarator
        ../../gcc-12-20210718/gcc/c/c-parser.c:4291
0x8e9d88 c_parser_parms_declarator
        ../../gcc-12-20210718/gcc/c/c-parser.c:4217
0x8e1e48 c_parser_direct_declarator_inner
        ../../gcc-12-20210718/gcc/c/c-parser.c:4130
0x8ee858 c_parser_declaration_or_fndef
        ../../gcc-12-20210718/gcc/c/c-parser.c:2148
0x8f7773 c_parser_external_declaration
        ../../gcc-12-20210718/gcc/c/c-parser.c:1777
0x8f81b9 c_parser_translation_unit
        ../../gcc-12-20210718/gcc/c/c-parser.c:1650
0x8f81b9 c_parse_file()
        ../../gcc-12-20210718/gcc/c/c-parser.c:22121
0x957cbd c_common_parse_file()
        ../../gcc-12-20210718/gcc/c-family/c-opts.c:1223
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.

----------------------------------------------------------------

$ gcc-sp11 --version
gcc (GCC) 11.1.1 20210717
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

----------------------------------------------------------------

$ gcc-sp11 44.c 
44.c: In function ‘bar’:
44.c:6:14: error: incompatible type for argument 1 of ‘foo’
    6 |   return foo(x);
      |              ^
      |              |
      |              double
44.c:2:19: note: expected ‘double *’ but argument is of type ‘double’
    2 | double foo(double x[!__builtin_copysignf(~2, 3)]);
      |            ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to