* [Bug rtl-optimization/57662] [4.9 Regression] ICE: SIGSEGV in code_motion_process_successors with -fschedule-insns2 -fselective-scheduling2
2013-06-20 13:49 [Bug rtl-optimization/57662] New: [4.9 Regression] ICE: SIGSEGV in code_motion_process_successors with -fschedule-insns2 -fselective-scheduling2 zsojka at seznam dot cz
@ 2013-06-24 11:05 ` rguenth at gcc dot gnu.org
2013-07-24 10:18 ` mpolacek at gcc dot gnu.org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-06-24 11:05 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57662
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.9.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug rtl-optimization/57662] [4.9 Regression] ICE: SIGSEGV in code_motion_process_successors with -fschedule-insns2 -fselective-scheduling2
2013-06-20 13:49 [Bug rtl-optimization/57662] New: [4.9 Regression] ICE: SIGSEGV in code_motion_process_successors with -fschedule-insns2 -fselective-scheduling2 zsojka at seznam dot cz
2013-06-24 11:05 ` [Bug rtl-optimization/57662] " rguenth at gcc dot gnu.org
@ 2013-07-24 10:18 ` mpolacek at gcc dot gnu.org
2013-07-24 14:25 ` mpolacek at gcc dot gnu.org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-07-24 10:18 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57662
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-07-24
CC| |mpolacek at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug rtl-optimization/57662] [4.9 Regression] ICE: SIGSEGV in code_motion_process_successors with -fschedule-insns2 -fselective-scheduling2
2013-06-20 13:49 [Bug rtl-optimization/57662] New: [4.9 Regression] ICE: SIGSEGV in code_motion_process_successors with -fschedule-insns2 -fselective-scheduling2 zsojka at seznam dot cz
2013-06-24 11:05 ` [Bug rtl-optimization/57662] " rguenth at gcc dot gnu.org
2013-07-24 10:18 ` mpolacek at gcc dot gnu.org
@ 2013-07-24 14:25 ` mpolacek at gcc dot gnu.org
2013-08-13 13:08 ` abel at gcc dot gnu.org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-07-24 14:25 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57662
--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
In sel-sched.c,
/* We have simplified the control flow below this point. In this case,
the iterator becomes invalid. We need to try again. */
if (BLOCK_FOR_INSN (insn)->index != old_index
|| EDGE_COUNT (bb->succs) != old_succs)
the BLOCK_FOR_INSN (insn) is NULL, so we segfault; the call to
code_motion_path_driver somehow changes the insn to
(jump_insn/v 203 0 0 (set (pc)
(label_ref 202)) -1
(nil)
-> 202)
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug rtl-optimization/57662] [4.9 Regression] ICE: SIGSEGV in code_motion_process_successors with -fschedule-insns2 -fselective-scheduling2
2013-06-20 13:49 [Bug rtl-optimization/57662] New: [4.9 Regression] ICE: SIGSEGV in code_motion_process_successors with -fschedule-insns2 -fselective-scheduling2 zsojka at seznam dot cz
` (2 preceding siblings ...)
2013-07-24 14:25 ` mpolacek at gcc dot gnu.org
@ 2013-08-13 13:08 ` abel at gcc dot gnu.org
2013-08-14 6:32 ` abel at gcc dot gnu.org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: abel at gcc dot gnu.org @ 2013-08-13 13:08 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57662
Andrey Belevantsev <abel at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC| |abel at gcc dot gnu.org
Assignee|unassigned at gcc dot gnu.org |abel at gcc dot gnu.org
--- Comment #3 from Andrey Belevantsev <abel at gcc dot gnu.org> ---
I will take a look, but I will be on vacation in two days, so do not expect
much on this until September.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug rtl-optimization/57662] [4.9 Regression] ICE: SIGSEGV in code_motion_process_successors with -fschedule-insns2 -fselective-scheduling2
2013-06-20 13:49 [Bug rtl-optimization/57662] New: [4.9 Regression] ICE: SIGSEGV in code_motion_process_successors with -fschedule-insns2 -fselective-scheduling2 zsojka at seznam dot cz
` (3 preceding siblings ...)
2013-08-13 13:08 ` abel at gcc dot gnu.org
@ 2013-08-14 6:32 ` abel at gcc dot gnu.org
2013-10-30 12:57 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: abel at gcc dot gnu.org @ 2013-08-14 6:32 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57662
--- Comment #4 from Andrey Belevantsev <abel at gcc dot gnu.org> ---
Created attachment 30650
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30650&action=edit
proposed patch
When moving up an instruction, we can make empty basic blocks or create other
possibilities for control flow simplification, thus we do it along the way.
This means that while we are in the iterator over successor blocks, those
blocks could change, and we need to rescan successors to make sure we visit all
of them. We do that with checking whether the number of successor blocks of
the visiting block changed or the visiting block index itself changed, and we
get hold of the visiting block via its last insn.
Now, the problem is that this last insn itself can be removed during
simplification. I have convinced myself that only case when this might happen
is when the insn is an unconditional jump (the conditional jump might be
changed to unconditional but not removed altogether). In this case we had a
single successor and we have already visited it, so we just break from the
successor iterator instead of attempting to rescan.
I will test the attached patch and submit if succesful.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug rtl-optimization/57662] [4.9 Regression] ICE: SIGSEGV in code_motion_process_successors with -fschedule-insns2 -fselective-scheduling2
2013-06-20 13:49 [Bug rtl-optimization/57662] New: [4.9 Regression] ICE: SIGSEGV in code_motion_process_successors with -fschedule-insns2 -fselective-scheduling2 zsojka at seznam dot cz
` (4 preceding siblings ...)
2013-08-14 6:32 ` abel at gcc dot gnu.org
@ 2013-10-30 12:57 ` rguenth at gcc dot gnu.org
2013-10-31 6:05 ` abel at gcc dot gnu.org
2014-02-03 12:01 ` abel at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-10-30 12:57 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57662
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed according to
2013-08-14 Andrey Belevantsev <abel@ispras.ru>
PR rtl-optimization/57662
* sel-sched.c (code_motion_process_successors): When the current insn
is removed after the recursive traversal, break from the loop.
Add comments and debug printouts.
(?)
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug rtl-optimization/57662] [4.9 Regression] ICE: SIGSEGV in code_motion_process_successors with -fschedule-insns2 -fselective-scheduling2
2013-06-20 13:49 [Bug rtl-optimization/57662] New: [4.9 Regression] ICE: SIGSEGV in code_motion_process_successors with -fschedule-insns2 -fselective-scheduling2 zsojka at seznam dot cz
` (5 preceding siblings ...)
2013-10-30 12:57 ` rguenth at gcc dot gnu.org
@ 2013-10-31 6:05 ` abel at gcc dot gnu.org
2014-02-03 12:01 ` abel at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: abel at gcc dot gnu.org @ 2013-10-31 6:05 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57662
--- Comment #6 from Andrey Belevantsev <abel at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #5)
> Fixed according to
>
> 2013-08-14 Andrey Belevantsev <abel@ispras.ru>
>
> PR rtl-optimization/57662
> * sel-sched.c (code_motion_process_successors): When the current insn
> is removed after the recursive traversal, break from the loop.
> Add comments and debug printouts.
>
> (?)
Yes. Sorry, I keep forgetting that the post-commit Bugzilla autoupdate no
longer works so I didn't look at the PR after committing.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug rtl-optimization/57662] [4.9 Regression] ICE: SIGSEGV in code_motion_process_successors with -fschedule-insns2 -fselective-scheduling2
2013-06-20 13:49 [Bug rtl-optimization/57662] New: [4.9 Regression] ICE: SIGSEGV in code_motion_process_successors with -fschedule-insns2 -fselective-scheduling2 zsojka at seznam dot cz
` (6 preceding siblings ...)
2013-10-31 6:05 ` abel at gcc dot gnu.org
@ 2014-02-03 12:01 ` abel at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: abel at gcc dot gnu.org @ 2014-02-03 12:01 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57662
--- Comment #7 from Andrey Belevantsev <abel at gcc dot gnu.org> ---
Author: abel
Date: Mon Feb 3 12:00:23 2014
New Revision: 207421
URL: http://gcc.gnu.org/viewcvs?rev=207421&root=gcc&view=rev
Log:
gcc/
PR rtl-optimization/57662
* sel-sched.c (code_motion_path_driver): Do not mark already not
existing blocks in the visiting bitmap.
testsuite/
PR rtl-optimization/57662
* g++.dg/pr57662.C: New test.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/sel-sched.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 9+ messages in thread