public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "su at cs dot ucdavis.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/66185] New: ICE on valid code at -O3 on x86_64-linux-gnu
Date: Sun, 17 May 2015 19:13:00 -0000	[thread overview]
Message-ID: <bug-66185-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 66185
           Summary: ICE on valid code at -O3 on x86_64-linux-gnu
           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
-O3 on x86_64-linux-gnu in both 32-bit and 64-bit modes. 

It is a regression from 5.1.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/6.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 6.0.0 20150517 (experimental) [trunk revision 223265] (GCC) 
$ 
$ gcc-trunk -O2 small.c; ./a.out
$ gcc-5.1 -O3 small.c; ./a.out
$ 
$ gcc-trunk -O3 small.c
small.c: In function ‘main’:
small.c:5:1: internal compiler error: Segmentation fault
 main ()
  ^
0xacd85f crash_signal
        ../../gcc-trunk/gcc/toplev.c:380
0xd066c8 vec<gimple_statement_base*, va_heap, vl_embed>::operator[](unsigned
int)
        ../../gcc-trunk/gcc/vec.h:736
0xd066c8 vec<gimple_statement_base*, va_heap, vl_ptr>::operator[](unsigned int)
        ../../gcc-trunk/gcc/vec.h:1202
0xd066c8 vect_analyze_slp_instance
        ../../gcc-trunk/gcc/tree-vect-slp.c:1805
0xd07606 vect_analyze_slp(_loop_vec_info*, _bb_vec_info*, unsigned int)
        ../../gcc-trunk/gcc/tree-vect-slp.c:1897
0xd07ad6 vect_slp_analyze_bb_1
        ../../gcc-trunk/gcc/tree-vect-slp.c:2431
0xd07ad6 vect_slp_analyze_bb(basic_block_def*)
        ../../gcc-trunk/gcc/tree-vect-slp.c:2561
0xd09e42 execute
        ../../gcc-trunk/gcc/tree-vectorizer.c:662
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.
$ 


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


unsigned int a;
int b[5], c;

int
main ()
{
  for (c = 0; c < 4; c++)
    b[c] = b[c+1] > ((b[0] > 0) > a);

  return 0;
}
>From gcc-bugs-return-486484-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun May 17 19:20:36 2015
Return-Path: <gcc-bugs-return-486484-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 79297 invoked by alias); 17 May 2015 19:20:36 -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 79269 invoked by uid 48); 17 May 2015 19:20:31 -0000
From: "su at cs dot ucdavis.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/66186] New: wrong code at -O3 on x86_64-linux-gnu
Date: Sun, 17 May 2015 19:20:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: su at cs dot ucdavis.edu
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-66186-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-05/txt/msg01324.txt.bz2
Content-length: 1565

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

            Bug ID: 66186
           Summary: wrong code at -O3 on x86_64-linux-gnu
           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 current gcc trunk (as well as 4.9.x and 5.1.x) miscompiles the following
code on x86_64-linux at -O3 in both 32-bit and 64-bit modes.

This is a regression from 4.8.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/6.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 6.0.0 20150517 (experimental) [trunk revision 223265] (GCC)
$
$ gcc-trunk -O2 small.c; ./a.out
$ gcc-4.8.4 -O3 small.c; ./a.out
$
$ gcc-trunk -O3 small.c
$ ./a.out
Segmentation fault (core dumped)
$ gcc-5.1 -O3 small.c
$ ./a.out
Segmentation fault (core dumped)
$ gcc-4.9.2 -O3 small.c
$ ./a.out
Segmentation fault (core dumped)
$


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


int a;

int
main ()
{
  int b = -1, d, e = 0, f[2] = { 0 };
  unsigned short c = b;
  for (; e < 3; e++)
    for (d = 0; d < 2; d++)
      if (a < 0)
        for (d = 0; d < 2; d++)
          if (f[c])
            break;
  return 0;
}


             reply	other threads:[~2015-05-17 19:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-17 19:13 su at cs dot ucdavis.edu [this message]
2015-05-18 12:43 ` [Bug tree-optimization/66185] [6 Regression] " rguenth at gcc dot gnu.org
2015-05-19  9:37 ` rguenth at gcc dot gnu.org
2015-05-19  9:37 ` rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-66185-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).