public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/61385] New: ICE on valid code at -O2 and -O3 on x86_64-linux-gnu
@ 2014-06-02  7:28 su at cs dot ucdavis.edu
  2014-06-02  8:19 ` [Bug tree-optimization/61385] [4.10 Regression] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: su at cs dot ucdavis.edu @ 2014-06-02  7:28 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61385
           Summary: ICE on valid code at -O2 and -O3 on x86_64-linux-gnu
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu

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

It is a regression from 4.9.x.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/4.10.0/lto-wrapper
Target: x86_64-unknown-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 4.10.0 20140601 (experimental) [trunk revision 211115] (GCC) 
$ 
$ gcc-trunk -Os small.c; a.out
$ gcc-4.9.0 -O2 small.c; a.out
$ 
$ gcc-trunk -O2 small.c
small.c: In function ‘fn1’:
small.c:6:1: internal compiler error: Segmentation fault
 fn1 ()
 ^
0x98642f crash_signal
    ../../gcc-trunk/gcc/toplev.c:337
0x7a0c09 is_gimple_val(tree_node*)
    ../../gcc-trunk/gcc/gimple-expr.c:814
0x9aa66d verify_gimple_assign_binary
    ../../gcc-trunk/gcc/tree-cfg.c:3582
0x9b5aff verify_gimple_in_cfg(function*, bool)
    ../../gcc-trunk/gcc/tree-cfg.c:4889
0x8cdc5e execute_function_todo
    ../../gcc-trunk/gcc/passes.c:1777
0x8ce4a3 execute_todo
    ../../gcc-trunk/gcc/passes.c:1834
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.
$ 


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


#include <assert.h>

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

int
fn1 ()
{
  int *h = &c;
  for (; c < 1; c++)
    {
      int *i = &a, *k = &a;
      f = 0;
      if (b)
    return 0;
      if (*h)
    {
      int **j = &i;
      *j = 0;
      d = 0;
    }
      else
    g = e = 0;
      if (*h)
    {
      int **l = &k;
      *l = &g;
    }
      d &= *h;
      assert (k == &a || k);
      assert (i);
    }
  return 0;
}

int
main ()
{
  fn1 (); 
  return 0;
}
>From gcc-bugs-return-452947-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Jun 02 07:45:55 2014
Return-Path: <gcc-bugs-return-452947-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 2374 invoked by alias); 2 Jun 2014 07:45:55 -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 2286 invoked by uid 55); 2 Jun 2014 07:45:49 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/61378] Obvious bug in vn_reference_lookup_3
Date: Mon, 02 Jun 2014 07:45:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenth at gcc dot gnu.org
X-Bugzilla-Status: NEW
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-61378-4-vkHBRz4Gh7@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61378-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61378-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-06/txt/msg00029.txt.bz2
Content-length: 485

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Mon Jun  2 07:45:15 2014
New Revision: 211126

URL: http://gcc.gnu.org/viewcvs?rev!1126&root=gcc&view=rev
Log:
2014-06-02  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/61378
    * tree-ssa-sccvn.c (vn_reference_lookup_3): Initialize
    valueized_anything.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-ssa-sccvn.c


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

* [Bug tree-optimization/61385] [4.10 Regression] ICE on valid code at -O2 and -O3 on x86_64-linux-gnu
  2014-06-02  7:28 [Bug tree-optimization/61385] New: ICE on valid code at -O2 and -O3 on x86_64-linux-gnu su at cs dot ucdavis.edu
@ 2014-06-02  8:19 ` rguenth at gcc dot gnu.org
  2014-06-02  8:25 ` jakub at gcc dot gnu.org
  2014-06-02  9:54 ` glisse at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-06-02  8:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-06-02
                 CC|                            |glisse at gcc dot gnu.org
            Version|unknown                     |4.10.0
   Target Milestone|---                         |4.10.0
            Summary|ICE on valid code at -O2    |[4.10 Regression] ICE on
                   |and -O3 on x86_64-linux-gnu |valid code at -O2 and -O3
                   |                            |on x86_64-linux-gnu
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
phiopt leaves a STMT around that references a released SSA name.

Confirmed.  Suspect CCed.


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

* [Bug tree-optimization/61385] [4.10 Regression] ICE on valid code at -O2 and -O3 on x86_64-linux-gnu
  2014-06-02  7:28 [Bug tree-optimization/61385] New: ICE on valid code at -O2 and -O3 on x86_64-linux-gnu su at cs dot ucdavis.edu
  2014-06-02  8:19 ` [Bug tree-optimization/61385] [4.10 Regression] " rguenth at gcc dot gnu.org
@ 2014-06-02  8:25 ` jakub at gcc dot gnu.org
  2014-06-02  9:54 ` glisse at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-06-02  8:25 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r210212.


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

* [Bug tree-optimization/61385] [4.10 Regression] ICE on valid code at -O2 and -O3 on x86_64-linux-gnu
  2014-06-02  7:28 [Bug tree-optimization/61385] New: ICE on valid code at -O2 and -O3 on x86_64-linux-gnu su at cs dot ucdavis.edu
  2014-06-02  8:19 ` [Bug tree-optimization/61385] [4.10 Regression] " rguenth at gcc dot gnu.org
  2014-06-02  8:25 ` jakub at gcc dot gnu.org
@ 2014-06-02  9:54 ` glisse at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: glisse at gcc dot gnu.org @ 2014-06-02  9:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Marc Glisse <glisse at gcc dot gnu.org> ---
Ah, right, I use last_and_only_stmt (middle_bb) but that doesn't prove there
are no PHI nodes there. Easiest fix, something like:

if (!gimple_seq_empty_p (phi_nodes (middle_bb)))
  return 0;

A better fix would be to move the PHI nodes from middle_bb to the same block as
we are moving the assignment. I am just not completely sure how safe that is
(or how to do that, but I'll probably find examples nearby).


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

end of thread, other threads:[~2014-06-02  9:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-02  7:28 [Bug tree-optimization/61385] New: ICE on valid code at -O2 and -O3 on x86_64-linux-gnu su at cs dot ucdavis.edu
2014-06-02  8:19 ` [Bug tree-optimization/61385] [4.10 Regression] " rguenth at gcc dot gnu.org
2014-06-02  8:25 ` jakub at gcc dot gnu.org
2014-06-02  9:54 ` glisse 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).