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

            Bug ID: 81061
           Summary: [7/8 Regression] ICE modifying read-only variable
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Keywords: error-recovery, ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid testcase triggers an ICE since GCC 7.1.0:

=======================
const int i = 0;

void foo()
{
  (0, i) = 1;
}
=======================

bug.cc: In function 'void foo()':
bug.cc:5:12: error: assignment of read-only location '((void)0, i)'
   (0, i) = 1;
            ^
gimplification failed:
0 <integer_cst 0x7f0d328b5288 type <integer_type 0x7f0d328b35e8 int> constant
0>
bug.cc:5:5: internal compiler error: gimplification failed
   (0, i) = 1;
   ~~^~~~
0xc34e38 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gcc/gimplify.c:12261
0xc42ac5 gimplify_modify_expr
        ../../gcc/gcc/gimplify.c:5504
0xc33a52 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gcc/gimplify.c:11297
0xc36e18 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gcc/gimplify.c:6521
0xc3497a gimplify_cleanup_point_expr
        ../../gcc/gcc/gimplify.c:6265
0xc3497a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gcc/gimplify.c:11673
0xc36e18 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gcc/gimplify.c:6521
0xc38711 gimplify_body(tree_node*, bool)
        ../../gcc/gcc/gimplify.c:12494
0xc38bdc gimplify_function_tree(tree_node*)
        ../../gcc/gcc/gimplify.c:12652
0xaceddf cgraph_node::analyze()
        ../../gcc/gcc/cgraphunit.c:665
0xad1763 analyze_functions
        ../../gcc/gcc/cgraphunit.c:1126
0xad2652 symbol_table::finalize_compilation_unit()
        ../../gcc/gcc/cgraphunit.c:2611
Please submit a full bug report, [etc.]

Reply via email to