public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/60866] New: [4.7/4.8/4.9/4.10 Regression] ICE: in get_seqno_for_a_jump, at sel-sched-ir.c:4068 with -fselective-scheduling -fno-if-conversion
@ 2014-04-16 19:25 zsojka at seznam dot cz
  2014-04-28  9:01 ` [Bug rtl-optimization/60866] " abel at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: zsojka at seznam dot cz @ 2014-04-16 19:25 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60866

            Bug ID: 60866
           Summary: [4.7/4.8/4.9/4.10 Regression] ICE: in
                    get_seqno_for_a_jump, at sel-sched-ir.c:4068 with
                    -fselective-scheduling -fno-if-conversion
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz

Created attachment 32620
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32620&action=edit
reduced testcase

Compiler output:
$ gcc -O -fselective-scheduling -fno-if-conversion -fschedule-insns testcase.c
testcase.c: In function 'foo':
testcase.c:15:1: internal compiler error: in get_seqno_for_a_jump, at
sel-sched-ir.c:4068
 }
 ^
0xaf3c6f get_seqno_for_a_jump
        /mnt/svn/gcc-trunk/gcc/sel-sched-ir.c:4068
0xaf3c6f init_simplejump_data
        /mnt/svn/gcc-trunk/gcc/sel-sched-ir.c:4257
0xaf3c6f sel_init_new_insn
        /mnt/svn/gcc-trunk/gcc/sel-sched-ir.c:4291
0xaf4983 sel_redirect_edge_and_branch(edge_def*, basic_block_def*)
        /mnt/svn/gcc-trunk/gcc/sel-sched-ir.c:5654
0xaf58e8 maybe_tidy_empty_bb
        /mnt/svn/gcc-trunk/gcc/sel-sched-ir.c:3782
0xaf5ce7 tidy_control_flow(basic_block_def*, bool)
        /mnt/svn/gcc-trunk/gcc/sel-sched-ir.c:3819
0xaf64fc sel_remove_insn(rtx_def*, bool, bool)
        /mnt/svn/gcc-trunk/gcc/sel-sched-ir.c:3954
0xaf6796 return_nop_to_pool(rtx_def*, bool)
        /mnt/svn/gcc-trunk/gcc/sel-sched-ir.c:1066
0xb09706 remove_temp_moveop_nops
        /mnt/svn/gcc-trunk/gcc/sel-sched.c:5067
0xb09706 schedule_expr_on_boundary
        /mnt/svn/gcc-trunk/gcc/sel-sched.c:5542
0xb0b365 fill_insns
        /mnt/svn/gcc-trunk/gcc/sel-sched.c:5659
0xb0b365 schedule_on_fences
        /mnt/svn/gcc-trunk/gcc/sel-sched.c:7441
0xb0b365 sel_sched_region_2
        /mnt/svn/gcc-trunk/gcc/sel-sched.c:7579
0xb0f164 sel_sched_region_1
        /mnt/svn/gcc-trunk/gcc/sel-sched.c:7621
0xb0f164 sel_sched_region(int)
        /mnt/svn/gcc-trunk/gcc/sel-sched.c:7722
0xb10999 run_selective_scheduling()
        /mnt/svn/gcc-trunk/gcc/sel-sched.c:7798
0xae09cd rest_of_handle_sched
        /mnt/svn/gcc-trunk/gcc/sched-rgn.c:3638
0xae09cd execute
        /mnt/svn/gcc-trunk/gcc/sched-rgn.c:3743
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ gcc -v                                                                      
Using built-in specs.
COLLECT_GCC=/mnt/svn/gcc-trunk/binary-latest/bin/gcc
COLLECT_LTO_WRAPPER=/mnt/svn/gcc-trunk/binary-209399-lto-fortran-checking-yes-rtl-df/libexec/gcc/x86_64-unknown-linux-gnu/4.10.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /mnt/svn/gcc-trunk//configure --enable-checking=yes,rtl,df
--enable-languages=c,c++,lto,fortran
--prefix=/mnt/svn/gcc-trunk/binary-209399-lto-fortran-checking-yes-rtl-df/
--without-cloog --without-ppl
Thread model: posix
gcc version 4.10.0 20140415 (experimental) (GCC) 

Tested revisions:
r209399 - ICE
4.9 r209346 - ICE
4.8 r209342 - ICE
4.7 r209345 - ICE
4.6 r197894 - OK


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug rtl-optimization/60866] [4.7/4.8/4.9/4.10 Regression] ICE: in get_seqno_for_a_jump, at sel-sched-ir.c:4068 with -fselective-scheduling -fno-if-conversion
  2014-04-16 19:25 [Bug rtl-optimization/60866] New: [4.7/4.8/4.9/4.10 Regression] ICE: in get_seqno_for_a_jump, at sel-sched-ir.c:4068 with -fselective-scheduling -fno-if-conversion zsojka at seznam dot cz
@ 2014-04-28  9:01 ` abel at gcc dot gnu.org
  2014-05-14 12:19 ` abel at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: abel at gcc dot gnu.org @ 2014-04-28  9:01 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60866

Andrey Belevantsev <abel at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |abel at gcc dot gnu.org

--- Comment #3 from Andrey Belevantsev <abel at gcc dot gnu.org> ---
Created attachment 32692
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32692&action=edit
draft patch

An interesting case so I'd leave more detailed notes.  We are scheduling a
region that has a diamond like this:
      bb 3 --
        |    \
      bb 4    \
     /    \     \
   bb 5   bb 6  /
     \    /    /
       bb 7  --

After scheduling bb 3 we proceed to bb 4 and bb 7 simultaneously.  Bbs 5 and 6
have identical insns.  While having a fence at the end of bb 4, we unify these
insns to one and get empty bbs 5 and 6 at once.  While simplifying this, we end
up with a conditional jump ending bb 4 turning into an unconditional one
leading to bb 7 (via redirect_edge_and_branch).  This jump is the new insn so
should be initialized.  We try to get a seqno for this jump from surrounding
unscheduled code (via get_seqno_for_a_jump), but both bbs 4 and 7 are already
completely scheduled.  Thus we ICE.

The only unscheduled insn in this region is the old conditional jump.  But it
is no longer with us while we're trying to init the new jump it turned into.  

The easy solution is to remove the assert and to change it into something like
"seqno = 42;".  This fixes the test but we will never be able to catch bugs in
this function again.  The preferred solution will be to pass down the old jump
seqno to the initializing function so it would take it as the new jump seqno
only in this particular case.  That means changing a number of
sel_init_new_insn callers.  But, if we are now allowed to have default
parameters (do we?), this simplifies things.

Attached is the draft patch (the function comments is not yet updated, C++
default parameters are used).


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug rtl-optimization/60866] [4.7/4.8/4.9/4.10 Regression] ICE: in get_seqno_for_a_jump, at sel-sched-ir.c:4068 with -fselective-scheduling -fno-if-conversion
  2014-04-16 19:25 [Bug rtl-optimization/60866] New: [4.7/4.8/4.9/4.10 Regression] ICE: in get_seqno_for_a_jump, at sel-sched-ir.c:4068 with -fselective-scheduling -fno-if-conversion zsojka at seznam dot cz
  2014-04-28  9:01 ` [Bug rtl-optimization/60866] " abel at gcc dot gnu.org
@ 2014-05-14 12:19 ` abel at gcc dot gnu.org
  2014-05-14 13:19 ` [Bug rtl-optimization/60866] [4.7/4.8/4.9 " ubizjak at gmail dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: abel at gcc dot gnu.org @ 2014-05-14 12:19 UTC (permalink / raw)
  To: gcc-bugs

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

Andrey Belevantsev <abel at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
      Known to work|                            |4.10.0
         Resolution|---                         |FIXED
      Known to fail|4.10.0                      |

--- Comment #5 from Andrey Belevantsev <abel at gcc dot gnu.org> ---
Fixed on trunk.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug rtl-optimization/60866] [4.7/4.8/4.9 Regression] ICE: in get_seqno_for_a_jump, at sel-sched-ir.c:4068 with -fselective-scheduling -fno-if-conversion
  2014-04-16 19:25 [Bug rtl-optimization/60866] New: [4.7/4.8/4.9/4.10 Regression] ICE: in get_seqno_for_a_jump, at sel-sched-ir.c:4068 with -fselective-scheduling -fno-if-conversion zsojka at seznam dot cz
  2014-04-28  9:01 ` [Bug rtl-optimization/60866] " abel at gcc dot gnu.org
  2014-05-14 12:19 ` abel at gcc dot gnu.org
@ 2014-05-14 13:19 ` ubizjak at gmail dot com
  2014-06-03  9:26 ` abel at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ubizjak at gmail dot com @ 2014-05-14 13:19 UTC (permalink / raw)
  To: gcc-bugs

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |ASSIGNED
         Resolution|FIXED                       |---
            Summary|[4.7/4.8/4.9/4.10           |[4.7/4.8/4.9 Regression]
                   |Regression] ICE: in         |ICE: in
                   |get_seqno_for_a_jump, at    |get_seqno_for_a_jump, at
                   |sel-sched-ir.c:4068 with    |sel-sched-ir.c:4068 with
                   |-fselective-scheduling      |-fselective-scheduling
                   |-fno-if-conversion          |-fno-if-conversion

--- Comment #6 from Uroš Bizjak <ubizjak at gmail dot com> ---
Not yet fixed on release branches.
>From gcc-bugs-return-451605-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed May 14 13:29:47 2014
Return-Path: <gcc-bugs-return-451605-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 11702 invoked by alias); 14 May 2014 13:29:47 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 11662 invoked by uid 48); 14 May 2014 13:29:43 -0000
From: "emsr at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/61166] overflow when parse number in std::duration operator""
Date: Wed, 14 May 2014 13:29:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: emsr at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-61166-4-c79pIUsir1@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61166-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61166-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-05/txt/msg01297.txt.bz2
Content-length: 397

https://gcc.gnu.org/bugzilla/show_bug.cgi?ida166

--- Comment #6 from emsr at gcc dot gnu.org ---
Something like parse_number was in the original doc as an implementation
example.  The idea was to select the smallest integral type that could
accommodate the number string with.  This is done with _Select_int.
_Select_type picks the most space-efficient duration ratio type using
_Select_int.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug rtl-optimization/60866] [4.7/4.8/4.9 Regression] ICE: in get_seqno_for_a_jump, at sel-sched-ir.c:4068 with -fselective-scheduling -fno-if-conversion
  2014-04-16 19:25 [Bug rtl-optimization/60866] New: [4.7/4.8/4.9/4.10 Regression] ICE: in get_seqno_for_a_jump, at sel-sched-ir.c:4068 with -fselective-scheduling -fno-if-conversion zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2014-05-14 13:19 ` [Bug rtl-optimization/60866] [4.7/4.8/4.9 " ubizjak at gmail dot com
@ 2014-06-03  9:26 ` abel at gcc dot gnu.org
  2014-06-03 10:09 ` abel at gcc dot gnu.org
  2014-06-03 10:11 ` abel at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: abel at gcc dot gnu.org @ 2014-06-03  9:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Andrey Belevantsev <abel at gcc dot gnu.org> ---
Author: abel
Date: Tue Jun  3 09:25:39 2014
New Revision: 211165

URL: http://gcc.gnu.org/viewcvs?rev=211165&root=gcc&view=rev
Log:
        Backport from mainline
        2014-05-14  Andrey Belevantsev  <abel@ispras.ru>

        PR rtl-optimization/60866
        * sel-sched-ir (sel_init_new_insn): New parameter old_seqno.
        Default it to -1.  Pass it down to init_simplejump_data.
        (init_simplejump_data): New parameter old_seqno.  Pass it down
        to get_seqno_for_a_jump.
        (get_seqno_for_a_jump): New parameter old_seqno.  Use it for
        initializing new jump seqno as a last resort.  Add comment.
        (sel_redirect_edge_and_branch): Save old seqno of the conditional
        jump and pass it down to sel_init_new_insn.
        (sel_redirect_edge_and_branch_force): Likewise.

    * gcc.dg/pr60866.c: New test.


Added:
    branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/pr60866.c
Modified:
    branches/gcc-4_8-branch/gcc/ChangeLog
    branches/gcc-4_8-branch/gcc/sel-sched-ir.c
    branches/gcc-4_8-branch/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug rtl-optimization/60866] [4.7/4.8/4.9 Regression] ICE: in get_seqno_for_a_jump, at sel-sched-ir.c:4068 with -fselective-scheduling -fno-if-conversion
  2014-04-16 19:25 [Bug rtl-optimization/60866] New: [4.7/4.8/4.9/4.10 Regression] ICE: in get_seqno_for_a_jump, at sel-sched-ir.c:4068 with -fselective-scheduling -fno-if-conversion zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2014-06-03  9:26 ` abel at gcc dot gnu.org
@ 2014-06-03 10:09 ` abel at gcc dot gnu.org
  2014-06-03 10:11 ` abel at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: abel at gcc dot gnu.org @ 2014-06-03 10:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Andrey Belevantsev <abel at gcc dot gnu.org> ---
Author: abel
Date: Tue Jun  3 10:08:58 2014
New Revision: 211169

URL: http://gcc.gnu.org/viewcvs?rev=211169&root=gcc&view=rev
Log:
        Backport from mainline
        2014-05-14  Andrey Belevantsev  <abel@ispras.ru>

        PR rtl-optimization/60866
        * sel-sched-ir (sel_init_new_insn): New parameter old_seqno.
        Default it to -1.  Pass it down to init_simplejump_data.
        (init_simplejump_data): New parameter old_seqno.  Pass it down
        to get_seqno_for_a_jump.
        (get_seqno_for_a_jump): New parameter old_seqno.  Use it for
        initializing new jump seqno as a last resort.  Add comment.
        (sel_redirect_edge_and_branch): Save old seqno of the conditional
        jump and pass it down to sel_init_new_insn.
        (sel_redirect_edge_and_branch_force): Likewise.

    * gcc.dg/pr60866.c: New test.

Added:
    branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/pr60866.c
Modified:
    branches/gcc-4_9-branch/gcc/ChangeLog
    branches/gcc-4_9-branch/gcc/sel-sched-ir.c
    branches/gcc-4_9-branch/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug rtl-optimization/60866] [4.7/4.8/4.9 Regression] ICE: in get_seqno_for_a_jump, at sel-sched-ir.c:4068 with -fselective-scheduling -fno-if-conversion
  2014-04-16 19:25 [Bug rtl-optimization/60866] New: [4.7/4.8/4.9/4.10 Regression] ICE: in get_seqno_for_a_jump, at sel-sched-ir.c:4068 with -fselective-scheduling -fno-if-conversion zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2014-06-03 10:09 ` abel at gcc dot gnu.org
@ 2014-06-03 10:11 ` abel at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: abel at gcc dot gnu.org @ 2014-06-03 10:11 UTC (permalink / raw)
  To: gcc-bugs

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

Andrey Belevantsev <abel at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #9 from Andrey Belevantsev <abel at gcc dot gnu.org> ---
Also fixed on branches.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-06-03 10:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-16 19:25 [Bug rtl-optimization/60866] New: [4.7/4.8/4.9/4.10 Regression] ICE: in get_seqno_for_a_jump, at sel-sched-ir.c:4068 with -fselective-scheduling -fno-if-conversion zsojka at seznam dot cz
2014-04-28  9:01 ` [Bug rtl-optimization/60866] " abel at gcc dot gnu.org
2014-05-14 12:19 ` abel at gcc dot gnu.org
2014-05-14 13:19 ` [Bug rtl-optimization/60866] [4.7/4.8/4.9 " ubizjak at gmail dot com
2014-06-03  9:26 ` abel at gcc dot gnu.org
2014-06-03 10:09 ` abel at gcc dot gnu.org
2014-06-03 10:11 ` abel 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).