public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/66185] New: ICE on valid code at -O3 on x86_64-linux-gnu
@ 2015-05-17 19:13 su at cs dot ucdavis.edu
  2015-05-18 12:43 ` [Bug tree-optimization/66185] [6 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 @ 2015-05-17 19:13 UTC (permalink / raw)
  To: gcc-bugs

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;
}


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

* [Bug tree-optimization/66185] [6 Regression] ICE on valid code at -O3 on x86_64-linux-gnu
  2015-05-17 19:13 [Bug tree-optimization/66185] New: ICE on valid code at -O3 on x86_64-linux-gnu su at cs dot ucdavis.edu
@ 2015-05-18 12:43 ` 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
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-05-18 12:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Mine (probably a dup).


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

* [Bug tree-optimization/66185] [6 Regression] ICE on valid code at -O3 on x86_64-linux-gnu
  2015-05-17 19:13 [Bug tree-optimization/66185] New: ICE on valid code at -O3 on x86_64-linux-gnu su at cs dot ucdavis.edu
  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
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-05-19  9:37 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.


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

* [Bug tree-optimization/66185] [6 Regression] ICE on valid code at -O3 on x86_64-linux-gnu
  2015-05-17 19:13 [Bug tree-optimization/66185] New: ICE on valid code at -O3 on x86_64-linux-gnu su at cs dot ucdavis.edu
  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
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-05-19  9:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Tue May 19 09:36:35 2015
New Revision: 223349

URL: https://gcc.gnu.org/viewcvs?rev=223349&root=gcc&view=rev
Log:
2015-05-19  Richard Biener  <rguenther@suse.de>

        PR tree-optimization/66165
        * tree-vect-slp.c (vect_supported_load_permutation_p): Add guard
        for no load permutation.

        * gcc.dg/torture/pr66165.c: New testcase.

        PR tree-optimization/66185
        * tree-vect-slp.c (vect_build_slp_tree): Properly roll back
        when building the SLP node from scalars.

        * gcc.dg/torture/pr66185.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr66165.c
    trunk/gcc/testsuite/gcc.dg/torture/pr66185.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-slp.c


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

end of thread, other threads:[~2015-05-19  9:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-17 19:13 [Bug tree-optimization/66185] New: ICE on valid code at -O3 on x86_64-linux-gnu su at cs dot ucdavis.edu
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

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