public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/63941] New: ICE on valid code at -O3 and above on x86_64-linux-gnu
@ 2014-11-18 18:24 su at cs dot ucdavis.edu
  2014-11-18 22:26 ` [Bug tree-optimization/63941] [5 Regression] " hjl.tools at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: su at cs dot ucdavis.edu @ 2014-11-18 18:24 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 63941
           Summary: ICE on valid code at -O3 and above on x86_64-linux-gnu
           Product: gcc
           Version: 5.0
            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
-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/5.0.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 5.0.0 20141117 (experimental) [trunk revision 217671] (GCC) 

$ gcc-trunk -O2 -c small.c
$ gcc-4.9 -O3 -c small.c
$ 
$ gcc-trunk -O3 -c small.c
small.c: In function ‘fn1’:
small.c:4:1: internal compiler error: in add_to_predicate_list, at
tree-if-conv.c:438
 fn1 ()
 ^
0xb11044 add_to_predicate_list
    ../../gcc-trunk/gcc/tree-if-conv.c:438
0xb11044 add_to_dst_predicate_list
    ../../gcc-trunk/gcc/tree-if-conv.c:488
0xb11564 predicate_bbs
    ../../gcc-trunk/gcc/tree-if-conv.c:1155
0xb11c7a combine_blocks
    ../../gcc-trunk/gcc/tree-if-conv.c:2005
0xb13c06 tree_if_conversion
    ../../gcc-trunk/gcc/tree-if-conv.c:2162
0xb13c06 execute
    ../../gcc-trunk/gcc/tree-if-conv.c:2240
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[1], e, f, g, h;

void
fn1 ()
{
  char i = 0;
  for (b = 0; b >= 0;)
    for (b = 0; b < 2; b++)
      {
    d[f] && (e = 0);
    h = 1 & a - i ? 0 : a;
    c = i = h;
    char j = c;
    int k = 0;
    g = j || j > k;
    d[0] = 0;
      }
}
>From gcc-bugs-return-467286-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Nov 18 18:24:03 2014
Return-Path: <gcc-bugs-return-467286-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 23458 invoked by alias); 18 Nov 2014 18:24:03 -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 23372 invoked by uid 48); 18 Nov 2014 18:23:59 -0000
From: "dje at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/63940] C++ constexpr errors on AIX
Date: Tue, 18 Nov 2014 18:24:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: dje 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: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc target_milestone
Message-ID: <bug-63940-4-wWCgLtULla@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63940-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63940-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-11/txt/msg01758.txt.bz2
Content-length: 437

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

David Edelsohn <dje at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |vries at gcc dot gnu.org
   Target Milestone|---                         |5.0


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

* [Bug tree-optimization/63941] [5 Regression] ICE on valid code at -O3 and above on x86_64-linux-gnu
  2014-11-18 18:24 [Bug tree-optimization/63941] New: ICE on valid code at -O3 and above on x86_64-linux-gnu su at cs dot ucdavis.edu
@ 2014-11-18 22:26 ` hjl.tools at gmail dot com
  2014-11-19  9:55 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: hjl.tools at gmail dot com @ 2014-11-18 22:26 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-11-18
                 CC|                            |ysrumyan at gmail dot com
   Target Milestone|---                         |5.0
            Summary|ICE on valid code at -O3    |[5 Regression] ICE on valid
                   |and above on                |code at -O3 and above on
                   |x86_64-linux-gnu            |x86_64-linux-gnu
     Ever confirmed|0                           |1

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
It was caused by r217277.


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

* [Bug tree-optimization/63941] [5 Regression] ICE on valid code at -O3 and above on x86_64-linux-gnu
  2014-11-18 18:24 [Bug tree-optimization/63941] New: ICE on valid code at -O3 and above on x86_64-linux-gnu su at cs dot ucdavis.edu
  2014-11-18 22:26 ` [Bug tree-optimization/63941] [5 Regression] " hjl.tools at gmail dot com
@ 2014-11-19  9:55 ` rguenth at gcc dot gnu.org
  2014-11-28 15:35 ` ysrumyan at gmail dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-11-19  9:55 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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

* [Bug tree-optimization/63941] [5 Regression] ICE on valid code at -O3 and above on x86_64-linux-gnu
  2014-11-18 18:24 [Bug tree-optimization/63941] New: ICE on valid code at -O3 and above on x86_64-linux-gnu su at cs dot ucdavis.edu
  2014-11-18 22:26 ` [Bug tree-optimization/63941] [5 Regression] " hjl.tools at gmail dot com
  2014-11-19  9:55 ` rguenth at gcc dot gnu.org
@ 2014-11-28 15:35 ` ysrumyan at gmail dot com
  2014-12-01 12:20 ` ienkovich at gcc dot gnu.org
  2014-12-01 12:47 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: ysrumyan at gmail dot com @ 2014-11-28 15:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Yuri Rumyantsev <ysrumyan at gmail dot com> ---
My patch is responsible for ICE - I did not assume that before if-convert phase
cfg may contain redundant degenerative conditional branches:

    <bb 4>:
...
    _14 = d[pretmp_51];
    if (_14 != 0)
      goto <bb 6>;
    else
      goto <bb 5>;

  }
  bb_5 (preds = {bb_4 }, succs = {bb_6 })
  {
    <bb 5>:

  }
  bb_6 (preds = {bb_5 bb_4 }, succs = {bb_10 bb_7 })

I deleted wrong assert and slightly changed code to set up predicate for join
bb conditionally. With this fix test is compiled successfully.

The patch was sent to GCC community for review.


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

* [Bug tree-optimization/63941] [5 Regression] ICE on valid code at -O3 and above on x86_64-linux-gnu
  2014-11-18 18:24 [Bug tree-optimization/63941] New: ICE on valid code at -O3 and above on x86_64-linux-gnu su at cs dot ucdavis.edu
                   ` (2 preceding siblings ...)
  2014-11-28 15:35 ` ysrumyan at gmail dot com
@ 2014-12-01 12:20 ` ienkovich at gcc dot gnu.org
  2014-12-01 12:47 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: ienkovich at gcc dot gnu.org @ 2014-12-01 12:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from ienkovich at gcc dot gnu.org ---
Author: ienkovich
Date: Mon Dec  1 12:19:28 2014
New Revision: 218206

URL: https://gcc.gnu.org/viewcvs?rev=218206&root=gcc&view=rev
Log:
gcc/

    PR tree-optimization/63941
    * tree-if-conv.c (add_to_predicate_list): Delete wrong assertion that
    DOM_BB has non-true predicate, conditionally set non-true predicate
    for BB.

gcc/testsuite/

    PR tree-optimization/63941
    * gcc.dg/torture/pr63941.c: New test.


Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr63941.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-if-conv.c


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

* [Bug tree-optimization/63941] [5 Regression] ICE on valid code at -O3 and above on x86_64-linux-gnu
  2014-11-18 18:24 [Bug tree-optimization/63941] New: ICE on valid code at -O3 and above on x86_64-linux-gnu su at cs dot ucdavis.edu
                   ` (3 preceding siblings ...)
  2014-12-01 12:20 ` ienkovich at gcc dot gnu.org
@ 2014-12-01 12:47 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-12-01 12:47 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |jakub at gcc dot gnu.org
         Resolution|---                         |FIXED

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.


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

end of thread, other threads:[~2014-12-01 12:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-18 18:24 [Bug tree-optimization/63941] New: ICE on valid code at -O3 and above on x86_64-linux-gnu su at cs dot ucdavis.edu
2014-11-18 22:26 ` [Bug tree-optimization/63941] [5 Regression] " hjl.tools at gmail dot com
2014-11-19  9:55 ` rguenth at gcc dot gnu.org
2014-11-28 15:35 ` ysrumyan at gmail dot com
2014-12-01 12:20 ` ienkovich at gcc dot gnu.org
2014-12-01 12:47 ` jakub 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).