* [Bug tree-optimization/109115] [13 Regression] ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in upper_bound, at value-range.h:950
2023-03-13 20:19 [Bug tree-optimization/109115] New: ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in upper_bound, at value-range.h:950 zhendong.su at inf dot ethz.ch
@ 2023-03-13 20:23 ` pinskia at gcc dot gnu.org
2023-03-13 20:33 ` pinskia at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-03-13 20:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109115
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|ICE on valid code at -O2 |[13 Regression] ICE on
|and -O3 on |valid code at -O2 and -O3
|x86_64-linux-gnu: in |on x86_64-linux-gnu: in
|upper_bound, at |upper_bound, at
|value-range.h:950 |value-range.h:950
Status|UNCONFIRMED |NEW
Keywords| |ice-on-valid-code
Target Milestone|--- |13.0
Last reconfirmed| |2023-03-13
Ever confirmed|0 |1
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Most likely introduced by r13-6619-g81fd62d1378b7d .
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/109115] [13 Regression] ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in upper_bound, at value-range.h:950
2023-03-13 20:19 [Bug tree-optimization/109115] New: ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in upper_bound, at value-range.h:950 zhendong.su at inf dot ethz.ch
2023-03-13 20:23 ` [Bug tree-optimization/109115] [13 Regression] " pinskia at gcc dot gnu.org
@ 2023-03-13 20:33 ` pinskia at gcc dot gnu.org
2023-03-13 21:55 ` jakub at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-03-13 20:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109115
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Version|unknown |13.0
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I would have assumed range_of_expr would return false if r had no range
information ...
if (ranger.range_of_expr (r, oprnd0, stmt))
{
wide_int max = r.upper_bound ();
Maybe there needs to be a check to make sure r.kind () is VR_RANGE then ...
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/109115] [13 Regression] ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in upper_bound, at value-range.h:950
2023-03-13 20:19 [Bug tree-optimization/109115] New: ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in upper_bound, at value-range.h:950 zhendong.su at inf dot ethz.ch
2023-03-13 20:23 ` [Bug tree-optimization/109115] [13 Regression] " pinskia at gcc dot gnu.org
2023-03-13 20:33 ` pinskia at gcc dot gnu.org
@ 2023-03-13 21:55 ` jakub at gcc dot gnu.org
2023-03-13 22:00 ` jakub at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-03-13 21:55 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109115
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think it returns false if it is has a type which isn't representable with the
particular range.
Which isn't the case here.
The type is representable, just the range is undefined_p ().
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/109115] [13 Regression] ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in upper_bound, at value-range.h:950
2023-03-13 20:19 [Bug tree-optimization/109115] New: ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in upper_bound, at value-range.h:950 zhendong.su at inf dot ethz.ch
` (2 preceding siblings ...)
2023-03-13 21:55 ` jakub at gcc dot gnu.org
@ 2023-03-13 22:00 ` jakub at gcc dot gnu.org
2023-03-13 23:51 ` amacleod at redhat dot com
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-03-13 22:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109115
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 54656
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54656&action=edit
gcc13-pr109115.patch
Untested fix.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/109115] [13 Regression] ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in upper_bound, at value-range.h:950
2023-03-13 20:19 [Bug tree-optimization/109115] New: ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in upper_bound, at value-range.h:950 zhendong.su at inf dot ethz.ch
` (3 preceding siblings ...)
2023-03-13 22:00 ` jakub at gcc dot gnu.org
@ 2023-03-13 23:51 ` amacleod at redhat dot com
2023-03-14 8:16 ` cvs-commit at gcc dot gnu.org
2023-03-14 8:17 ` jakub at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: amacleod at redhat dot com @ 2023-03-13 23:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109115
Andrew Macleod <amacleod at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |amacleod at redhat dot com
--- Comment #5 from Andrew Macleod <amacleod at redhat dot com> ---
(In reply to Jakub Jelinek from comment #3)
> I think it returns false if it is has a type which isn't representable with
> the particular range.
> Which isn't the case here.
> The type is representable, just the range is undefined_p ().
Correct. If the range is undefined, then you cannot ask for the upper bounds
because there is not one.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/109115] [13 Regression] ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in upper_bound, at value-range.h:950
2023-03-13 20:19 [Bug tree-optimization/109115] New: ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in upper_bound, at value-range.h:950 zhendong.su at inf dot ethz.ch
` (4 preceding siblings ...)
2023-03-13 23:51 ` amacleod at redhat dot com
@ 2023-03-14 8:16 ` cvs-commit at gcc dot gnu.org
2023-03-14 8:17 ` jakub at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-14 8:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109115
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:72b52751c60abb327c73716259485d04b8eabe4f
commit r13-6653-g72b52751c60abb327c73716259485d04b8eabe4f
Author: Jakub Jelinek <jakub@redhat.com>
Date: Tue Mar 14 09:15:38 2023 +0100
tree-vect-patterns: Fix up ICE in upper_bound [PR109115]
As mentioned in the PR, range_of_expr returns false if the type
of the expression isn't suitable for corresponding range type,
but doesn't if the range is undefined for other reasons. Still,
lower/upper_bound is defined only for ranges which actually have
at least one pair of subranges, VR_UNDEFINED range doesn't have it.
2023-03-14 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/109115
* tree-vect-patterns.cc (vect_recog_divmod_pattern): Don't use
r.upper_bound () on r.undefined_p () range.
* gcc.dg/pr109115.c: New test.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/109115] [13 Regression] ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in upper_bound, at value-range.h:950
2023-03-13 20:19 [Bug tree-optimization/109115] New: ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in upper_bound, at value-range.h:950 zhendong.su at inf dot ethz.ch
` (5 preceding siblings ...)
2023-03-14 8:16 ` cvs-commit at gcc dot gnu.org
@ 2023-03-14 8:17 ` jakub at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-03-14 8:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109115
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
Priority|P3 |P1
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 8+ messages in thread