[Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam

2023-02-20 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108825

Richard Biener  changed:

   What|Removed |Added

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

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

[Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam

2023-02-20 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108825

Richard Biener  changed:

   What|Removed |Added

   Keywords|needs-bisection |

--- Comment #11 from Richard Biener  ---
The issue is that unroll-and-jam applies RPO VN on the transformed body but
that leaves the IL in "indetermined" state (it returns a TODO to make it valid
again).  But unroll-and-jam then continues to transform another loop and
in using the tree_unroll_loop helper runs into tree_transform_and_unroll_loop
performing IL checking

  checking_verify_flow_info ();
  checking_verify_loop_structure ();
  checking_verify_loop_closed_ssa (true, loop);
  if (new_loop)
checking_verify_loop_closed_ssa (true, new_loop);

in particular the loop-specific LC SSA verifiers run function-wide SSA
verification.

In generally IL verification in these kind of helpers is frowned upon since
it easily results in quadraticness when checking is enabled.

I'm "fixing" the loop-local LC SSA verifier to not perform function-wide
SSA verification but the real fix would be to delete all of the above
(and rely on after-pass IL verification).

[Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam

2023-02-20 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108825

--- Comment #12 from CVS Commits  ---
The master branch has been updated by Richard Biener :

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

commit r13-6138-gae113080a9f98e807db239f3ad2157c64324542f
Author: Richard Biener 
Date:   Mon Feb 20 09:54:37 2023 +0100

tree-optimization/108825 - checking ICE with unroll-and-jam

The issue is that unroll-and-jam applies RPO VN on the transformed body but
that leaves the IL in "indetermined" state (it returns a TODO to make it
valid again).  But unroll-and-jam then continues to transform another loop
and
in using the tree_unroll_loop helper runs into
tree_transform_and_unroll_loop
performing IL checking on the whole function.

While the real fix is to elide all such checking I'm only making the
loop-local LC SSA verifier not perform function-wide SSA verification
at this point.

PR tree-optimization/108825
* tree-ssa-loop-manip.cc (verify_loop_closed_ssa): For
loop-local verfication only verify there's no pending SSA
update.

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

[Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam

2023-02-17 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108825

Richard Biener  changed:

   What|Removed |Added

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

--- Comment #10 from Richard Biener  ---
I will have a look.

[Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam

2023-02-16 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108825

--- Comment #9 from David Binderman  ---
(In reply to David Binderman from comment #8)
> (In reply to Andrew Pinski from comment #7)
> > (In reply to David Binderman from comment #6)
> > > git range now seems to be g:0cbb756fe9c8e13a .. g:bd044dae51caea3c,
> > > which is 6 commits.
> > 
> > Most likely r13-3875-g9e11ceef165bc0 .
> 
> Agreed. Over to Richard for their best advice.

Bisection finished. It does appear to be this revision.

[Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam

2023-02-16 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108825

David Binderman  changed:

   What|Removed |Added

 CC||rguenther at suse dot de

--- Comment #8 from David Binderman  ---
(In reply to Andrew Pinski from comment #7)
> (In reply to David Binderman from comment #6)
> > git range now seems to be g:0cbb756fe9c8e13a .. g:bd044dae51caea3c,
> > which is 6 commits.
> 
> Most likely r13-3875-g9e11ceef165bc0 .

Agreed. Over to Richard for their best advice.

[Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam

2023-02-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108825

--- Comment #7 from Andrew Pinski  ---
(In reply to David Binderman from comment #6)
> git range now seems to be g:0cbb756fe9c8e13a .. g:bd044dae51caea3c,
> which is 6 commits.

Most likely r13-3875-g9e11ceef165bc0 .

[Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam

2023-02-16 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108825

--- Comment #6 from David Binderman  ---
git range now seems to be g:0cbb756fe9c8e13a .. g:bd044dae51caea3c,
which is 6 commits.

[Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam

2023-02-16 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108825

--- Comment #5 from David Binderman  ---
(In reply to David Binderman from comment #4)
> git range now seems to be g:59ad8b684dd67e17 .. g:3b54cc9d04c2efb2,
> which is 103 commits.

git range now seems to be g:0cbb756fe9c8e13a .. g:3b54cc9d04c2efb2,
which is 26 commits.

[Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam

2023-02-16 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108825

--- Comment #4 from David Binderman  ---
git range now seems to be g:59ad8b684dd67e17 .. g:3b54cc9d04c2efb2,
which is 103 commits.

[Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam

2023-02-16 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108825

--- Comment #3 from David Binderman  ---
(In reply to David Binderman from comment #2)
> Trying revision 1191a412bb17a734.

Seems bad. Trying 59ad8b684dd67e17.

[Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam

2023-02-16 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108825

--- Comment #2 from David Binderman  ---
Trying revision 1191a412bb17a734.

[Bug tree-optimization/108825] [13 Regression] error during GIMPLE pass: unrolljam

2023-02-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108825

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Keywords||ice-checking
Summary|error during GIMPLE pass:   |[13 Regression] error
   |unrolljam   |during GIMPLE pass:
   ||unrolljam
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2023-02-16
   Target Milestone|--- |13.0

--- Comment #1 from Andrew Pinski  ---
Slightly better testcase:
```

int safe_mul_func_uint8_t_u_u_ui2, g_231, g_277_1, g_568,
func_35___trans_tmp_10;
int g_81[7];
extern int g_96[];
char func_35___trans_tmp_11;
static inline int safe_add_func_int32_t_s_s(int si1, int si2) { return si1 >
647 - si2 ?: si1; }
void func_35() {
  for (; g_277_1; g_277_1 += 1) {
g_231 = 0;
for (; g_231 <= 6; g_231 += 1) {
  func_35___trans_tmp_10 =
  safe_add_func_int32_t_s_s(g_81[g_231], g_568 || g_96[1]);
  func_35___trans_tmp_11 =
  func_35___trans_tmp_10 * safe_mul_func_uint8_t_u_u_ui2;
  g_81[g_231] = func_35___trans_tmp_11;
}
  }
}
```

Confirmed:
   [local count: 47303694]:
  if (0 != 0)
goto ; [50.00%]
  else
goto ; [50.00%]

   [local count: 23651847]:
  _94 = _7 * prephitmp_71;

   [local count: 47303694]:
  _97 = (int) _94;

Obvious the cfgcleanup will remove the branch and it will become valid but I
have no idea if it is latent otherwise.