public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/59166] New: ICE in simplify_subreg, at simplify-rtx.c:5901 on valid code (at -O1 and above with -g enabled)
@ 2013-11-18  7:40 su at cs dot ucdavis.edu
  2013-11-18 11:31 ` [Bug rtl-optimization/59166] [4.9 Regression] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: su at cs dot ucdavis.edu @ 2013-11-18  7:40 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59166

            Bug ID: 59166
           Summary: ICE in simplify_subreg, at simplify-rtx.c:5901 on
                    valid code (at -O1 and above with -g enabled)
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-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
-O1 and above with -g enabled (except -Os in 64-bit mode) on x86_64-linux-gnu.

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/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure
--enable-languages=c,c++,objc,obj-c++,fortran,lto --disable-werror
--with-gmp=/usr/local/gcc-trunk --with-mpfr=/usr/local/gcc-trunk
--with-mpc=/usr/local/gcc-trunk --with-cloog=/usr/local/gcc-trunk
--prefix=/usr/local/gcc-trunk
Thread model: posix
gcc version 4.9.0 20131117 (experimental) [trunk revision 204923] (GCC) 
$ 
$ gcc-trunk -O0 -g small.c; a.out
$ gcc-trunk -O1 small.c; a.out
$ gcc-4.8.2 -O1 -g small.c; a.out
$ 
$ gcc-trunk -O1 -g small.c    
small.c: In function ‘fn1’:
small.c:26:1: internal compiler error: in simplify_subreg, at
simplify-rtx.c:5901
 }
 ^
0x98caf6 simplify_subreg(machine_mode, rtx_def*, machine_mode, unsigned int)
    ../../gcc-trunk/gcc/simplify-rtx.c:5900
0x98cc1d simplify_gen_subreg
    ../../gcc-trunk/gcc/simplify-rtx.c:6121
0xbf2fba vt_expand_loc_callback
    ../../gcc-trunk/gcc/var-tracking.c:8328
0x6a5575 cselib_expand_value_rtx_1
    ../../gcc-trunk/gcc/cselib.c:1649
0x6a698e cselib_expand_value_rtx_cb(rtx_def*, bitmap_head_def*, int, rtx_def*
(*)(rtx_def*, bitmap_head_def*, int, void*), void*)
    ../../gcc-trunk/gcc/cselib.c:1531
0xbf0837 vt_expand_var_loc_chain
    ../../gcc-trunk/gcc/var-tracking.c:8223
0xbf32fa vt_expand_loc_callback
    ../../gcc-trunk/gcc/var-tracking.c:8385
0x6a565b cselib_expand_value_rtx_1
    ../../gcc-trunk/gcc/cselib.c:1684
0x6a698e cselib_expand_value_rtx_cb(rtx_def*, bitmap_head_def*, int, rtx_def*
(*)(rtx_def*, bitmap_head_def*, int, void*), void*)
    ../../gcc-trunk/gcc/cselib.c:1531
0xbf0837 vt_expand_var_loc_chain
    ../../gcc-trunk/gcc/var-tracking.c:8223
0xbf152f vt_expand_1pvar
    ../../gcc-trunk/gcc/var-tracking.c:8498
0xbf152f emit_note_insn_var_location(variable_def**, emit_note_data_def*)
    ../../gcc-trunk/gcc/var-tracking.c:8552
0xbfc35e traverse_noresize<emit_note_data_def*, emit_note_insn_var_location>
    ../../gcc-trunk/gcc/hash-table.h:928
0xbfc35e traverse<emit_note_data_def*, emit_note_insn_var_location>
    ../../gcc-trunk/gcc/hash-table.h:950
0xbfc35e emit_notes_for_changes
    ../../gcc-trunk/gcc/var-tracking.c:8914
0xbfd09e emit_notes_in_bb
    ../../gcc-trunk/gcc/var-tracking.c:9345
0xbfd09e vt_emit_notes
    ../../gcc-trunk/gcc/var-tracking.c:9408
0xbfda4f variable_tracking_main_1
    ../../gcc-trunk/gcc/var-tracking.c:10206
0xbfda4f variable_tracking_main()
    ../../gcc-trunk/gcc/var-tracking.c:10220
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, f, g;

void
fn2 ()
{
  for (; b; b++)
    for (; f; f = g)
      for (; a;)
    ;
}

static int
fn1 (int p)
{
  short d;
  if (c)
    {
      for (; f; f = g);
      fn2 ();
      d = p;
      char e = d;
      if (p)
    return 1;
    }
  return p;
}

int
main ()
{
  fn1 (0);
  fn1 (g);
  return 0;
}
>From gcc-bugs-return-434833-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Nov 18 07:47:20 2013
Return-Path: <gcc-bugs-return-434833-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 5291 invoked by alias); 18 Nov 2013 07:47:19 -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 5228 invoked by uid 48); 18 Nov 2013 07:47:10 -0000
From: "yves.caniou@ens-lyon.fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug bootstrap/55915] fails to build lto-compress.c, zlib.h not found
Date: Mon, 18 Nov 2013 07:47:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: bootstrap
X-Bugzilla-Version: 4.8.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: yves.caniou@ens-lyon.fr
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: cc
Message-ID: <bug-55915-4-FEI7d9VpnL@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-55915-4@http.gcc.gnu.org/bugzilla/>
References: <bug-55915-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: 2013-11/txt/msg01610.txt.bz2
Content-length: 3960

http://gcc.gnu.org/bugzilla/show_bug.cgi?idU915

Yves Caniou <yves.caniou@ens-lyon.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yves.caniou@ens-lyon.fr

--- Comment #3 from Yves Caniou <yves.caniou@ens-lyon.fr> ---
I have the same problem when compiling gcc-4.8.2 with gcc version 4.6.3
(Ubuntu/Linaro 4.6.3-1ubuntu5) on Xeon(R) CPU W3670  @ 3.20GHz
Note that with the exact same process, I have been able to compile gcc-4.8.2
with gcc 4.7.2 (debian).

I use gmp-5.1.3, mpfr-3.1.2, mpc-1.0.1. They are not intree.
Once compiled, their respective prefix/lib are added to LD_LIBRARY_PATH.
Gcc source is copied local disk, so no NFS or such.
I call:
/tmp/YC/gcc/src-4.8.2/configure --host=x86_64-linux-gnu
--build=x86_64-linux-gnu --prefix=/home/ycaniou/bin/amd64/4.6.3/gcc
--disable-altivec --disable-fixed-point --without-cloog --without-ppl
--disable-lto --enable-nls --without-included-gettext --with-system-zlib
--enable-obsolete --disable-werror --enable-secureplt --disable-multilib
--enable-libmudflap --disable-libssp --enable-libgomp --enable-checking=release
--disable-libgcj --enable-libstdcxx-time --enable-languages=c,c++,fortran
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-clocale=gnu --enable-targets=all
--with-gmp=/home/ycaniou/bin/amd64/4.6.3/gmp
--with-mpfr=/home/ycaniou/bin/amd64/4.6.3/mpfr
--with-mpc=/home/ycaniou/bin/amd64/4.6.3/mpc

Calling "make -j 12" ends with:
[...]
x86_64-linux-gnu-g++ -c   -g -DIN_GCC   -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual
-Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I. -I/tmp/YC/gcc/src-4.8.2/gcc
-I/tmp/YC/gcc/src-4.8.2/gcc/. -I/tmp/YC/gcc/src-4.8.2/gcc/../include
-I/tmp/YC/gcc/src-4.8.2/gcc/../libcpp/include
-I/home/ycaniou/bin/amd64/4.6.3/gmp/include
-I/home/ycaniou/bin/amd64/4.6.3/mpfr/include
-I/home/ycaniou/bin/amd64/4.6.3/mpc/include
-I/tmp/YC/gcc/src-4.8.2/gcc/../libdecnumber
-I/tmp/YC/gcc/src-4.8.2/gcc/../libdecnumber/bid -I../libdecnumber
-I/tmp/YC/gcc/src-4.8.2/gcc/../libbacktrace
/tmp/YC/gcc/src-4.8.2/gcc/lto-compress.c -o lto-compress.o
/tmp/YC/gcc/src-4.8.2/gcc/lto-compress.c:28:18: fatal error: zlib.h: No such
file or directory
compilation terminated.
x86_64-linux-gnu-g++ -c   -g -DIN_GCC   -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual
-Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I. -I/tmp/YC/gcc/src-4.8.2/gcc
-I/tmp/YC/gcc/src-4.8.2/gcc/. -I/tmp/YC/gcc/src-4.8.2/gcc/../include
-I/tmp/YC/gcc/src-4.8.2/gcc/../libcpp/include
-I/home/ycaniou/bin/amd64/4.6.3/gmp/include
-I/home/ycaniou/bin/amd64/4.6.3/mpfr/include
-I/home/ycaniou/bin/amd64/4.6.3/mpc/include
-I/tmp/YC/gcc/src-4.8.2/gcc/../libdecnumber
-I/tmp/YC/gcc/src-4.8.2/gcc/../libdecnumber/bid -I../libdecnumber
-I/tmp/YC/gcc/src-4.8.2/gcc/../libbacktrace    /tmp/YC/gcc/src-4.8.2/gcc/mcf.c
-o mcf.o
x86_64-linux-gnu-g++ -c   -g -DIN_GCC   -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual
-Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I. -I/tmp/YC/gcc/src-4.8.2/gcc
-I/tmp/YC/gcc/src-4.8.2/gcc/. -I/tmp/YC/gcc/src-4.8.2/gcc/../include
-I/tmp/YC/gcc/src-4.8.2/gcc/../libcpp/include
-I/home/ycaniou/bin/amd64/4.6.3/gmp/include
-I/home/ycaniou/bin/amd64/4.6.3/mpfr/include
-I/home/ycaniou/bin/amd64/4.6.3/mpc/include
-I/tmp/YC/gcc/src-4.8.2/gcc/../libdecnumber
-I/tmp/YC/gcc/src-4.8.2/gcc/../libdecnumber/bid -I../libdecnumber
-I/tmp/YC/gcc/src-4.8.2/gcc/../libbacktrace
/tmp/YC/gcc/src-4.8.2/gcc/mode-switching.c -o mode-switching.o
make[3]: *** [lto-compress.o] Error 1


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

* [Bug rtl-optimization/59166] [4.9 Regression] ICE in simplify_subreg, at simplify-rtx.c:5901 on valid code (at -O1 and above with -g enabled)
  2013-11-18  7:40 [Bug rtl-optimization/59166] New: ICE in simplify_subreg, at simplify-rtx.c:5901 on valid code (at -O1 and above with -g enabled) su at cs dot ucdavis.edu
@ 2013-11-18 11:31 ` rguenth at gcc dot gnu.org
  2013-11-26 11:31 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-11-18 11:31 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59166

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |x86_64-*-*
           Priority|P3                          |P1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-11-18
   Target Milestone|---                         |4.9.0
            Summary|ICE in simplify_subreg, at  |[4.9 Regression] ICE in
                   |simplify-rtx.c:5901 on      |simplify_subreg, at
                   |valid code (at -O1 and      |simplify-rtx.c:5901 on
                   |above with -g enabled)      |valid code (at -O1 and
                   |                            |above with -g enabled)
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.


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

* [Bug rtl-optimization/59166] [4.9 Regression] ICE in simplify_subreg, at simplify-rtx.c:5901 on valid code (at -O1 and above with -g enabled)
  2013-11-18  7:40 [Bug rtl-optimization/59166] New: ICE in simplify_subreg, at simplify-rtx.c:5901 on valid code (at -O1 and above with -g enabled) su at cs dot ucdavis.edu
  2013-11-18 11:31 ` [Bug rtl-optimization/59166] [4.9 Regression] " rguenth at gcc dot gnu.org
@ 2013-11-26 11:31 ` jakub at gcc dot gnu.org
  2013-11-26 11:35 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-11-26 11:31 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59166

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r204698.


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

* [Bug rtl-optimization/59166] [4.9 Regression] ICE in simplify_subreg, at simplify-rtx.c:5901 on valid code (at -O1 and above with -g enabled)
  2013-11-18  7:40 [Bug rtl-optimization/59166] New: ICE in simplify_subreg, at simplify-rtx.c:5901 on valid code (at -O1 and above with -g enabled) su at cs dot ucdavis.edu
  2013-11-18 11:31 ` [Bug rtl-optimization/59166] [4.9 Regression] " rguenth at gcc dot gnu.org
  2013-11-26 11:31 ` jakub at gcc dot gnu.org
@ 2013-11-26 11:35 ` jakub at gcc dot gnu.org
  2013-11-26 11:55 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-11-26 11:35 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59166

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
In *.asmcons we still have correct:
(debug_insn 30 29 31 7 (var_location:HI D#1 (subreg:HI (reg/v:SI 93 [ p ]) 0))
pr59166.c:20 -1
     (nil))
but in *.ira we have:
(debug_insn 30 29 31 7 (var_location:HI D#1 (reg/v:SI 97 [orig:93 p ] [93]))
pr59166.c:20 -1
     (nil))
(note the wrong mode).


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

* [Bug rtl-optimization/59166] [4.9 Regression] ICE in simplify_subreg, at simplify-rtx.c:5901 on valid code (at -O1 and above with -g enabled)
  2013-11-18  7:40 [Bug rtl-optimization/59166] New: ICE in simplify_subreg, at simplify-rtx.c:5901 on valid code (at -O1 and above with -g enabled) su at cs dot ucdavis.edu
                   ` (2 preceding siblings ...)
  2013-11-26 11:35 ` jakub at gcc dot gnu.org
@ 2013-11-26 11:55 ` jakub at gcc dot gnu.org
  2013-11-26 20:54 ` jakub at gcc dot gnu.org
  2013-11-26 20:58 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-11-26 11:55 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59166

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

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 31297
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31297&action=edit
gcc49-pr59166.patch

Untested fix.


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

* [Bug rtl-optimization/59166] [4.9 Regression] ICE in simplify_subreg, at simplify-rtx.c:5901 on valid code (at -O1 and above with -g enabled)
  2013-11-18  7:40 [Bug rtl-optimization/59166] New: ICE in simplify_subreg, at simplify-rtx.c:5901 on valid code (at -O1 and above with -g enabled) su at cs dot ucdavis.edu
                   ` (3 preceding siblings ...)
  2013-11-26 11:55 ` jakub at gcc dot gnu.org
@ 2013-11-26 20:54 ` jakub at gcc dot gnu.org
  2013-11-26 20:58 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-11-26 20:54 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59166

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Tue Nov 26 20:54:37 2013
New Revision: 205413

URL: http://gcc.gnu.org/viewcvs?rev=205413&root=gcc&view=rev
Log:
    PR rtl-optimization/59166
    * ira.c (find_moveable_pseudos): Use DF_REF_REAL_LOC instead of
    DF_REF_LOC in validate_change call.
    (split_live_ranges_for_shrink_wrap): Likewise.

    * gcc.dg/torture/pr59166.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr59166.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ira.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug rtl-optimization/59166] [4.9 Regression] ICE in simplify_subreg, at simplify-rtx.c:5901 on valid code (at -O1 and above with -g enabled)
  2013-11-18  7:40 [Bug rtl-optimization/59166] New: ICE in simplify_subreg, at simplify-rtx.c:5901 on valid code (at -O1 and above with -g enabled) su at cs dot ucdavis.edu
                   ` (4 preceding siblings ...)
  2013-11-26 20:54 ` jakub at gcc dot gnu.org
@ 2013-11-26 20:58 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-11-26 20:58 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59166

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

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

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


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

end of thread, other threads:[~2013-11-26 20:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-18  7:40 [Bug rtl-optimization/59166] New: ICE in simplify_subreg, at simplify-rtx.c:5901 on valid code (at -O1 and above with -g enabled) su at cs dot ucdavis.edu
2013-11-18 11:31 ` [Bug rtl-optimization/59166] [4.9 Regression] " rguenth at gcc dot gnu.org
2013-11-26 11:31 ` jakub at gcc dot gnu.org
2013-11-26 11:35 ` jakub at gcc dot gnu.org
2013-11-26 11:55 ` jakub at gcc dot gnu.org
2013-11-26 20:54 ` jakub at gcc dot gnu.org
2013-11-26 20:58 ` 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).