* [Bug c/97359] ice in logical_combine, at gimple-range-gori.cc:754
2020-10-09 20:43 [Bug c/97359] New: ice in logical_combine, at gimple-range-gori.cc:754 dcb314 at hotmail dot com
@ 2020-10-09 20:47 ` dcb314 at hotmail dot com
2020-10-09 20:54 ` dcb314 at hotmail dot com
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: dcb314 at hotmail dot com @ 2020-10-09 20:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97359
--- Comment #1 from David Binderman <dcb314 at hotmail dot com> ---
The code seems to break gcc trunk sometime between 20201006 and 20201007.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/97359] ice in logical_combine, at gimple-range-gori.cc:754
2020-10-09 20:43 [Bug c/97359] New: ice in logical_combine, at gimple-range-gori.cc:754 dcb314 at hotmail dot com
2020-10-09 20:47 ` [Bug c/97359] " dcb314 at hotmail dot com
@ 2020-10-09 20:54 ` dcb314 at hotmail dot com
2020-10-09 21:34 ` [Bug tree-optimization/97359] [11 Regression] " jakub at gcc dot gnu.org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: dcb314 at hotmail dot com @ 2020-10-09 20:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97359
--- Comment #2 from David Binderman <dcb314 at hotmail dot com> ---
The reduced C code is
typedef unsigned int uint32_t;
int a;
void b(uint32_t c) {
uint32_t *d = &c;
for (; a;)
for (;; (*d %= a) / (*d > 1 > (c > 0)) ?: d)
;
}
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/97359] [11 Regression] ice in logical_combine, at gimple-range-gori.cc:754
2020-10-09 20:43 [Bug c/97359] New: ice in logical_combine, at gimple-range-gori.cc:754 dcb314 at hotmail dot com
2020-10-09 20:47 ` [Bug c/97359] " dcb314 at hotmail dot com
2020-10-09 20:54 ` dcb314 at hotmail dot com
@ 2020-10-09 21:34 ` jakub at gcc dot gnu.org
2020-10-10 6:50 ` aldyh at gcc dot gnu.org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-10-09 21:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97359
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|ice in logical_combine, at |[11 Regression] ice in
|gimple-range-gori.cc:754 |logical_combine, at
| |gimple-range-gori.cc:754
Target Milestone|--- |11.0
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Last reconfirmed| |2020-10-09
CC| |aldyh at gcc dot gnu.org,
| |amacleod at redhat dot com,
| |jakub at gcc dot gnu.org
Component|c |tree-optimization
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Since r11-3685-gfcae5121154d1c3382b056bcc2c563cedac28e74 or r11-3684 (the
latter doesn't build) in particular.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/97359] [11 Regression] ice in logical_combine, at gimple-range-gori.cc:754
2020-10-09 20:43 [Bug c/97359] New: ice in logical_combine, at gimple-range-gori.cc:754 dcb314 at hotmail dot com
` (2 preceding siblings ...)
2020-10-09 21:34 ` [Bug tree-optimization/97359] [11 Regression] " jakub at gcc dot gnu.org
@ 2020-10-10 6:50 ` aldyh at gcc dot gnu.org
2020-10-10 8:26 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: aldyh at gcc dot gnu.org @ 2020-10-10 6:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97359
--- Comment #4 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
Created attachment 49340
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49340&action=edit
untested proposed patch
Untested.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/97359] [11 Regression] ice in logical_combine, at gimple-range-gori.cc:754
2020-10-09 20:43 [Bug c/97359] New: ice in logical_combine, at gimple-range-gori.cc:754 dcb314 at hotmail dot com
` (3 preceding siblings ...)
2020-10-10 6:50 ` aldyh at gcc dot gnu.org
@ 2020-10-10 8:26 ` cvs-commit at gcc dot gnu.org
2020-10-10 8:28 ` aldyh at gcc dot gnu.org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-10-10 8:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97359
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Aldy Hernandez <aldyh@gcc.gnu.org>:
https://gcc.gnu.org/g:14db1dfcd18e4d2712a043bdcd3976fcfb0642c2
commit r11-3762-g14db1dfcd18e4d2712a043bdcd3976fcfb0642c2
Author: Aldy Hernandez <aldyh@redhat.com>
Date: Sat Oct 10 08:28:52 2020 +0200
PR97359: Do not cache relops in GORI cache.
logical_stmt_cache::cacheable_p() returns true for relops, but
logical_combine (which does the caching) doesn't handle them and ICEs.
This patch fixes the inconsistency by returning false for relops.
This was working before because even though logical_combine doesn't
handle relops, statements with only one SSA are handled in cache_stmt,
which seems like the only statement we've ever encountered (even through
a full Fedora build).
lhs = s_5 > 999;
However, with two SSA operands we ICE because logical_combine doesn't
handle them:
lhs = s_5 > y_8;
We can either return false for relops in cacheable_p, or fix
logical_combine to handle them. The original idea was to only cache
ANDs and ORs, so I've done the former to unbreak trunk.
We can decide later if there was ever any benefit in caching relops.
gcc/ChangeLog:
PR tree-optimization/97359
* gimple-range-gori.cc (logical_stmt_cache::cacheable_p): Only
handle ANDs and ORs.
(gori_compute_cache::cache_stmt): Adjust comment.
gcc/testsuite/ChangeLog:
* gcc.dg/pr97359.c: New test.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/97359] [11 Regression] ice in logical_combine, at gimple-range-gori.cc:754
2020-10-09 20:43 [Bug c/97359] New: ice in logical_combine, at gimple-range-gori.cc:754 dcb314 at hotmail dot com
` (4 preceding siblings ...)
2020-10-10 8:26 ` cvs-commit at gcc dot gnu.org
@ 2020-10-10 8:28 ` aldyh at gcc dot gnu.org
2020-10-14 15:03 ` amacleod at redhat dot com
2020-11-30 3:11 ` hjl.tools at gmail dot com
7 siblings, 0 replies; 9+ messages in thread
From: aldyh at gcc dot gnu.org @ 2020-10-10 8:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97359
Aldy Hernandez <aldyh at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #6 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
fixed
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/97359] [11 Regression] ice in logical_combine, at gimple-range-gori.cc:754
2020-10-09 20:43 [Bug c/97359] New: ice in logical_combine, at gimple-range-gori.cc:754 dcb314 at hotmail dot com
` (5 preceding siblings ...)
2020-10-10 8:28 ` aldyh at gcc dot gnu.org
@ 2020-10-14 15:03 ` amacleod at redhat dot com
2020-11-30 3:11 ` hjl.tools at gmail dot com
7 siblings, 0 replies; 9+ messages in thread
From: amacleod at redhat dot com @ 2020-10-14 15:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97359
--- Comment #7 from Andrew Macleod <amacleod at redhat dot com> ---
There is no need to cache non-logical operands. Processing a relational such as
<,>,<=,>= is a linear process, and therefore we never needed to cache them.
&& and || is exponential as we have to evaluate
op1_true, op1_false, op2_true, and op2_false
and the resulting 4 combinations... so each logical operand can trigger 4
lookup calculations.. and when they feed into each other the on-demand lookups
become exponential quite quickly..
the cache makes processing them linear as well.
Before the next stage 1 opens, I plan to rework the GORI computations to be
more efficient on calculating outgoing ranges.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/97359] [11 Regression] ice in logical_combine, at gimple-range-gori.cc:754
2020-10-09 20:43 [Bug c/97359] New: ice in logical_combine, at gimple-range-gori.cc:754 dcb314 at hotmail dot com
` (6 preceding siblings ...)
2020-10-14 15:03 ` amacleod at redhat dot com
@ 2020-11-30 3:11 ` hjl.tools at gmail dot com
7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2020-11-30 3:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97359
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |haoxintu at gmail dot com
--- Comment #8 from H.J. Lu <hjl.tools at gmail dot com> ---
*** Bug 98051 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 9+ messages in thread