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

            Bug ID: 95465
           Summary: [8/9/10/11 Regression] ICE on jump into a statement
                    expression
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

void
foo ()
{
  sizeof (({ label: 0; }));
  goto label;
}

ICEs with C++:
during GIMPLE pass: cfg
rh1842304.C: In function ‘void foo()’:
rh1842304.C:2:1: internal compiler error: Segmentation fault
    2 | foo ()
      | ^~~
0x15fc130 crash_signal
        ../../gcc/toplev.c:328
0x1658942 main_block_label
        ../../gcc/tree-cfg.c:1455
0x16590e4 cleanup_dead_labels()
        ../../gcc/tree-cfg.c:1639
but with C is rejected:
rh1842304.C: In function ‘foo’:
rh1842304.C:5:3: error: jump into statement expression
    5 |   goto label;
      |   ^~~~
rh1842304.C:4:14: note: label ‘label’ defined here
    4 |   sizeof (({ label: 0; }));
      |              ^~~~~

Used to be accepted by both C and C++ in GCC 3.4, but already r105000 ICEs in
C++ and rejects it in C.

Reply via email to