[Bug tree-optimization/111465] [14 regression] stage 3 ICE kills bootstrap from r14-4089-gd45ddc2c04e471d0dcee01

2023-11-24 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111465

--- Comment #13 from CVS Commits  ---
The releases/gcc-13 branch has been updated by Richard Biener
:

https://gcc.gnu.org/g:152400decc8383aeff9a9ad8262b9e7e2fff61e0

commit r13-8096-g152400decc8383aeff9a9ad8262b9e7e2fff61e0
Author: Richard Biener 
Date:   Tue Sep 19 12:36:04 2023 +0200

tree-optimization/111465 - bougs jump threading with no-copy src block

The following avoids to forward thread a path with a EDGE_NO_COPY_SRC_BLOCK
block that became non-empty due to folding.

PR tree-optimization/111465
* tree-ssa-threadupdate.cc (fwd_jt_path_registry::thread_block_1):
Cancel the path when a EDGE_NO_COPY_SRC_BLOCK became non-empty.

* g++.dg/torture/pr111465.C: New testcase.

(cherry picked from commit 564ecb7d5afb0bb4eb39285ce65c631490e37dce)

[Bug tree-optimization/111465] [14 regression] stage 3 ICE kills bootstrap from r14-4089-gd45ddc2c04e471d0dcee01

2023-09-19 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111465

Richard Biener  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|ASSIGNED|RESOLVED

--- Comment #12 from Richard Biener  ---
Should be fixed on trunk.  Given PR102844 the issue is latent everywhere,
marking as duplicate for this.

*** This bug has been marked as a duplicate of bug 102844 ***

[Bug tree-optimization/111465] [14 regression] stage 3 ICE kills bootstrap from r14-4089-gd45ddc2c04e471d0dcee01

2023-09-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111465

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

https://gcc.gnu.org/g:564ecb7d5afb0bb4eb39285ce65c631490e37dce

commit r14-4128-g564ecb7d5afb0bb4eb39285ce65c631490e37dce
Author: Richard Biener 
Date:   Tue Sep 19 12:36:04 2023 +0200

tree-optimization/111465 - bougs jump threading with no-copy src block

The following avoids to forward thread a path with a EDGE_NO_COPY_SRC_BLOCK
block that became non-empty due to folding.

PR tree-optimization/111465
* tree-ssa-threadupdate.cc (fwd_jt_path_registry::thread_block_1):
Cancel the path when a EDGE_NO_COPY_SRC_BLOCK became non-empty.

* g++.dg/torture/pr111465.C: New testcase.

[Bug tree-optimization/111465] [14 regression] stage 3 ICE kills bootstrap from r14-4089-gd45ddc2c04e471d0dcee01

2023-09-19 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111465

--- Comment #10 from Richard Biener  ---
Testing a patch.

[Bug tree-optimization/111465] [14 regression] stage 3 ICE kills bootstrap from r14-4089-gd45ddc2c04e471d0dcee01

2023-09-19 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111465

Richard Biener  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=102844
 CC||law at gcc dot gnu.org

--- Comment #9 from Richard Biener  ---
So we simplify


 if (iftmp.2_137 <= location_138)
   ..
 else
   {
 _16 = (signed) prephitmp_15;
 if (_16 < 0)
...

to

 _192 = (signed) location_138;
 if (0)
   ..
 else
  {
 _16 = (signed) prephitmp_15;
 if (_16 < 0)
...

and then thread - actually we have registered the forward thread already
and registered the block with the def of _192 as EDGE_NO_COPY_SRC_BLOCK
(because it was empty before).  This is essentially a duplicate of PR102844
which has gone latent.

[Bug tree-optimization/111465] [14 regression] stage 3 ICE kills bootstrap from r14-4089-gd45ddc2c04e471d0dcee01

2023-09-19 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111465

Richard Biener  changed:

   What|Removed |Added

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

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

[Bug tree-optimization/111465] [14 regression] stage 3 ICE kills bootstrap from r14-4089-gd45ddc2c04e471d0dcee01

2023-09-18 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111465

--- Comment #7 from Andrew Pinski  ---
```
Optimizing block #15

1>>> STMT 1 = prephitmp_58 le_expr location_138
1>>> STMT 1 = prephitmp_58 ge_expr location_138
1>>> STMT 1 = prephitmp_58 eq_expr location_138
1>>> STMT 0 = prephitmp_58 ne_expr location_138
Optimizing statement if (iftmp.2_137 <= location_138)
  Replaced 'iftmp.2_137' with constant '2147483648'
Applying pattern match.pd:6895, gimple-match-8.cc:2512
Applying pattern match.pd:5745, gimple-match-4.cc:2113
gimple_simplified to _192 = (signed int) location_138;
if (_192 < 0)
  Folded to: if (_192 < 0)
 Registering value_relation (_192 pe32 location_138) (bb15) at _192 = (signed
int) location_138;
Folding predicate _192 < 0 to 0
Optimizing statement _192 = (signed int) location_138;
LKUP STMT _192 = nop_expr location_138
2>>> STMT _192 = nop_expr location_138



Optimizing block #16

Optimizing statement _16 = (signed int) prephitmp_15;
  Replaced 'prephitmp_15' with variable 'location_138'
LKUP STMT _16 = nop_expr location_138
FIND: _192
  Replaced redundant expr '(signed int) location_138' with '_192'
 ASGN _16 = _192
Optimizing statement if (_16 < 0)
  Replaced '_16' with variable '_192'
Folding predicate _192 < 0 to 0
Marking all outgoing edges of unreachable BB 17 as not executable
 STMT _192 = nop_expr location_138
 STMT 0 = prephitmp_58 ne_expr location_138
 STMT 1 = prephitmp_58 eq_expr location_138
 STMT 1 = prephitmp_58 ge_expr location_138
 STMT 1 = prephitmp_58 le_expr location_138
 COPY prephitmp_15 = location_138

```
But _16 is no longer used ...

[Bug tree-optimization/111465] [14 regression] stage 3 ICE kills bootstrap from r14-4089-gd45ddc2c04e471d0dcee01

2023-09-18 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111465

--- Comment #6 from Andrew Pinski  ---
Created attachment 55928
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55928=edit
Reduced even further

Still requires `-O2 -fno-exceptions --param=logical-op-non-short-circuit=0` to
reproduce.

[Bug tree-optimization/111465] [14 regression] stage 3 ICE kills bootstrap from r14-4089-gd45ddc2c04e471d0dcee01

2023-09-18 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111465

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2023-09-18
 Target|powerpc64le-linux-gnu   |
  Build|powerpc64le-linux-gnu   |
   Host|powerpc64le-linux-gnu   |
 Status|UNCONFIRMED |NEW

--- Comment #5 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #4)
> Created attachment 55927 [details]
> reduced somewhat
> 
> Compile with `-O2 -fno-exceptions`.

This reduced testcase fails on x86_64-linux-gnu with `-O2 -fno-exceptions
--param=logical-op-non-short-circuit=0`

Confirmed.

[Bug tree-optimization/111465] [14 regression] stage 3 ICE kills bootstrap from r14-4089-gd45ddc2c04e471d0dcee01

2023-09-18 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111465

--- Comment #4 from Andrew Pinski  ---
Created attachment 55927
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55927=edit
reduced somewhat

Compile with `-O2 -fno-exceptions`.

[Bug tree-optimization/111465] [14 regression] stage 3 ICE kills bootstrap

2023-09-18 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111465

--- Comment #3 from Andrew Pinski  ---
Reproduced, reducing ...

[Bug tree-optimization/111465] [14 regression] stage 3 ICE kills bootstrap

2023-09-18 Thread seurer at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111465

--- Comment #2 from seurer at gcc dot gnu.org ---
Created attachment 55926
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55926=edit
preprocessed .ii file

Yup, that looks like the culprit.

Preprocessed file attached.

[Bug tree-optimization/111465] [14 regression] stage 3 ICE kills bootstrap

2023-09-18 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111465

Andrew Pinski  changed:

   What|Removed |Added

  Component|bootstrap   |tree-optimization
   Target Milestone|--- |14.0
   Keywords||build, ice-checking,
   ||ice-on-valid-code

--- Comment #1 from Andrew Pinski  ---
I suspect this was caused by/exposed by r14-4089-gd45ddc2c04e471d0dcee01 .

Do you have the preprocessed source which you could attach?