https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103202

--- Comment #6 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
Not looking at this yet, but disabling jump threading from all passes (dom
included) makes the problem go away:

$ ./xgcc -B./ a.c -w -O2 -fno-thread-jumps && ./a.out
element 1
element 2
element 3

...so *maybe* threading related.

The minimum number of threads that reproduces this is:

 ./xgcc -B./ a.c -w -O2 -fdbg-cnt=registered_jump_thread:1-1:3-3:5-5  &&
./a.out
***dbgcnt: lower limit 1 reached for registered_jump_thread.***
***dbgcnt: upper limit 1 reached for registered_jump_thread.***
***dbgcnt: lower limit 3 reached for registered_jump_thread.***
***dbgcnt: upper limit 3 reached for registered_jump_thread.***
***dbgcnt: lower limit 5 reached for registered_jump_thread.***
***dbgcnt: upper limit 5 reached for registered_jump_thread.***
element 1
element 2
$ grep 'Register.*jump' a.c.*
a.c.111t.threadfull1:  [1] Registering jump thread: (6, 7) incoming edge;  (7,
9) nocopy; 
a.c.126t.thread1:  [3] Registering jump thread: (2, 4) incoming edge;  (4, 12)
nocopy; 
a.c.191t.thread2:  [5] Registering jump thread: (13, 11) incoming edge;  (11,
10) nocopy;

Reply via email to