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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-checking,
                   |                            |ice-on-valid-code,
                   |                            |needs-bisection, wrong-code
             Status|UNCONFIRMED                 |NEW
          Component|tree-optimization           |ipa
                 CC|                            |jamborm at gcc dot gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2026-08-28
   Target Milestone|---                         |17.0
            Summary|[17 Regression] ICE at -O2  |[17 Regression] unrenamed
                   |during GIMPLE pass:         |symbol after IPA SRA
                   |adjust_alignment            |

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
We ICE on

2639      execute_todo (pass->todo_flags_start);

so a previous thing caused SSA updates to be necessary, which is fixup_cfg.
And ...

Hardware watchpoint 8: *$7

Old value = 4
New value = 5

#0  operands_scanner::add_stmt_operand (this=0x7fffffffd190, 
    var_p=0x7ffff761ceb8, flags=1)
    at ../../src/gcc/gcc/tree-ssa-operands.cc:611
#1  0x0000000001d768a8 in operands_scanner::get_expr_operands (
    this=0x7fffffffd190, expr_p=0x7ffff761ceb8, flags=1)
    at ../../src/gcc/gcc/tree-ssa-operands.cc:809
#2  0x0000000001d76c95 in operands_scanner::get_expr_operands (
    this=0x7fffffffd190, expr_p=0x7ffff74370a0, flags=1)
    at ../../src/gcc/gcc/tree-ssa-operands.cc:897
#3  0x0000000001d76ff8 in operands_scanner::parse_ssa_operands (
    this=0x7fffffffd190) at ../../src/gcc/gcc/tree-ssa-operands.cc:991
#4  0x0000000001d7711b in operands_scanner::verify_ssa_operands (
    this=0x7fffffffd190) at ../../src/gcc/gcc/tree-ssa-operands.cc:1033
#5  0x0000000001d7756a in verify_ssa_operands (fn=0x7ffff7fb6340, 
    stmt=<gimple_assign 0x7ffff7437058>)
    at ../../src/gcc/gcc/tree-ssa-operands.cc:1113
#6  0x0000000001e4caf0 in verify_ssa (check_modified_stmt=true, 
    check_ssa_operands=true) at ../../src/gcc/gcc/tree-ssa.cc:11

(gdb) p cfun->gimple_df->ssa_renaming_needed
$10 = 1

which is the verify_ssa after fixup_cfg.

I have a patch to improve verification to catch this at the correct place.

t.c: In function ‘f3’:
t.c:19:6: error: statement contains unrenamed symbols
   19 | void f3() { f4((struct s0){}, 9); }
      |      ^~
BIT_FIELD_REF <ISRA.3, 16, 16> = 6;
during GIMPLE pass: fixup_cfg
t.c:19:6: internal compiler error: verify_ssa failed
0x3c20cc4 internal_error(char const*, ...)
        ../../src/gcc/gcc/diagnostic-global-context.cc:787
0x1e4d350 verify_ssa(bool, bool)

with -fno-inline we see

void f4.constprop.isra (v4u16 ISRA.3)
{
  uint32_t a2;
  uint32_t v11;
  struct s0 a1;
  vector(4) short unsigned int _2;

  <bb 6> [local count: 1073741824]:

  <bb 2> [local count: 1073741824]:

  <bb 3> [local count: 1073741824]:
  BIT_FIELD_REF <ISRA.3, 16, 16> = 6;
  switch (v11_1(D)) <default: <L1> [50.00%], case 10418: <L0> [50.00%], case
60428: <L0> [50.00%], case 2039730824: <L0> [50.00%]>

  <bb 4> [local count: 536870912]:
<L0>:
  _2 = ISRA.3_5(D);
  g4 = _2;

which is broken.  Iff ISRA.3 is not supposed to be renamed then it should
have DECL_NOT_GIMPLE_REG_P set, but we seem to replace a structure with
a register type.

Reply via email to