https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127195
Bug ID: 127195
Summary: ice in flow_bb_inside_loop_p at cfgloop.cc:846
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: dcb314 at hotmail dot com
Target Milestone: ---
Created attachment 65483
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65483&action=edit
C source code
The attached C code does this with recent gcc:
$ ../results/bin/gcc -c -w -O3 -march=znver3 bug1238.c
during GIMPLE pass: vect
teletext.c: In function ‘enhance.constprop’:
teletext.c:1429:1: internal compiler error: Segmentation fault
0x21c28a7 internal_error
/home/dcb42/gcc/working/gcc/../../trunk/gcc/diagnostic-global-context.cc:787
0xc945b9 ???
/home/dcb42/gcc/working/gcc/../../trunk/gcc/toplev.cc:325
0x61cb76 flow_bb_inside_loop_p
/home/dcb42/gcc/working/gcc/../../trunk/gcc/cfgloop.cc:846
0xe6a254 check_loop_closed_ssa_def
/home/dcb42/gcc/working/gcc/../../trunk/gcc/tree-ssa-loop-manip.cc:664
The bug first seems to occur sometime between g:9394c71d36980a0a,
dated 20260825 and g:c5c5fe47a628c8d2, dated 20260901.
Valgrind says:
==330100== Invalid read of size 4
==330100== at 0xDC64AA: nearest_common_dominator_of_uses
(tree-ssa-sink.cc:167)
==330100== by 0xDC64AA: statement_sink_location (tree-ssa-sink.cc:421)
==330100== by 0xDC64AA: sink_code_in_bb (tree-ssa-sink.cc:718)
==330100== by 0xDC64AA: (anonymous
namespace)::pass_sink_code::execute(function*) (tree-ssa-sink.cc:882)