public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/107394] New: [13 Regression] ICE in verify_range, at value-range.cc:716
@ 2022-10-25 15:30 asolokha at gmx dot com
2022-10-25 16:49 ` [Bug tree-optimization/107394] " pinskia at gcc dot gnu.org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: asolokha at gmx dot com @ 2022-10-25 15:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107394
Bug ID: 107394
Summary: [13 Regression] ICE in verify_range, at
value-range.cc:716
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: asolokha at gmx dot com
Target Milestone: ---
gcc 13.0.0 20221023 snapshot (g:0e37fd4dc74c1db99cdc7d71ef378e1221253c6f) ICEs
when compiling the following testcase w/ -O2:
static double
quux (double x)
{
return __builtin_fabs (x);
}
__attribute__ ((flatten, optimize ("-ffinite-math-only"))) static int
bar (int *p)
{
*p = quux (0.0);
return 0;
}
void
foo (int *p)
{
(void) bar (p);
}
% gcc-13 -O2 -c owzufzxh.c
during IPA pass: inline
owzufzxh.c: In function 'bar.isra':
owzufzxh.c:10:8: internal compiler error: in verify_range, at
value-range.cc:716
10 | *p = quux (0.0);
| ^~~~~~~~~~
0x7bca0d frange::verify_range()
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221023/work/gcc-13-20221023/gcc/value-range.cc:716
0x1160ad8 range_info_get_range(tree_node*, vrange&)
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221023/work/gcc-13-20221023/gcc/tree-ssanames.cc:121
0x1160ad8 duplicate_ssa_name_range_info(tree_node*, tree_node*)
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221023/work/gcc-13-20221023/gcc/tree-ssanames.cc:750
0xf85de3 remap_ssa_name
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221023/work/gcc-13-20221023/gcc/tree-inline.cc:256
0xf8bf37 remap_gimple_op_r
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221023/work/gcc-13-20221023/gcc/tree-inline.cc:1028
0x12179c3 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221023/work/gcc-13-20221023/gcc/tree.cc:11270
0xbf1a92 walk_gimple_op(gimple*, tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221023/work/gcc-13-20221023/gcc/gimple-walk.cc:221
0xf886bf remap_gimple_stmt
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221023/work/gcc-13-20221023/gcc/tree-inline.cc:1986
0xf8cb87 copy_bb
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221023/work/gcc-13-20221023/gcc/tree-inline.cc:2056
0xf8e87c copy_cfg_body
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221023/work/gcc-13-20221023/gcc/tree-inline.cc:3090
0xf8e87c copy_body
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221023/work/gcc-13-20221023/gcc/tree-inline.cc:3343
0xf93452 expand_call_inline
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221023/work/gcc-13-20221023/gcc/tree-inline.cc:5128
0xf95411 gimple_expand_calls_inline
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221023/work/gcc-13-20221023/gcc/tree-inline.cc:5323
0xf95411 optimize_inline_calls(tree_node*)
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221023/work/gcc-13-20221023/gcc/tree-inline.cc:5495
0xc9653b inline_transform(cgraph_node*)
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221023/work/gcc-13-20221023/gcc/ipa-inline-transform.cc:790
0xe0d116 execute_one_ipa_transform_pass
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221023/work/gcc-13-20221023/gcc/passes.cc:2336
0xe0d116 execute_all_ipa_transforms(bool)
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221023/work/gcc-13-20221023/gcc/passes.cc:2399
0xa463dd cgraph_node::expand()
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221023/work/gcc-13-20221023/gcc/cgraphunit.cc:1827
0xa463dd cgraph_node::expand()
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221023/work/gcc-13-20221023/gcc/cgraphunit.cc:1787
0xa47a1e expand_all_functions
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221023/work/gcc-13-20221023/gcc/cgraphunit.cc:2008
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/107394] [13 Regression] ICE in verify_range, at value-range.cc:716
2022-10-25 15:30 [Bug tree-optimization/107394] New: [13 Regression] ICE in verify_range, at value-range.cc:716 asolokha at gmx dot com
@ 2022-10-25 16:49 ` pinskia at gcc dot gnu.org
2022-10-25 19:29 ` [Bug tree-optimization/107394] [13 Regression] ICE in verify_range, at value-range.cc:716 since r13-3411-gf4fda3eec408e1eb marxin at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-25 16:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107394
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |13.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/107394] [13 Regression] ICE in verify_range, at value-range.cc:716 since r13-3411-gf4fda3eec408e1eb
2022-10-25 15:30 [Bug tree-optimization/107394] New: [13 Regression] ICE in verify_range, at value-range.cc:716 asolokha at gmx dot com
2022-10-25 16:49 ` [Bug tree-optimization/107394] " pinskia at gcc dot gnu.org
@ 2022-10-25 19:29 ` marxin at gcc dot gnu.org
2022-10-25 20:47 ` aldyh at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-10-25 19:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107394
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
CC| |aldyh at gcc dot gnu.org,
| |marxin at gcc dot gnu.org
Summary|[13 Regression] ICE in |[13 Regression] ICE in
|verify_range, at |verify_range, at
|value-range.cc:716 |value-range.cc:716 since
| |r13-3411-gf4fda3eec408e1eb
Last reconfirmed| |2022-10-25
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r13-3411-gf4fda3eec408e1eb.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/107394] [13 Regression] ICE in verify_range, at value-range.cc:716 since r13-3411-gf4fda3eec408e1eb
2022-10-25 15:30 [Bug tree-optimization/107394] New: [13 Regression] ICE in verify_range, at value-range.cc:716 asolokha at gmx dot com
2022-10-25 16:49 ` [Bug tree-optimization/107394] " pinskia at gcc dot gnu.org
2022-10-25 19:29 ` [Bug tree-optimization/107394] [13 Regression] ICE in verify_range, at value-range.cc:716 since r13-3411-gf4fda3eec408e1eb marxin at gcc dot gnu.org
@ 2022-10-25 20:47 ` aldyh at gcc dot gnu.org
2022-10-25 20:47 ` aldyh at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: aldyh at gcc dot gnu.org @ 2022-10-25 20:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107394
--- Comment #2 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
This is interesting.
quux() was analyzed and a global range was set that included the possibility of
+NAN, but when it was inlined into bar(), the assert making sure no NANs crept
in for -ffinite-math-only failed.
So the inlined function had a NAN, but the function where it was being inlined
into has -ffinite-math-only.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/107394] [13 Regression] ICE in verify_range, at value-range.cc:716 since r13-3411-gf4fda3eec408e1eb
2022-10-25 15:30 [Bug tree-optimization/107394] New: [13 Regression] ICE in verify_range, at value-range.cc:716 asolokha at gmx dot com
` (2 preceding siblings ...)
2022-10-25 20:47 ` aldyh at gcc dot gnu.org
@ 2022-10-25 20:47 ` aldyh at gcc dot gnu.org
2022-10-25 20:48 ` aldyh at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: aldyh at gcc dot gnu.org @ 2022-10-25 20:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107394
--- Comment #3 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
Created attachment 53772
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53772&action=edit
untested
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/107394] [13 Regression] ICE in verify_range, at value-range.cc:716 since r13-3411-gf4fda3eec408e1eb
2022-10-25 15:30 [Bug tree-optimization/107394] New: [13 Regression] ICE in verify_range, at value-range.cc:716 asolokha at gmx dot com
` (3 preceding siblings ...)
2022-10-25 20:47 ` aldyh at gcc dot gnu.org
@ 2022-10-25 20:48 ` aldyh at gcc dot gnu.org
2022-10-27 9:40 ` cvs-commit at gcc dot gnu.org
2022-10-27 9:41 ` aldyh at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: aldyh at gcc dot gnu.org @ 2022-10-25 20:48 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107394
Aldy Hernandez <aldyh at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/107394] [13 Regression] ICE in verify_range, at value-range.cc:716 since r13-3411-gf4fda3eec408e1eb
2022-10-25 15:30 [Bug tree-optimization/107394] New: [13 Regression] ICE in verify_range, at value-range.cc:716 asolokha at gmx dot com
` (4 preceding siblings ...)
2022-10-25 20:48 ` aldyh at gcc dot gnu.org
@ 2022-10-27 9:40 ` cvs-commit at gcc dot gnu.org
2022-10-27 9:41 ` aldyh at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-10-27 9:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107394
--- Comment #4 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:2b1fb720818a85d5c893ce65d140add40debf2ff
commit r13-3525-g2b1fb720818a85d5c893ce65d140add40debf2ff
Author: Aldy Hernandez <aldyh@redhat.com>
Date: Tue Oct 25 22:44:51 2022 +0200
[PR tree-optimization/107394] Canonicalize global franges as they are read
back.
The problem here is that we're inlining a global range with NANs into
a function that has been tagged with __attribute__((optimize
("-ffinite-math-only"))). As the global range is copied from
SSA_NAME_RANGE_INFO, its NAN bits are copied, which then cause
frange::verify_range() to fail a sanity check making sure no NANs
creep in when !HONOR_NANS.
I think what we should do is nuke the NAN bits as we're restoring the
global range. For that matter, if we use the frange constructor,
everything except that NAN sign will be done automatically, including
dropping INFs to the min/max representable range when appropriate.
PR tree-optimization/107394
gcc/ChangeLog:
* value-range-storage.cc (frange_storage_slot::get_frange): Use
frange constructor.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/pr107394.c: New test.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/107394] [13 Regression] ICE in verify_range, at value-range.cc:716 since r13-3411-gf4fda3eec408e1eb
2022-10-25 15:30 [Bug tree-optimization/107394] New: [13 Regression] ICE in verify_range, at value-range.cc:716 asolokha at gmx dot com
` (5 preceding siblings ...)
2022-10-27 9:40 ` cvs-commit at gcc dot gnu.org
@ 2022-10-27 9:41 ` aldyh at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: aldyh at gcc dot gnu.org @ 2022-10-27 9:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107394
Aldy Hernandez <aldyh at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #5 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
fixed
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-10-27 9:41 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-25 15:30 [Bug tree-optimization/107394] New: [13 Regression] ICE in verify_range, at value-range.cc:716 asolokha at gmx dot com
2022-10-25 16:49 ` [Bug tree-optimization/107394] " pinskia at gcc dot gnu.org
2022-10-25 19:29 ` [Bug tree-optimization/107394] [13 Regression] ICE in verify_range, at value-range.cc:716 since r13-3411-gf4fda3eec408e1eb marxin at gcc dot gnu.org
2022-10-25 20:47 ` aldyh at gcc dot gnu.org
2022-10-25 20:47 ` aldyh at gcc dot gnu.org
2022-10-25 20:48 ` aldyh at gcc dot gnu.org
2022-10-27 9:40 ` cvs-commit at gcc dot gnu.org
2022-10-27 9:41 ` aldyh at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).