public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/61917] New: ICE on valid code at -O3 on x86_64-linux-gnu in vectorizable_reduction, at tree-vect-loop.c:4913
@ 2014-07-26  4:27 su at cs dot ucdavis.edu
  2014-07-27 14:54 ` [Bug tree-optimization/61917] [4.9/5.0 Regression] " mpolacek at gcc dot gnu.org
                   ` (19 more replies)
  0 siblings, 20 replies; 21+ messages in thread
From: su at cs dot ucdavis.edu @ 2014-07-26  4:27 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61917
           Summary: ICE on valid code at -O3 on x86_64-linux-gnu in
                    vectorizable_reduction, at tree-vect-loop.c:4913
           Product: gcc
           Version: 4.10.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 and
gcc 4.9 at -O3 on x86_64-linux-gnu (in both 32-bit and 64-bit modes).

It 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/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 20140725 (experimental) [trunk revision 213036] (GCC) 
$ 
$ gcc-trunk -O2 -c small.c
$ gcc-4.8 -O3 -c small.c
$ 
$ gcc-trunk -O3 -c small.c
small.c: In function ‘fn1’:
small.c:4:1: internal compiler error: in vectorizable_reduction, at
tree-vect-loop.c:4913
 fn1 ()
 ^
0xb8eb3c vectorizable_reduction(gimple_statement_base*, gimple_stmt_iterator*,
gimple_statement_base**, _slp_tree*)
    ../../gcc-trunk/gcc/tree-vect-loop.c:4913
0xb8144f vect_analyze_stmt(gimple_statement_base*, bool*, _slp_tree*)
    ../../gcc-trunk/gcc/tree-vect-stmts.c:7103
0xb8ccee vect_analyze_loop_operations
    ../../gcc-trunk/gcc/tree-vect-loop.c:1505
0xb8ccee vect_analyze_loop_2
    ../../gcc-trunk/gcc/tree-vect-loop.c:1766
0xb8ccee vect_analyze_loop(loop*)
    ../../gcc-trunk/gcc/tree-vect-loop.c:1864
0xba50cf vectorize_loops()
    ../../gcc-trunk/gcc/tree-vectorizer.c:432
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.
$ 
$ gcc-4.9 -O3 -c small.c
small.c: In function ‘fn1’:
small.c:4:1: internal compiler error: in vectorizable_reduction, at
tree-vect-loop.c:4907
 fn1 ()
 ^
0x9b6f35 vectorizable_reduction(gimple_statement_base*, gimple_stmt_iterator*,
gimple_statement_base**, _slp_tree*)
    ../../gcc-4.9.0/gcc/tree-vect-loop.c:4907
0x9a94e8 vect_analyze_stmt(gimple_statement_base*, bool*, _slp_tree*)
    ../../gcc-4.9.0/gcc/tree-vect-stmts.c:7103
0x9b54e6 vect_analyze_loop_operations
    ../../gcc-4.9.0/gcc/tree-vect-loop.c:1505
0x9b54e6 vect_analyze_loop_2
    ../../gcc-4.9.0/gcc/tree-vect-loop.c:1765
0x9b54e6 vect_analyze_loop(loop*)
    ../../gcc-4.9.0/gcc/tree-vect-loop.c:1863
0x9c9f3b vectorize_loops()
    ../../gcc-4.9.0/gcc/tree-vectorizer.c:430
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;

int
fn1 ()
{
  for (; c; c++)
    for (b = 0; b < 2; b++)
      d = a - d;
  return d; 
}
>From gcc-bugs-return-457127-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Jul 26 05:40:23 2014
Return-Path: <gcc-bugs-return-457127-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 4315 invoked by alias); 26 Jul 2014 05:40:22 -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 3716 invoked by uid 48); 26 Jul 2014 05:40:19 -0000
From: "mitya57 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug preprocessor/61918] New: With -isystem, symlinks are sometimes processed incorrectly
Date: Sat, 26 Jul 2014 05:40:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: preprocessor
X-Bugzilla-Version: 4.9.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mitya57 at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
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
Message-ID: <bug-61918-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-07/txt/msg01718.txt.bz2
Content-length: 1642

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

            Bug ID: 61918
           Summary: With -isystem, symlinks are sometimes processed
                    incorrectly
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mitya57 at gmail dot com

Originally reported at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bugu5767.

Here is the minimal test case:

$ ls -l correct
lrwxrwxrwx 1 dmitry dmitry 16 Jul 26 09:07 first.h -> ../wrong/first.h
-rw-r--r-- 1 dmitry dmitry  0 Jul 26 09:27 second.h
$ ls -l wrong
-rw-r--r-- 1 dmitry dmitry 20 Jul 26 09:07 first.h
-rw-r--r-- 1 dmitry dmitry 38 Jul 26 09:27 second.h
$ cat wrong/first.h
#include "second.h"
$ cat wrong/second.h
#warning Should not include this file
$ cat correct/second.h
$ cat test.c
#include "first.h"
$ cpp -I $(pwd)/correct test.c >/dev/null
$ cpp -isystem $(pwd)/correct test.c >/dev/null
In file included from /tmp/wrong/first.h:1:0,
                 from test.c:1:
/tmp/wrong/second.h:1:2: warning: #warning Should not include this file [-Wcpp]
 #warning Should not include this file
  ^
$ cpp -isystem ./correct test.c >/dev/null
$

As you can see, correct/first.h is a symlink to wrong/first.h, which in turn
includes second.h. However, I see no reason why cpp follows that symlinks and
opens second.h in wrong directory.

When I use -I instead of -isystem, or use relative file path instead of
absolute, the behavior is correct. Also, clang always handles this correctly.


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

end of thread, other threads:[~2015-02-25 21:08 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-26  4:27 [Bug tree-optimization/61917] New: ICE on valid code at -O3 on x86_64-linux-gnu in vectorizable_reduction, at tree-vect-loop.c:4913 su at cs dot ucdavis.edu
2014-07-27 14:54 ` [Bug tree-optimization/61917] [4.9/5.0 Regression] " mpolacek at gcc dot gnu.org
2014-10-30 10:42 ` [Bug tree-optimization/61917] [4.9/5 " jakub at gcc dot gnu.org
2014-11-24 16:52 ` rguenth at gcc dot gnu.org
2014-12-11 13:35 ` tarasevich at cs dot uni-saarland.de
2015-02-24 19:33 ` ktietz at gcc dot gnu.org
2015-02-25 14:14 ` ktietz at gcc dot gnu.org
2015-02-25 14:20 ` ktietz at gcc dot gnu.org
2015-02-25 14:25 ` [Bug tree-optimization/61917] [4.9 " law at redhat dot com
2015-02-25 14:56 ` ktietz at gcc dot gnu.org
2015-02-25 14:59 ` ktietz at gcc dot gnu.org
2015-02-25 18:28 ` ktietz at gcc dot gnu.org
2015-02-25 18:32 ` hjl.tools at gmail dot com
2015-02-25 18:38 ` ktietz at gcc dot gnu.org
2015-02-25 18:45 ` hjl.tools at gmail dot com
2015-02-25 19:21 ` jakub at gcc dot gnu.org
2015-02-25 19:24 ` ktietz at gcc dot gnu.org
2015-02-25 19:25 ` ktietz at gcc dot gnu.org
2015-02-25 20:00 ` ktietz at gcc dot gnu.org
2015-02-25 20:03 ` ktietz at gcc dot gnu.org
2015-02-25 22:22 ` hjl.tools at gmail 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).