[Bug tree-optimization/121514] [16 Regression] ICE: tree check: expected ssa_name, have integer_cst in VN_INFO, at tree-ssa-sccvn.cc:460 at -O2 with __builtin_mul_overflow() since r16-3131

2025-08-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121514

--- Comment #4 from GCC Commits  ---
The master branch has been updated by Richard Biener :

https://gcc.gnu.org/g:a440b382e43203857de9195eb526c4a16f21ceb1

commit r16-3161-ga440b382e43203857de9195eb526c4a16f21ceb1
Author: Richard Biener 
Date:   Tue Aug 12 09:00:48 2025 +0200

tree-optimization/121514 - ICE with recent VN improvement

When inserting a compensation stmt during VN we are making sure to
register the result for the original stmt into the hashtable so
VN iteration has the chance to converge and we avoid inserting
another copy each time.  But the implementation doesn't work for
non-SSA name values, and is also not necessary for constants since
we did not insert anything for them.  The following appropriately
guards the calls to vn_nary_op_insert_stmt as was already done
in one place.

PR tree-optimization/121514
* tree-ssa-sccvn.cc (visit_nary_op): Only call
vn_nary_op_insert_stmt for SSA name result.

* gcc.dg/torture/pr121514.c: New testcase.

[Bug tree-optimization/121514] [16 Regression] ICE: tree check: expected ssa_name, have integer_cst in VN_INFO, at tree-ssa-sccvn.cc:460 at -O2 with __builtin_mul_overflow() since r16-3131

2025-08-12 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121514

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Richard Biener  ---
Fixed.

[Bug tree-optimization/121514] [16 Regression] ICE: tree check: expected ssa_name, have integer_cst in VN_INFO, at tree-ssa-sccvn.cc:460 at -O2 with __builtin_mul_overflow() since r16-3131

2025-08-12 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121514

--- Comment #3 from Andrew Pinski  ---
Here is another testcase:
```
void ar(int*);
void av() {
  int b[4], d[4];
  for (int c = 0; c < 2; ++c)
b[c] = 0;
  unsigned e[4];
  __builtin_memcpy(e, b, sizeof(b));
  for (int c = 0; c < 4; ++c)
d[c] = e[c];
  ar(d);
}
```
This one is reduced from highway.

[Bug tree-optimization/121514] [16 Regression] ICE: tree check: expected ssa_name, have integer_cst in VN_INFO, at tree-ssa-sccvn.cc:460 at -O2 with __builtin_mul_overflow() since r16-3131

2025-08-11 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121514

Richard Biener  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
 Status|NEW |ASSIGNED

[Bug tree-optimization/121514] [16 Regression] ICE: tree check: expected ssa_name, have integer_cst in VN_INFO, at tree-ssa-sccvn.cc:460 at -O2 with __builtin_mul_overflow() since r16-3131

2025-08-11 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121514

Jakub Jelinek  changed:

   What|Removed |Added

   Last reconfirmed||2025-08-11
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

[Bug tree-optimization/121514] [16 Regression] ICE: tree check: expected ssa_name, have integer_cst in VN_INFO, at tree-ssa-sccvn.cc:460 at -O2 with __builtin_mul_overflow() since r16-3131

2025-08-11 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121514

Jakub Jelinek  changed:

   What|Removed |Added

   Priority|P3  |P1

[Bug tree-optimization/121514] [16 Regression] ICE: tree check: expected ssa_name, have integer_cst in VN_INFO, at tree-ssa-sccvn.cc:460 at -O2 with __builtin_mul_overflow() since r16-3131

2025-08-11 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121514

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org
Summary|[16 Regression] ICE: tree   |[16 Regression] ICE: tree
   |check: expected ssa_name,   |check: expected ssa_name,
   |have integer_cst in |have integer_cst in
   |VN_INFO, at |VN_INFO, at
   |tree-ssa-sccvn.cc:460 at|tree-ssa-sccvn.cc:460 at
   |-O2 with|-O2 with
   |__builtin_mul_overflow()|__builtin_mul_overflow()
   |(?) |since r16-3131

--- Comment #2 from Jakub Jelinek  ---
Started with r16-3131-gf2a85db9eee7d761692ca8f69ea1a20d32715bad