public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/107937] New: ice in find_var_cmp_const, at gimple-predicate-analysis.cc:257
@ 2022-11-30 17:17 dcb314 at hotmail dot com
2022-11-30 17:19 ` [Bug tree-optimization/107937] [13 Regression] " pinskia at gcc dot gnu.org
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: dcb314 at hotmail dot com @ 2022-11-30 17:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107937
Bug ID: 107937
Summary: ice in find_var_cmp_const, at
gimple-predicate-analysis.cc:257
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: dcb314 at hotmail dot com
Target Milestone: ---
This reduced C code:
double getk_intersect_line_with_ycylinder_r,
getk_intersect_line_with_ycylinder_a;
getk_intersect_line_with_ycylinder_i;
getk_intersect_line_with_ycylinder(double *k2) {
if (getk_intersect_line_with_ycylinder_r < 0.)
return sqrt(getk_intersect_line_with_ycylinder_r);
*k2 = 0 / getk_intersect_line_with_ycylinder_a;
{
double k2;
for (; getk_intersect_line_with_ycylinder_i;
getk_intersect_line_with_ycylinder_i++)
getk_intersect_line_with_ycylinder(&k2);
vecscale(k2);
}
}
when compiled by recent gcc trunk and compiler flags -O3 -Wall, does this:
during GIMPLE pass: uninit
bug865.c:4:1: internal compiler error: in find_var_cmp_const, at
gimple-predicate-analysis.cc:257
4 | getk_intersect_line_with_ycylinder(double *k2) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x1b3ad6c find_var_cmp_const(vec<vec<pred_info, va_heap, vl_ptr>, va_heap,
vl_ptr>, gphi*, gimple**, tree_node**)
../../trunk.d1/gcc/gimple-predicate-analysis.cc:257
0x1b3ad6c uninit_analysis::overlap(gphi*, unsigned int, hash_set<gphi*, false,
default_hash_traits<gphi*> >*, predicate const&)
../../trunk.d1/gcc/gimple-predicate-analysis.cc:648
I'll have a go at finding a git range for the problem.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/107937] [13 Regression] ice in find_var_cmp_const, at gimple-predicate-analysis.cc:257
2022-11-30 17:17 [Bug c/107937] New: ice in find_var_cmp_const, at gimple-predicate-analysis.cc:257 dcb314 at hotmail dot com
@ 2022-11-30 17:19 ` pinskia at gcc dot gnu.org
2022-11-30 17:23 ` pinskia at gcc dot gnu.org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-30 17:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107937
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|c |tree-optimization
Target Milestone|--- |13.0
Keywords| |diagnostic,
| |ice-on-valid-code
Summary|ice in find_var_cmp_const, |[13 Regression] ice in
|at |find_var_cmp_const, at
|gimple-predicate-analysis.c |gimple-predicate-analysis.c
|c:257 |c:257
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/107937] [13 Regression] ice in find_var_cmp_const, at gimple-predicate-analysis.cc:257
2022-11-30 17:17 [Bug c/107937] New: ice in find_var_cmp_const, at gimple-predicate-analysis.cc:257 dcb314 at hotmail dot com
2022-11-30 17:19 ` [Bug tree-optimization/107937] [13 Regression] " pinskia at gcc dot gnu.org
@ 2022-11-30 17:23 ` pinskia at gcc dot gnu.org
2022-11-30 17:26 ` pinskia at gcc dot gnu.org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-30 17:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107937
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
It is working at r13-4401-gf57ff189572575 ....
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/107937] [13 Regression] ice in find_var_cmp_const, at gimple-predicate-analysis.cc:257
2022-11-30 17:17 [Bug c/107937] New: ice in find_var_cmp_const, at gimple-predicate-analysis.cc:257 dcb314 at hotmail dot com
2022-11-30 17:19 ` [Bug tree-optimization/107937] [13 Regression] " pinskia at gcc dot gnu.org
2022-11-30 17:23 ` pinskia at gcc dot gnu.org
@ 2022-11-30 17:26 ` pinskia at gcc dot gnu.org
2022-11-30 17:29 ` dcb314 at hotmail dot com
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-30 17:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107937
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
It might be r13-4408, r13-4407, or r13-4406 .
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/107937] [13 Regression] ice in find_var_cmp_const, at gimple-predicate-analysis.cc:257
2022-11-30 17:17 [Bug c/107937] New: ice in find_var_cmp_const, at gimple-predicate-analysis.cc:257 dcb314 at hotmail dot com
` (2 preceding siblings ...)
2022-11-30 17:26 ` pinskia at gcc dot gnu.org
@ 2022-11-30 17:29 ` dcb314 at hotmail dot com
2022-11-30 17:33 ` pinskia at gcc dot gnu.org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dcb314 at hotmail dot com @ 2022-11-30 17:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107937
--- Comment #3 from David Binderman <dcb314 at hotmail dot com> ---
The bug first seems to appear sometime between git hash 4d08c674b0114622
from yesterday and d0a3d55ae4a2656f, from today.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/107937] [13 Regression] ice in find_var_cmp_const, at gimple-predicate-analysis.cc:257
2022-11-30 17:17 [Bug c/107937] New: ice in find_var_cmp_const, at gimple-predicate-analysis.cc:257 dcb314 at hotmail dot com
` (3 preceding siblings ...)
2022-11-30 17:29 ` dcb314 at hotmail dot com
@ 2022-11-30 17:33 ` pinskia at gcc dot gnu.org
2022-12-01 5:24 ` [Bug tree-optimization/107937] [13 Regression] ICE in find_var_cmp_const, at gimple-predicate-analysis.cc:257 since r13-4408-gb628cad9e093f7a3 marxin at gcc dot gnu.org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-30 17:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107937
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to David Binderman from comment #3)
> The bug first seems to appear sometime between git hash 4d08c674b0114622
> from yesterday and d0a3d55ae4a2656f, from today.
Which is in between r13-4382-g4d08c674b01146 and r13-4412-gd0a3d55ae4a265 .
And I know it was working at r13-4401 so that narrows it down a little bit.
r13-4406, r13-4407 and r13-4408 modified the area where the ICE is coming from
which is why I pointed them out.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/107937] [13 Regression] ICE in find_var_cmp_const, at gimple-predicate-analysis.cc:257 since r13-4408-gb628cad9e093f7a3
2022-11-30 17:17 [Bug c/107937] New: ice in find_var_cmp_const, at gimple-predicate-analysis.cc:257 dcb314 at hotmail dot com
` (4 preceding siblings ...)
2022-11-30 17:33 ` pinskia at gcc dot gnu.org
@ 2022-12-01 5:24 ` marxin at gcc dot gnu.org
2022-12-01 5:28 ` marxin at gcc dot gnu.org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-12-01 5:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107937
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2022-12-01
CC| |marxin at gcc dot gnu.org,
| |rguenth at gcc dot gnu.org
Summary|[13 Regression] ice in |[13 Regression] ICE in
|find_var_cmp_const, at |find_var_cmp_const, at
|gimple-predicate-analysis.c |gimple-predicate-analysis.c
|c:257 |c:257 since
| |r13-4408-gb628cad9e093f7a3
Ever confirmed|0 |1
--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r13-4408-gb628cad9e093f7a3.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/107937] [13 Regression] ICE in find_var_cmp_const, at gimple-predicate-analysis.cc:257 since r13-4408-gb628cad9e093f7a3
2022-11-30 17:17 [Bug c/107937] New: ice in find_var_cmp_const, at gimple-predicate-analysis.cc:257 dcb314 at hotmail dot com
` (5 preceding siblings ...)
2022-12-01 5:24 ` [Bug tree-optimization/107937] [13 Regression] ICE in find_var_cmp_const, at gimple-predicate-analysis.cc:257 since r13-4408-gb628cad9e093f7a3 marxin at gcc dot gnu.org
@ 2022-12-01 5:28 ` marxin at gcc dot gnu.org
2022-12-01 7:34 ` rguenth at gcc dot gnu.org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-12-01 5:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107937
--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
Another test-case:
$ cat warn.i
int regs, vm_debug_engine_vp_0, vm_debug_engine_vp_2;
void
vm_dispatch_hook();
void
vm_debug_engine() {
int fp;
void *jump_table = &&l_nop;
l_nop:
if (__builtin_expect(vm_debug_engine_vp_2, 0))
vm_dispatch_hook();
if (_setjmp(regs)) {
fp = fp;
vm_dispatch_hook();
goto *jump_table;
}
vm_debug_engine_vp_0 = fp;
}
$ gcc -c warn.i -O1 -Wall
warn.i: In function ‘vm_debug_engine’:
warn.i:14:7: warning: implicit declaration of function ‘_setjmp’
[-Wimplicit-function-declaration]
14 | if (_setjmp(regs)) {
| ^~~~~~~
during GIMPLE pass: uninit
warn.i:8:1: internal compiler error: in find_var_cmp_const, at
gimple-predicate-analysis.cc:257
8 | vm_debug_engine() {
| ^~~~~~~~~~~~~~~
0x84abb6 find_var_cmp_const
/home/marxin/Programming/gcc/gcc/gimple-predicate-analysis.cc:257
0x1c83ff2 uninit_analysis::overlap(gphi*, unsigned int, hash_set<gphi*, false,
default_hash_traits<gphi*> >*, predicate const&)
/home/marxin/Programming/gcc/gcc/gimple-predicate-analysis.cc:648
0x1c83b45 uninit_analysis::is_use_guarded(gimple*, basic_block_def*, gphi*,
unsigned int, hash_set<gphi*, false, default_hash_traits<gphi*> >*)
/home/marxin/Programming/gcc/gcc/gimple-predicate-analysis.cc:2215
0x1c840ea uninit_analysis::is_use_guarded(gimple*, basic_block_def*, gphi*,
unsigned int)
/home/marxin/Programming/gcc/gcc/gimple-predicate-analysis.cc:2249
0x11188e7 find_uninit_use
/home/marxin/Programming/gcc/gcc/tree-ssa-uninit.cc:1234
0x111923e warn_uninitialized_phi
/home/marxin/Programming/gcc/gcc/tree-ssa-uninit.cc:1304
0x111923e execute_late_warn_uninitialized
/home/marxin/Programming/gcc/gcc/tree-ssa-uninit.cc:1425
0x111923e execute
/home/marxin/Programming/gcc/gcc/tree-ssa-uninit.cc:1442
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/107937] [13 Regression] ICE in find_var_cmp_const, at gimple-predicate-analysis.cc:257 since r13-4408-gb628cad9e093f7a3
2022-11-30 17:17 [Bug c/107937] New: ice in find_var_cmp_const, at gimple-predicate-analysis.cc:257 dcb314 at hotmail dot com
` (6 preceding siblings ...)
2022-12-01 5:28 ` marxin at gcc dot gnu.org
@ 2022-12-01 7:34 ` rguenth at gcc dot gnu.org
2022-12-01 8:38 ` zhendong.su at inf dot ethz.ch
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-12-01 7:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107937
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
Mine.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/107937] [13 Regression] ICE in find_var_cmp_const, at gimple-predicate-analysis.cc:257 since r13-4408-gb628cad9e093f7a3
2022-11-30 17:17 [Bug c/107937] New: ice in find_var_cmp_const, at gimple-predicate-analysis.cc:257 dcb314 at hotmail dot com
` (7 preceding siblings ...)
2022-12-01 7:34 ` rguenth at gcc dot gnu.org
@ 2022-12-01 8:38 ` zhendong.su at inf dot ethz.ch
2022-12-01 9:54 ` cvs-commit at gcc dot gnu.org
2022-12-01 14:00 ` rguenth at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: zhendong.su at inf dot ethz.ch @ 2022-12-01 8:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107937
Zhendong Su <zhendong.su at inf dot ethz.ch> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |zhendong.su at inf dot ethz.ch
--- Comment #8 from Zhendong Su <zhendong.su at inf dot ethz.ch> ---
Another test:
[546] % gcctk -O3 -Wall -w small.c
during GIMPLE pass: uninit
small.c: In function ‘main’:
small.c:3:5: internal compiler error: in find_var_cmp_const, at
gimple-predicate-analysis.cc:257
3 | int main() {
| ^~~~
0x818725 find_var_cmp_const
../../gcc-trunk/gcc/gimple-predicate-analysis.cc:257
0x1c9bfbf uninit_analysis::overlap(gphi*, unsigned int, hash_set<gphi*, false,
default_hash_traits<gphi*> >*, predicate const&)
../../gcc-trunk/gcc/gimple-predicate-analysis.cc:648
0x1c9bafa uninit_analysis::is_use_guarded(gimple*, basic_block_def*, gphi*,
unsigned int, hash_set<gphi*, false, default_hash_traits<gphi*> >*)
../../gcc-trunk/gcc/gimple-predicate-analysis.cc:2215
0x1c9c0ec uninit_analysis::is_use_guarded(gimple*, basic_block_def*, gphi*,
unsigned int)
../../gcc-trunk/gcc/gimple-predicate-analysis.cc:2249
0x110d500 find_uninit_use
../../gcc-trunk/gcc/tree-ssa-uninit.cc:1234
0x110de96 warn_uninitialized_phi
../../gcc-trunk/gcc/tree-ssa-uninit.cc:1304
0x110de96 execute_late_warn_uninitialized
../../gcc-trunk/gcc/tree-ssa-uninit.cc:1425
0x110de96 execute
../../gcc-trunk/gcc/tree-ssa-uninit.cc:1442
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
[547] % cat small.c
int printf(const char *, ...);
int a, b;
int main() {
int c, d;
while (b) {
if (a) {
&d;
c = ~c;
}
printf("0");
while (b && d && c)
;
}
return 0;
}
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/107937] [13 Regression] ICE in find_var_cmp_const, at gimple-predicate-analysis.cc:257 since r13-4408-gb628cad9e093f7a3
2022-11-30 17:17 [Bug c/107937] New: ice in find_var_cmp_const, at gimple-predicate-analysis.cc:257 dcb314 at hotmail dot com
` (8 preceding siblings ...)
2022-12-01 8:38 ` zhendong.su at inf dot ethz.ch
@ 2022-12-01 9:54 ` cvs-commit at gcc dot gnu.org
2022-12-01 14:00 ` rguenth at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-12-01 9:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107937
--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:
https://gcc.gnu.org/g:abf05583dbc86a6667b63f5bda6ba57fe55a1b25
commit r13-4437-gabf05583dbc86a6667b63f5bda6ba57fe55a1b25
Author: Richard Biener <rguenther@suse.de>
Date: Thu Dec 1 10:12:28 2022 +0100
tree-optimization/107937 - uninit predicate simplification fixup
The following changes the predicate representation to record the
value of a predicate with an empty set of AND predicates. That's
necessary to properly represent the conservative fallback for the
def vs use predicates. Since simplification now can result in
such an empty set this distinction becomes important and we need
to check for this as we otherwise ICE.
PR tree-optimization/107937
* gimple-predicate-analysis.h (predicate::is_true): New.
(predicate::is_false): Likewise.
(predicate::empty_val): Likewise.
(uninit_analysis::uninit_analysis): Properly initialize
def_preds.
* gimple-predicate-analysis.cc (simplify_1b): Indicate
whether the chain became empty.
(predicate::simplify): Release emptied chain before removing it.
(predicate::normalize): Replace temporary object with assertion.
(uninit_analysis::is_use_guarded): Deal with predicates
that simplify to true/false.
* gcc.dg/pr107937.c: New testcase.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/107937] [13 Regression] ICE in find_var_cmp_const, at gimple-predicate-analysis.cc:257 since r13-4408-gb628cad9e093f7a3
2022-11-30 17:17 [Bug c/107937] New: ice in find_var_cmp_const, at gimple-predicate-analysis.cc:257 dcb314 at hotmail dot com
` (9 preceding siblings ...)
2022-12-01 9:54 ` cvs-commit at gcc dot gnu.org
@ 2022-12-01 14:00 ` rguenth at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-12-01 14:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107937
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
So we have
((getk_intersect_line_with_ycylinder_r.0_19 < 0.0) AND
(getk_intersect_line_with_ycylinder_r.0_19 u>= 0.0) AND (NOT (_180 != 0)))
from
<bb 7> [local count: 711980952]:
# k2_184 = PHI <k2_20(74), k2_220(D)(81)>
# prephitmp_96 = PHI <_182(74), getk_intersect_line_with_ycylinder_i.4_30(81)>
getk_intersect_line_with_ycylinder_r.0_19 =
getk_intersect_line_with_ycylinder_r;
if (getk_intersect_line_with_ycylinder_r.0_19 < 0.0)
goto <bb 8>; [14.99%]
else
goto <bb 11>; [85.01%]
<bb 8> [local count: 106727384]:
if (getk_intersect_line_with_ycylinder_r.0_19 u>= 0.0)
goto <bb 9>; [99.95%]
else
goto <bb 10>; [0.05%]
and we simplify that to true which is bogus. It's correct to remove
this false sub-predicate from the (a || b || c ...) chain but when
it's the last the result is false, not true.
Fixed.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2022-12-01 14:00 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-30 17:17 [Bug c/107937] New: ice in find_var_cmp_const, at gimple-predicate-analysis.cc:257 dcb314 at hotmail dot com
2022-11-30 17:19 ` [Bug tree-optimization/107937] [13 Regression] " pinskia at gcc dot gnu.org
2022-11-30 17:23 ` pinskia at gcc dot gnu.org
2022-11-30 17:26 ` pinskia at gcc dot gnu.org
2022-11-30 17:29 ` dcb314 at hotmail dot com
2022-11-30 17:33 ` pinskia at gcc dot gnu.org
2022-12-01 5:24 ` [Bug tree-optimization/107937] [13 Regression] ICE in find_var_cmp_const, at gimple-predicate-analysis.cc:257 since r13-4408-gb628cad9e093f7a3 marxin at gcc dot gnu.org
2022-12-01 5:28 ` marxin at gcc dot gnu.org
2022-12-01 7:34 ` rguenth at gcc dot gnu.org
2022-12-01 8:38 ` zhendong.su at inf dot ethz.ch
2022-12-01 9:54 ` cvs-commit at gcc dot gnu.org
2022-12-01 14:00 ` rguenth 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).