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

            Bug ID: 79962
           Summary: [7 Regression] ICE nonnull_check_p on a function
                    template with a type-dependent attribute nonnull
           Product: gcc
           Version: 7.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: ---

Today's top of trunk fails with an ICE on the following test case.  r245606
compiles the test case successfully so this is a recent regression.

$ cat t.C && /ssd/build/gcc-git/gcc/xgcc -B /ssd/build/gcc-git/gcc  -S -Wall
-Wextra -Wnonnull t.C
template <class T>
void f (typename T::U) __attribute__ ((__nonnull__ (T::i)));

struct S { enum { i = 1 }; typedef void* U; };

void g ()
{
  f<S>(0);
}

t.C: In function ‘void g()’:
t.C:8:9: internal compiler error: in nonnull_check_p, at
c-family/c-common.c:5423
   f<S>(0);
         ^
0xb1ee7d nonnull_check_p
        /ssd/src/gcc/git/gcc/c-family/c-common.c:5423
0xb1e843 check_function_nonnull
        /ssd/src/gcc/git/gcc/c-family/c-common.c:5301
0xb1f811 check_function_arguments(unsigned int, tree_node const*, tree_node
const*, int, tree_node**)
        /ssd/src/gcc/git/gcc/c-family/c-common.c:5661
0x7ea3b0 build_over_call
        /ssd/src/gcc/git/gcc/cp/call.c:7917
0x7dbc4b build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, bool, int)
        /ssd/src/gcc/git/gcc/cp/call.c:4278
0xa0f3a4 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
        /ssd/src/gcc/git/gcc/cp/semantics.c:2441
0x94c8f0 cp_parser_postfix_expression
        /ssd/src/gcc/git/gcc/cp/parser.c:6994
0x94efe2 cp_parser_unary_expression
        /ssd/src/gcc/git/gcc/cp/parser.c:8102
0x94fe35 cp_parser_cast_expression
        /ssd/src/gcc/git/gcc/cp/parser.c:8780
0x94ff23 cp_parser_binary_expression
        /ssd/src/gcc/git/gcc/cp/parser.c:8882
0x950c40 cp_parser_assignment_expression
        /ssd/src/gcc/git/gcc/cp/parser.c:9170
0x950fdb cp_parser_expression
        /ssd/src/gcc/git/gcc/cp/parser.c:9337
0x9542f8 cp_parser_expression_statement
        /ssd/src/gcc/git/gcc/cp/parser.c:10885
0x953c69 cp_parser_statement
        /ssd/src/gcc/git/gcc/cp/parser.c:10701
0x954847 cp_parser_statement_seq_opt
        /ssd/src/gcc/git/gcc/cp/parser.c:11027
0x954742 cp_parser_compound_statement
        /ssd/src/gcc/git/gcc/cp/parser.c:10981
0x968239 cp_parser_function_body
        /ssd/src/gcc/git/gcc/cp/parser.c:21430
0x968402 cp_parser_ctor_initializer_opt_and_function_body
        /ssd/src/gcc/git/gcc/cp/parser.c:21466
0x971791 cp_parser_function_definition_after_declarator
        /ssd/src/gcc/git/gcc/cp/parser.c:26254
0x971595 cp_parser_function_definition_from_specifiers_and_declarator
        /ssd/src/gcc/git/gcc/cp/parser.c:26166
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