[Bug middle-end/120564] [12/13/14/15/16 Regression] ICE: verify_gimple failed during IPA pass: *free_lang_data

2025-06-05 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120564

--- Comment #3 from Andrew Pinski  ---
(In reply to Richard Biener from comment #2)
> openmp expansion introduces this, not sure why we don't verify after that.

I noticed that execute_one_ipa_transform_pass had a comment about verifying the
IR but didn't do it; I fixed the comment as when I changed it to verify instead
I got a failure right during IPA-CP which I didn't look into.

[Bug middle-end/120564] [12/13/14/15/16 Regression] ICE: verify_gimple failed during IPA pass: *free_lang_data

2025-06-05 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120564

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
 CC||jakub at gcc dot gnu.org

--- Comment #2 from Richard Biener  ---
openmp expansion introduces this, not sure why we don't verify after that.

  v3 = 10;
  v2 = v2 + 18446744073709551613;
  if ((signed long) v2 < 0)

looks like failed re(?)-gimplification.  The condition is built from

#0  0x0349fde6 in extract_omp_for_update_vars (fd=0x7fffd830, 
nonrect_bounds=0x0, cont_bb=, 
body_bb=)
at ../../src/gcc/gcc/omp-expand.cc:3286
#1  0x034b16d0 in expand_omp_for_static_chunk (region=0x4a671f0, 
fd=0x7fffd830, inner_stmt=)
at ../../src/gcc/gcc/omp-expand.cc:6253
#2  0x034bd227 in expand_omp_for (region=0x4a671f0, 
inner_stmt=) at ../../src/gcc/gcc/omp-expand.cc:8267

3286  t = fold_build2 (fd->loops[i].cond_code, boolean_type_node,
v, t);
3287  stmt = gimple_build_cond_empty (t);

where the latter function doesn't seem to be able to deal with this kind
of folded condition (the plain condition w/o folding would have been OK).

we do

3289  if (walk_tree (gimple_cond_lhs_ptr (as_a  (stmt)),
3290 expand_omp_regimplify_p, NULL, NULL)
3291  || walk_tree (gimple_cond_rhs_ptr (as_a 
(stmt)),
3292expand_omp_regimplify_p, NULL, NULL))
3293gimple_regimplify_operands (stmt, &gsi);

but expand_omp_regimplify_p is oddly simplistic, so maybe we were not supposed
to end up with a conversion in one of the operands.

Leaving to Jakub.

[Bug middle-end/120564] [12/13/14/15/16 Regression] ICE: verify_gimple failed during IPA pass: *free_lang_data

2025-06-05 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120564

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||needs-bisection
 Status|UNCONFIRMED |NEW
  Known to work||5.1.0
Summary|ICE: verify_gimple failed   |[12/13/14/15/16 Regression]
   |during IPA pass:|ICE: verify_gimple failed
   |*free_lang_data |during IPA pass:
   ||*free_lang_data
 Ever confirmed|0   |1
   Target Milestone|--- |12.5
   Last reconfirmed||2025-06-06

--- Comment #1 from Andrew Pinski  ---
Confirmed. It looks like it didn't ICE in GCC 5.5.

  v3D.2368 = 10;
  v2D.2371 = v2D.2371 + 18446744073709551613;
  if (0 != 0)


vs:
  v3D.2400 = 10;
  v2D.2403 = v2D.2403 + 18446744073709551613;
  if ((signed long) v2D.2403 < 0)