public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58537] New: internal compiler error: in gen_rtx_SUBREG, at emit-rtl.c:776
@ 2013-09-25 21:34 cas43 at cs dot stanford.edu
  2021-07-24 23:53 ` [Bug debug/58537] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: cas43 at cs dot stanford.edu @ 2013-09-25 21:34 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 17333 bytes --]

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

            Bug ID: 58537
           Summary: internal compiler error: in gen_rtx_SUBREG, at
                    emit-rtl.c:776
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cas43 at cs dot stanford.edu

Created attachment 30898
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30898&action=edit
Program that triggers ICE

When compiling the attached program like this (all options except -c are
required):

g++ -c -march=nocona -O2 -funroll-loops -fno-signed-zeros -gdwarf-2  prog.cpp

I get this result

prog.cpp: In member function ‘SYMMETRIC_MATRIX<float> TORUS<T>::Hessian(const
TV&) const [with T = float; TORUS<T>::TV = VECTOR<float>]’:
prog.cpp:102:1: internal compiler error: in gen_rtx_SUBREG, at emit-rtl.c:776
 }
 ^
0x6d5fbb gen_rtx_SUBREG(machine_mode, rtx_def*, int)
    ../../s-4.8/gcc/emit-rtl.c:776
0xa15d2c dead_debug_insert_temp(dead_debug_local*, unsigned int, rtx_def*,
debug_temp_where)
    ../../s-4.8/gcc/valtrack.c:731
0xc04e9f dce_process_block
    ../../s-4.8/gcc/dce.c:995
0xc04e9f fast_dce
    ../../s-4.8/gcc/dce.c:1068
0xc05544 rest_of_handle_fast_dce
    ../../s-4.8/gcc/dce.c:1132
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.



compiler version:

Using built-in specs.
COLLECT_GCC=/home/craig/new-gcc/i-4.8/bin/g++
COLLECT_LTO_WRAPPER=/home/craig/new-gcc/i-4.8/libexec/gcc/x86_64-unknown-linux-gnu/4.8.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../s-4.8/configure --prefix=/home/craig/new-gcc/i-4.8
Thread model: posix
gcc version 4.8.2 20130925 (prerelease) (GCC) 



I get similar results with this version:

Using built-in specs.
COLLECT_GCC=/home/craig/new-gcc/i-trunk/bin/g++
COLLECT_LTO_WRAPPER=/home/craig/new-gcc/i-trunk/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../s-trunk/configure --prefix=/home/craig/new-gcc/i-trunk
Thread model: posix
gcc version 4.9.0 20130730 (experimental) (GCC) 


The program compiles cleanly with this version (even with -Wall):

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.6 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object
--enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686
--with-tune=generic --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) 

And it also builds cleanly with a fairly recent build of clang:

clang version 3.4 (trunk 187482)
Target: x86_64-unknown-linux-gnu
Thread model: posix
>From gcc-bugs-return-430569-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Sep 25 22:22:35 2013
Return-Path: <gcc-bugs-return-430569-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 31999 invoked by alias); 25 Sep 2013 22:22:34 -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 31968 invoked by uid 48); 25 Sep 2013 22:22:30 -0000
From: "d.frey at gmx dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/58538] New: Injected class-name treated as type-name instead of template-name when used as a template-argument for a template template-parameter
Date: Wed, 25 Sep 2013 22:22:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: d.frey at gmx dot de
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-58538-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: 2013-09/txt/msg01809.txt.bz2
Content-length: 1101

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

            Bug ID: 58538
           Summary: Injected class-name treated as type-name instead of
                    template-name when used as a template-argument for a
                    template template-parameter
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: d.frey at gmx dot de

The following program fail to compile.

  template<typename> struct A
  {
    template<template<typename> class B=A> void f();
  };
  int main(){}

with

main.cpp:3:39: error: invalid use of type ‘A< <template-parameter-1-1> >’ as a
default value for a template template-parameter

   template<template<typename> class B=A> void f();

on GCC 4.8.1. Me (and some other on SO, see
<http://http://stackoverflow.com/questions/19013071/>) think it's a bug due to
§14.6.1.

Work-around in case it helps to narrow down the bug: Replace B=A with B=::A
>From gcc-bugs-return-430570-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Sep 25 22:48:45 2013
Return-Path: <gcc-bugs-return-430570-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 16187 invoked by alias); 25 Sep 2013 22:48:45 -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 16144 invoked by uid 48); 25 Sep 2013 22:48:41 -0000
From: "su at cs dot ucdavis.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/58539] New: ICE with segfault at -O3 with -g enabled on x86_64-linux-gnu (affecting trunk, 4.8, and 4.7)
Date: Wed, 25 Sep 2013 22:48: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: 4.9.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-58539-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: 2013-09/txt/msg01810.txt.bz2
Content-length: 4226

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

            Bug ID: 58539
           Summary: ICE with segfault at -O3 with -g enabled on
                    x86_64-linux-gnu (affecting trunk, 4.8, and 4.7)
           Product: gcc
           Version: 4.9.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, 4.8,
and 4.7 at -O3 with -g enabled on x86_64-linux in both 32-bit and 64-bit modes. 

This is a regression from 4.6.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 --enable-checking=release
--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 20130925 (experimental) [trunk revision 202882] (GCC) 
$
$ 
$ gcc-trunk -O3 -c small.c
$ gcc-4.6 -O3 -g -c small.c
$
$ 
$ gcc-trunk -O3 -g -c small.c
small.c: In function ‘bar’:
small.c:10:6: internal compiler error: Segmentation fault
 void bar ()
      ^
0x8109ef crash_signal
    ../../gcc-trunk/gcc/toplev.c:335
0x4ced0d get_use_from_ptr
    ../../gcc-trunk/gcc/tree-flow-inline.h:370
0x4ced0d link_use_stmts_after
    ../../gcc-trunk/gcc/tree-flow-inline.h:982
0x4ced0d first_imm_use_stmt
    ../../gcc-trunk/gcc/tree-flow-inline.h:1034
0x95c6a0 vect_create_epilog_for_reduction
    ../../gcc-trunk/gcc/tree-vect-loop.c:4566
0x95c6a0 vectorizable_reduction(gimple_statement_d*, gimple_stmt_iterator_d*,
gimple_statement_d**, _slp_tree*)
    ../../gcc-trunk/gcc/tree-vect-loop.c:5281
0x94f584 vect_transform_stmt(gimple_statement_d*, gimple_stmt_iterator_d*,
bool*, _slp_tree*, _slp_instance*)
    ../../gcc-trunk/gcc/tree-vect-stmts.c:5988
0x953b00 vect_transform_loop(_loop_vec_info*)
    ../../gcc-trunk/gcc/tree-vect-loop.c:5859
0x96c457 vectorize_loops()
    ../../gcc-trunk/gcc/tree-vectorizer.c:367
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.8 -O3 -g -c small.c
small.c: In function ‘bar’:
small.c:10:6: internal compiler error: Segmentation fault
 void bar ()
      ^
0x7b925f crash_signal
    ../../gcc-4.8.1/gcc/toplev.c:332
0x8e1687 get_use_from_ptr
    ../../gcc-4.8.1/gcc/tree-flow-inline.h:370
0x8e1687 link_use_stmts_after
    ../../gcc-4.8.1/gcc/tree-flow-inline.h:982
0x8e1687 first_imm_use_stmt
    ../../gcc-4.8.1/gcc/tree-flow-inline.h:1034
0x8ecc18 vect_create_epilog_for_reduction
    ../../gcc-4.8.1/gcc/tree-vect-loop.c:4481
0x8ecc18 vectorizable_reduction(gimple_statement_d*, gimple_stmt_iterator*,
gimple_statement_d**, _slp_tree*)
    ../../gcc-4.8.1/gcc/tree-vect-loop.c:5196
0x8e1154 vect_transform_stmt(gimple_statement_d*, gimple_stmt_iterator*, bool*,
_slp_tree*, _slp_instance*)
    ../../gcc-4.8.1/gcc/tree-vect-stmts.c:5808
0x8e380f vect_transform_loop(_loop_vec_info*)
    ../../gcc-4.8.1/gcc/tree-vect-loop.c:5723
0x8faaea vectorize_loops()
    ../../gcc-4.8.1/gcc/tree-vectorizer.c:123
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.7 -O3 -g -c small.c
small.c: In function ‘bar’:
small.c:10:6: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
$  


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


int a, b;

extern void baz (int);

int foo (int p)
{
  return p ? p : 1;
}

void bar ()
{
  int *c = &a, *d = &a;
  for (b = 0; b < 12; b++)
    *d |= 1;
  foo (*c);
  baz (*c && 1);
}
>From gcc-bugs-return-430571-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Sep 26 00:00:21 2013
Return-Path: <gcc-bugs-return-430571-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 24235 invoked by alias); 26 Sep 2013 00:00:20 -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 24141 invoked by uid 48); 26 Sep 2013 00:00:16 -0000
From: "john.harper at vuw dot ac.nz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/55501] [F03] ICE using MERGE in constant expr
Date: Thu, 26 Sep 2013 00:00:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.7.2
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: john.harper at vuw dot ac.nz
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: janus at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-55501-4-p2TkMCI4jb@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-55501-4@http.gcc.gnu.org/bugzilla/>
References: <bug-55501-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-09/txt/msg01811.txt.bz2
Content-length: 2937

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

john.harper at vuw dot ac.nz changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |john.harper at vuw dot ac.nz

--- Comment #13 from john.harper at vuw dot ac.nz ---
ICE from using MERGE in a constant specification expression, not in this
program an initialization expression because it's an array bound, with gfortran
4.7.2.
I have tried to install later versions but without success so far.

cayley[~/Jfh] % cat testmerge3.f90
program testmerge3
  implicit none
  integer,parameter::iarray(merge(2,3,.true.)) = 1, i = size(iarray)
  print "(A,99I2)",'i,iarray =',i,iarray
end program testmerge3
cayley[~/Jfh] % gfortran -v testmerge3.f90
Driving: gfortran -v testmerge3.f90 -l gfortran -l m -shared-libgcc
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /build/src/gcc-4.7.2/configure --prefix=/usr --libdir=/usr/lib
--libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch
--enable-libstdcxx-time --enable-gnu-unique-object --enable-linker-build-id
--with-ppl --enable-cloog-backend=isl --disable-ppl-version-check
--disable-cloog-version-check --enable-lto --enable-gold --enable-ldÞfault
--enable-plugin --with-plugin-ld=ld.gold --with-linker-hash-style=gnu
--disable-multilib --disable-libssp --disable-build-with-cxx
--disable-build-poststage1-with-cxx --enable-checking=release
Thread model: posix
gcc version 4.7.2 (GCC)
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/f951 testmerge3.f90 -quiet
-dumpbase testmerge3.f90 -mtune=generic -march=x86-64 -auxbase testmerge3
-version -fintrinsic-modules-path
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/finclude -o /tmp/ccPFQJLT.s
GNU Fortran (GCC) version 4.7.2 (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.7.2, GMP version 5.1.0, MPFR version
3.1.1-p2, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand\x100 --param ggc-min-heapsize\x131072
GNU Fortran (GCC) version 4.7.2 (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.7.2, GMP version 5.1.0, MPFR version
3.1.1-p2, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand\x100 --param ggc-min-heapsize\x131072
f951: internal compiler error: in is_illegal_recursion, at
fortran/resolve.c:1420
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.archlinux.org/> for instructions.
cayley[~/Jfh] %


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

* [Bug debug/58537] internal compiler error: in gen_rtx_SUBREG, at emit-rtl.c:776
  2013-09-25 21:34 [Bug c++/58537] New: internal compiler error: in gen_rtx_SUBREG, at emit-rtl.c:776 cas43 at cs dot stanford.edu
@ 2021-07-24 23:53 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-24 23:53 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So this testcase is not reproducible in 4.9.0 and above but it was fully fixed
for GCC 5 with the patch which fixes PR65678.  So just marking as a dup of bug
65678.

*** This bug has been marked as a duplicate of bug 65678 ***

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

end of thread, other threads:[~2021-07-24 23:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-25 21:34 [Bug c++/58537] New: internal compiler error: in gen_rtx_SUBREG, at emit-rtl.c:776 cas43 at cs dot stanford.edu
2021-07-24 23:53 ` [Bug debug/58537] " pinskia 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).