public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/62208] New: ICE with LTO on valid code at -O3 on x86_64-linux-gnu in trunc_int_for_mode, at explow.c:56
@ 2014-08-20 17:56 su at cs dot ucdavis.edu
  2014-08-21  8:22 ` [Bug rtl-optimization/62208] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: su at cs dot ucdavis.edu @ 2014-08-20 17:56 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 62208
           Summary: ICE with LTO on valid code at -O3 on x86_64-linux-gnu
                    in trunc_int_for_mode, at explow.c:56
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          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 with
LTO at -O3 on x86_64-linux-gnu in 32-bit mode (but not in 64-bit mode).

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 20140820 (experimental) [trunk revision 214209] (GCC) 
$ 
$ gcc-trunk -m32 -O3 small.c; a.out
$ gcc-trunk -flto -m64 -O3 small.c; a.out
$ gcc-4.9 -flto -m32 -O3 small.c; a.out
$ 
$ gcc-trunk -flto -m32 -O3 small.c
small.c: In function ‘main’:
small.c:21:1: internal compiler error: in trunc_int_for_mode, at explow.c:56
 }
 ^
0x627bb0 trunc_int_for_mode(long, machine_mode)
    ../../gcc-trunk/gcc/explow.c:56
0x616418 gen_int_mode(long, machine_mode)
    ../../gcc-trunk/gcc/emit-rtl.c:437
0x8d159c simplify_const_unary_operation(rtx_code, machine_mode, rtx_def*,
machine_mode)
    ../../gcc-trunk/gcc/simplify-rtx.c:1735
0x8ceb6a simplify_unary_operation(rtx_code, machine_mode, rtx_def*,
machine_mode)
    ../../gcc-trunk/gcc/simplify-rtx.c:814
0x8cff10 simplify_gen_unary(rtx_code, machine_mode, rtx_def*, machine_mode)
    ../../gcc-trunk/gcc/simplify-rtx.c:387
0xe1249e if_then_else_cond
    ../../gcc-trunk/gcc/combine.c:8615
0xe1d32e combine_simplify_rtx
    ../../gcc-trunk/gcc/combine.c:5262
0xe1fbaa subst
    ../../gcc-trunk/gcc/combine.c:5199
0xe1f8c8 subst
    ../../gcc-trunk/gcc/combine.c:5144
0xe1f8c8 subst
    ../../gcc-trunk/gcc/combine.c:5144
0xe22124 try_combine
    ../../gcc-trunk/gcc/combine.c:3134
0xe27f8d combine_instructions
    ../../gcc-trunk/gcc/combine.c:1280
0xe27f8d rest_of_handle_combine
    ../../gcc-trunk/gcc/combine.c:13896
0xe27f8d execute
    ../../gcc-trunk/gcc/combine.c:13939
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.
lto-wrapper: fatal error: gcc-trunk returned 1 exit status
compilation terminated.
/usr/bin/ld: fatal error: lto-wrapper failed
collect2: error: ld returned 1 exit status
$ 


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


int *a;
unsigned int b;

void fn2 ()
{
  int t[9];
  for (; b; b++)
    *a ^= (~t[b] != t[b]);
}

int fn1 ()
{
  fn2 (); 
  return 0; 
}

int main ()
{
  fn1 (); 
  return 0;
}
>From gcc-bugs-return-458898-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Aug 20 18:10:14 2014
Return-Path: <gcc-bugs-return-458898-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 15801 invoked by alias); 20 Aug 2014 18:10:13 -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 15780 invoked by uid 48); 20 Aug 2014 18:10:07 -0000
From: "su at cs dot ucdavis.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/62209] New: ICE with LTO on valid code on x86_64-linux-gnu
Date: Wed, 20 Aug 2014 18:10: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: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: su at cs dot ucdavis.edu
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-62209-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-08/txt/msg01395.txt.bz2
Content-length: 2864

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

            Bug ID: 62209
           Summary: ICE with LTO on valid code 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 (as
well as 4.8.x and 4.9.x) with LTO on x86_64-linux-gnu in both 32-bit and 64-bit
modes.

It is a regression from 4.7.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 20140820 (experimental) [trunk revision 214209] (GCC) 
$ 
$ gcc-trunk -O0 -c fn1.c
$ gcc-trunk -O0 -c main.c
$ gcc-trunk -O1 *.o  
$ ./a.out
$ 
$ gcc-trunk -flto -O0 -c fn1.c
$ gcc-trunk -flto -O0 -c main.c
$ gcc-trunk -flto -O1 *.o
fn1.c: In function ‘fn1’:
fn1.c:9:5: internal compiler error: in as_a, at is-a.h:192
 int fn1 (void)
     ^
0x90de17 gimple_statement_phi const* as_a<gimple_statement_phi const*,
gimple_statement_base const>(gimple_statement_base const*)
    ../../gcc-trunk/gcc/is-a.h:192
0x9210c7 gimple_statement_phi const* as_a<gimple_statement_phi const*,
gimple_statement_base const>(gimple_statement_base const*)
    ../../gcc-trunk/gcc/is-a.h:192
0x9210c7 gimple_phi_result
    ../../gcc-trunk/gcc/gimple.h:3791
0x9210c7 verify_gimple_phi
    ../../gcc-trunk/gcc/tree-cfg.c:4532
0x9210c7 verify_gimple_in_cfg(function*, bool)
    ../../gcc-trunk/gcc/tree-cfg.c:4864
0x82f136 execute_function_todo
    ../../gcc-trunk/gcc/passes.c:1749
0x82fc53 execute_todo
    ../../gcc-trunk/gcc/passes.c:1806
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.
lto-wrapper: fatal error: gcc-trunk returned 1 exit status
compilation terminated.
/usr/bin/ld: fatal error: lto-wrapper failed
collect2: error: ld returned 1 exit status
$ 
$ gcc-4.7 -flto -O0 -c fn1.c
$ gcc-4.7 -flto -O0 -c main.c
$ gcc-4.7 -flto -O1 *.o
$ ./a.out
$ 
$ cat fn1.c  
struct S
{
  int f0;
  unsigned int f1:1;
} b;

int a, c, d;

int fn1 (void)
{
  unsigned int t1 = 0;
  struct S t2 = { 0, 0 };
  if (c)
    {
      struct S t3 = { 0, 0 };
      for (; a;)
    t3 = b;
      d = ((65531 && t1) < t3.f1) & t3.f1;
    }
  return t2.f0;
}
$ cat main.c
extern int fn1 (void); 

int main ()
{
  fn1 (); 
  return 0;
}
$
>From gcc-bugs-return-458899-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Aug 20 18:21:51 2014
Return-Path: <gcc-bugs-return-458899-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 21066 invoked by alias); 20 Aug 2014 18:21:51 -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 21014 invoked by uid 55); 20 Aug 2014 18:21:47 -0000
From: "xur at google dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug gcov-profile/61889] [5 Regression] gcov-tool.c uses nftw, ftw.h
Date: Wed, 20 Aug 2014 18:21:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: gcov-profile
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords: build
X-Bugzilla-Severity: normal
X-Bugzilla-Who: xur at google dot com
X-Bugzilla-Status: WAITING
X-Bugzilla-Priority: P1
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-61889-4-RKG9utIAgn@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61889-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61889-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-08/txt/msg01396.txt.bz2
Content-length: 1119

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

--- Comment #5 from xur at google dot com ---
I sent a patch for this a few days ago:

https://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg87155.html

It's pending review.


Thanks,

-Rong

On Wed, Aug 20, 2014 at 10:36 AM, ktietz at gcc dot gnu.org
<gcc-bugzilla@gcc.gnu.org> wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?ida889
>
> Kai Tietz <ktietz at gcc dot gnu.org> changed:
>
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|NEW                         |WAITING
>       Known to fail|4.10.0                      |5.0
>
> --- Comment #4 from Kai Tietz <ktietz at gcc dot gnu.org> ---
> Issue got fixed on mingw-w64's side by providing on trunk ftw/nftw API.
> Nevertheless it would be good that for ftw include and use at least a
> header-check is done.  That gcov data isn't deleted isn't necessarily that bad.
>  IMO better then disabling complete tool.
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.


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

end of thread, other threads:[~2014-09-07  8:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-20 17:56 [Bug lto/62208] New: ICE with LTO on valid code at -O3 on x86_64-linux-gnu in trunc_int_for_mode, at explow.c:56 su at cs dot ucdavis.edu
2014-08-21  8:22 ` [Bug rtl-optimization/62208] " rguenth at gcc dot gnu.org
2014-08-22  0:45 ` su at cs dot ucdavis.edu
2014-08-22  4:31 ` ubizjak at gmail dot com
2014-08-26 11:06 ` [Bug rtl-optimization/62208] ICE with -fwhole-program " rguenth at gcc dot gnu.org
2014-08-26 11:06 ` [Bug rtl-optimization/62208] [5 Regression] " rguenth at gcc dot gnu.org
2014-09-04 20:30 ` rsandifo at gcc dot gnu.org
2014-09-07  8:55 ` rsandifo at gcc dot gnu.org
2014-09-07  8:56 ` rsandifo 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).