public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/68013] New: ICE on valid code at -O2 on x86_64-linux-gnu in duplicate_thread_path, at tree-ssa-threadupdate.c:2469
@ 2015-10-19  3:24 su at cs dot ucdavis.edu
  2015-10-19  9:59 ` [Bug tree-optimization/68013] [6 Regression] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: su at cs dot ucdavis.edu @ 2015-10-19  3:24 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 68013
           Summary: ICE on valid code at -O2 on x86_64-linux-gnu in
                    duplicate_thread_path, at tree-ssa-threadupdate.c:2469
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

The following code causes an ICE when compiled with the current gcc trunk at
-O2 on x86_64-linux-gnu in both 32-bit and 64-bit modes.

It is a regression from 5.2.x.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20151018 (experimental) [trunk revision 228953] (GCC) 
$ 
$ gcc-trunk -Os -c small.c
$ gcc-5.2 -O2 -c small.c
$ 
$ gcc-trunk -O2 -c small.c
small.c: In function ‘fn1’:
small.c:4:1: internal compiler error: in duplicate_thread_path, at
tree-ssa-threadupdate.c:2469
 fn1 ()
 ^
0xcd3440 duplicate_thread_path
        ../../gcc-trunk/gcc/tree-ssa-threadupdate.c:2468
0xcd3440 thread_through_all_blocks(bool)
        ../../gcc-trunk/gcc/tree-ssa-threadupdate.c:2669
0xc0a203 execute
        ../../gcc-trunk/gcc/tree-ssa-dom.c:622
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.
$ 


------------------------------------


int a, b, c, d, e, f;

void
fn1 ()
{
  for (; e;)
    {
      e = f;
      for (; b;)
        {
          b = a;
          f = a || d ? 0 : c;
        }
      d = 0;
    }
}
>From gcc-bugs-return-499899-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Oct 19 04:37:30 2015
Return-Path: <gcc-bugs-return-499899-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 12280 invoked by alias); 19 Oct 2015 04:37:30 -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 12185 invoked by uid 48); 19 Oct 2015 04:37:25 -0000
From: "pault at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/31711] was "rhs array is changed while assiging to same lhs array"
Date: Mon, 19 Oct 2015 04:37:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.3.0
X-Bugzilla-Keywords: missed-optimization
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: pault at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: FIXED
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-31711-4-aVFpPZ7yzo@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-31711-4@http.gcc.gnu.org/bugzilla/>
References: <bug-31711-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: 2015-10/txt/msg01454.txt.bz2
Content-length: 728

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

--- Comment #19 from Paul Thomas <pault at gcc dot gnu.org> ---
(In reply to Dominique d'Humieres from comment #18)
> > comment #10 from Roger-Sayle is being kept "live" by this PR.  Whilst
> > I am interested, I have to give priority to other PRs to make best use
> > of my limited time.  I may yet come back to it....
> >
> > Paul
>
> No activity for over eight years. The original problem has been fixed a long
> time ago and I am sure that too many changes have been made in the
> dependency analysis to keep this PR opened base on comment 10. Closing as
> FIXED.

Fine by me. I might just add a TODO above the offending line of code, pointing
to this PR.

Cheers

Paul


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

* [Bug tree-optimization/68013] [6 Regression] ICE on valid code at -O2 on x86_64-linux-gnu in duplicate_thread_path, at tree-ssa-threadupdate.c:2469
  2015-10-19  3:24 [Bug tree-optimization/68013] New: ICE on valid code at -O2 on x86_64-linux-gnu in duplicate_thread_path, at tree-ssa-threadupdate.c:2469 su at cs dot ucdavis.edu
@ 2015-10-19  9:59 ` rguenth at gcc dot gnu.org
  2015-10-26 15:26 ` law at redhat dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-10-19  9:59 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |6.0
            Summary|ICE on valid code at -O2 on |[6 Regression] ICE on valid
                   |x86_64-linux-gnu in         |code at -O2 on
                   |duplicate_thread_path, at   |x86_64-linux-gnu in
                   |tree-ssa-threadupdate.c:246 |duplicate_thread_path, at
                   |9                           |tree-ssa-threadupdate.c:246
                   |                            |9


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

* [Bug tree-optimization/68013] [6 Regression] ICE on valid code at -O2 on x86_64-linux-gnu in duplicate_thread_path, at tree-ssa-threadupdate.c:2469
  2015-10-19  3:24 [Bug tree-optimization/68013] New: ICE on valid code at -O2 on x86_64-linux-gnu in duplicate_thread_path, at tree-ssa-threadupdate.c:2469 su at cs dot ucdavis.edu
  2015-10-19  9:59 ` [Bug tree-optimization/68013] [6 Regression] " rguenth at gcc dot gnu.org
@ 2015-10-26 15:26 ` law at redhat dot com
  2015-10-26 15:36 ` law at gcc dot gnu.org
  2015-10-26 15:37 ` law at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: law at redhat dot com @ 2015-10-26 15:26 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2015-10-26
     Ever confirmed|0                           |1

--- Comment #1 from Jeffrey A. Law <law at redhat dot com> ---
The problem here is the first block in an FSM path may not be added to
VISITED_BBs.  That in turn results in the threader finding a path which passes
through that initial block a second time, reaching a different destination the
second time through.

This is caught by the assertion (to avoid generating incorrect code).  Fixing
is simple.  But...

I'm not real happy with how the affected code is structured, but I'm at a loss
right now how to reorganize it in the immediate term.  I'm hoping to get some
clarity as I continue to look to replace the EDGE_DFS_BACK support in the old
threader with the FSM threader.

Anyway, I'll be committing a fix shortly.


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

* [Bug tree-optimization/68013] [6 Regression] ICE on valid code at -O2 on x86_64-linux-gnu in duplicate_thread_path, at tree-ssa-threadupdate.c:2469
  2015-10-19  3:24 [Bug tree-optimization/68013] New: ICE on valid code at -O2 on x86_64-linux-gnu in duplicate_thread_path, at tree-ssa-threadupdate.c:2469 su at cs dot ucdavis.edu
  2015-10-19  9:59 ` [Bug tree-optimization/68013] [6 Regression] " rguenth at gcc dot gnu.org
  2015-10-26 15:26 ` law at redhat dot com
@ 2015-10-26 15:36 ` law at gcc dot gnu.org
  2015-10-26 15:37 ` law at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: law at gcc dot gnu.org @ 2015-10-26 15:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Author: law
Date: Mon Oct 26 15:36:04 2015
New Revision: 229375

URL: https://gcc.gnu.org/viewcvs?rev=229375&root=gcc&view=rev
Log:
[PATCH] [PR tree-optimization/68013] Make sure first block in FSM path
is in VISITED_BBs

        PR tree-optimization/68013
        * tree-ssa-threadbackward.c
        (fsm_find_control_statement_thread_paths): Make sure the first block
        in the path is in VISITED_BBs.

        PR tree-optimization/68013
        * gcc.c-torture/compile/pr68013.c: New test.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr68013.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-threadbackward.c


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

* [Bug tree-optimization/68013] [6 Regression] ICE on valid code at -O2 on x86_64-linux-gnu in duplicate_thread_path, at tree-ssa-threadupdate.c:2469
  2015-10-19  3:24 [Bug tree-optimization/68013] New: ICE on valid code at -O2 on x86_64-linux-gnu in duplicate_thread_path, at tree-ssa-threadupdate.c:2469 su at cs dot ucdavis.edu
                   ` (2 preceding siblings ...)
  2015-10-26 15:36 ` law at gcc dot gnu.org
@ 2015-10-26 15:37 ` law at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: law at redhat dot com @ 2015-10-26 15:37 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at redhat dot com> changed:

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

--- Comment #3 from Jeffrey A. Law <law at redhat dot com> ---
Fixed on trunk.


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

end of thread, other threads:[~2015-10-26 15:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-19  3:24 [Bug tree-optimization/68013] New: ICE on valid code at -O2 on x86_64-linux-gnu in duplicate_thread_path, at tree-ssa-threadupdate.c:2469 su at cs dot ucdavis.edu
2015-10-19  9:59 ` [Bug tree-optimization/68013] [6 Regression] " rguenth at gcc dot gnu.org
2015-10-26 15:26 ` law at redhat dot com
2015-10-26 15:36 ` law at gcc dot gnu.org
2015-10-26 15:37 ` law at redhat dot com

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).