public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/54511] New: internal compiler error: in make_decl_rtl, at varasm.c:1147
@ 2012-09-06 22:57 justdanpo at gmail dot com
  2012-09-07  5:53 ` [Bug c++/54511] " daniel.kruegler at googlemail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: justdanpo at gmail dot com @ 2012-09-06 22:57 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 54511
           Summary: internal compiler error: in make_decl_rtl, at
                    varasm.c:1147
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: justdanpo@gmail.com


---hardwarecfg.cpp---
#include <stdint.h>

template <int i=0>
class SPI
{
public:
    SPI(uint32_t maxfreq)
    {
        union
        {
            int a;
            int b;
        };
        a=0;
    }
};

SPI<> spi(25000000);
---end-of-file---

Command line:
arm-none-eabi-g++.exe hardwarecfg.cpp -save-temps

Compiler output:
hardwarecfg.cpp: In constructor 'SPI<i>::SPI(uint32_t) [with int i = 0;
uint32_t = long unsigned int]':
hardwarecfg.cpp:14:3: internal compiler error: in make_decl_rtl, at
varasm.c:1147

Software versions:
GCC 4.7.1, YAGARTO GNU ARM toolchain
(http://sourceforge.net/projects/yagarto/files/YAGARTO%20for%20Windows/20120616/)
Windows XP SP3 (x86)


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

* [Bug c++/54511] internal compiler error: in make_decl_rtl, at varasm.c:1147
  2012-09-06 22:57 [Bug c++/54511] New: internal compiler error: in make_decl_rtl, at varasm.c:1147 justdanpo at gmail dot com
@ 2012-09-07  5:53 ` daniel.kruegler at googlemail dot com
  2012-09-07  8:03 ` jakub at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2012-09-07  5:53 UTC (permalink / raw)
  To: gcc-bugs

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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler at
                   |                            |googlemail dot com

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2012-09-07 05:52:51 UTC ---
I can confirm the problem for gcc 4.8.0 20120819 (experimental). I reduced the
example to get rid of some "magic" values, which are not relevant to be
present. One important requirement for reproducing the ICE is that A is a
template. 

template <class>
struct A
{
  A() {
    union
    {
      int a;
    };
    a = 0;
  }
};

A<int> a;

The error I'm getting compiled with 

-Wall -pedantic -std=c++11

is:

"|In constructor 'A< <template-parameter-1-1> >::A() [with
<template-parameter-1-1> = int]':|
10|internal compiler error: in make_decl_rtl, at varasm.c:1143|"


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

* [Bug c++/54511] internal compiler error: in make_decl_rtl, at varasm.c:1147
  2012-09-06 22:57 [Bug c++/54511] New: internal compiler error: in make_decl_rtl, at varasm.c:1147 justdanpo at gmail dot com
  2012-09-07  5:53 ` [Bug c++/54511] " daniel.kruegler at googlemail dot com
@ 2012-09-07  8:03 ` jakub at gcc dot gnu.org
  2012-09-07  8:19 ` [Bug c++/54511] [4.6/4.7/4.8 Regression] " rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-09-07  8:03 UTC (permalink / raw)
  To: gcc-bugs

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

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> 2012-09-07 08:03:22 UTC ---
template <int i>
struct S
{
  S () { union { int a; }; a = 0; }
};
S<0> s;

Somehow the decl in the assignment isn't getting remapped during clone_body.


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

* [Bug c++/54511] [4.6/4.7/4.8 Regression] internal compiler error: in make_decl_rtl, at varasm.c:1147
  2012-09-06 22:57 [Bug c++/54511] New: internal compiler error: in make_decl_rtl, at varasm.c:1147 justdanpo at gmail dot com
  2012-09-07  5:53 ` [Bug c++/54511] " daniel.kruegler at googlemail dot com
  2012-09-07  8:03 ` jakub at gcc dot gnu.org
@ 2012-09-07  8:19 ` rguenth at gcc dot gnu.org
  2012-09-07  8:22 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-09-07  8:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
      Known to work|                            |4.4.7
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|                            |2012-09-07
     Ever Confirmed|0                           |1
            Summary|internal compiler error: in |[4.6/4.7/4.8 Regression]
                   |make_decl_rtl, at           |internal compiler error: in
                   |varasm.c:1147               |make_decl_rtl, at
                   |                            |varasm.c:1147
   Target Milestone|---                         |4.6.4
      Known to fail|                            |4.5.4

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-07 08:19:16 UTC ---
Confirmed.


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

* [Bug c++/54511] [4.6/4.7/4.8 Regression] internal compiler error: in make_decl_rtl, at varasm.c:1147
  2012-09-06 22:57 [Bug c++/54511] New: internal compiler error: in make_decl_rtl, at varasm.c:1147 justdanpo at gmail dot com
                   ` (2 preceding siblings ...)
  2012-09-07  8:19 ` [Bug c++/54511] [4.6/4.7/4.8 Regression] " rguenth at gcc dot gnu.org
@ 2012-09-07  8:22 ` jakub at gcc dot gnu.org
  2012-09-07  9:05 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-09-07  8:22 UTC (permalink / raw)
  To: gcc-bugs

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

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

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


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

* [Bug c++/54511] [4.6/4.7/4.8 Regression] internal compiler error: in make_decl_rtl, at varasm.c:1147
  2012-09-06 22:57 [Bug c++/54511] New: internal compiler error: in make_decl_rtl, at varasm.c:1147 justdanpo at gmail dot com
                   ` (3 preceding siblings ...)
  2012-09-07  8:22 ` jakub at gcc dot gnu.org
@ 2012-09-07  9:05 ` jakub at gcc dot gnu.org
  2012-09-07 10:53 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-09-07  9:05 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-09-07 09:05:18 UTC ---
Seems the bug is on the C++ FE side, we have different a VAR_DECLs.  One is
created by finish_anon_union -> build_anon_union_vars during tsubst_expr, but
when tsubsting the a = 0; assignment that VAR_DECL is copied to a new VAR_DECL
by tsubst_decl.
Apparently build_anon_union_vars is called twice, once during parsing, once
during instantiation, but all the pushdecls the second time look really weird
and don't affect what VAR_DECLs the following code actually uses.
I would expect that during tsubst either build_anon_union_vars isn't called at
all and instead pt.c somehow adjusts when needed the VAR_DECLs that were
already created (after tsubst_decling them), or create a new set of vars, but
somehow arrange those to be registered as the local specializations of the old
vars.

Jason, could you please look at this?  Thanks.


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

* [Bug c++/54511] [4.6/4.7/4.8 Regression] internal compiler error: in make_decl_rtl, at varasm.c:1147
  2012-09-06 22:57 [Bug c++/54511] New: internal compiler error: in make_decl_rtl, at varasm.c:1147 justdanpo at gmail dot com
                   ` (4 preceding siblings ...)
  2012-09-07  9:05 ` jakub at gcc dot gnu.org
@ 2012-09-07 10:53 ` rguenth at gcc dot gnu.org
  2012-09-13 15:13 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-09-07 10:53 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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

* [Bug c++/54511] [4.6/4.7/4.8 Regression] internal compiler error: in make_decl_rtl, at varasm.c:1147
  2012-09-06 22:57 [Bug c++/54511] New: internal compiler error: in make_decl_rtl, at varasm.c:1147 justdanpo at gmail dot com
                   ` (5 preceding siblings ...)
  2012-09-07 10:53 ` rguenth at gcc dot gnu.org
@ 2012-09-13 15:13 ` jason at gcc dot gnu.org
  2012-09-13 15:14 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu.org @ 2012-09-13 15:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2012-09-13 15:13:23 UTC ---
Author: jason
Date: Thu Sep 13 15:13:08 2012
New Revision: 191260

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191260
Log:
    PR c++/54511
    * pt.c (tsubst_decl) [VAR_DECL]: Handle DECL_ANON_UNION_VAR_P.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/template/anonunion2.C
Modified:
    branches/gcc-4_6-branch/gcc/cp/ChangeLog
    branches/gcc-4_6-branch/gcc/cp/pt.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


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

* [Bug c++/54511] [4.6/4.7/4.8 Regression] internal compiler error: in make_decl_rtl, at varasm.c:1147
  2012-09-06 22:57 [Bug c++/54511] New: internal compiler error: in make_decl_rtl, at varasm.c:1147 justdanpo at gmail dot com
                   ` (6 preceding siblings ...)
  2012-09-13 15:13 ` jason at gcc dot gnu.org
@ 2012-09-13 15:14 ` jason at gcc dot gnu.org
  2012-09-13 15:15 ` jason at gcc dot gnu.org
  2012-09-13 15:29 ` jason at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu.org @ 2012-09-13 15:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2012-09-13 15:13:23 UTC ---
Author: jason
Date: Thu Sep 13 15:13:08 2012
New Revision: 191260

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191260
Log:
    PR c++/54511
    * pt.c (tsubst_decl) [VAR_DECL]: Handle DECL_ANON_UNION_VAR_P.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/template/anonunion2.C
Modified:
    branches/gcc-4_6-branch/gcc/cp/ChangeLog
    branches/gcc-4_6-branch/gcc/cp/pt.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2012-09-13 15:14:03 UTC ---
Author: jason
Date: Thu Sep 13 15:13:45 2012
New Revision: 191262

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191262
Log:
    PR c++/54511
    * pt.c (tsubst_decl) [VAR_DECL]: Handle DECL_ANON_UNION_VAR_P.

Added:
    trunk/gcc/testsuite/g++.dg/template/anonunion2.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/54511] [4.6/4.7/4.8 Regression] internal compiler error: in make_decl_rtl, at varasm.c:1147
  2012-09-06 22:57 [Bug c++/54511] New: internal compiler error: in make_decl_rtl, at varasm.c:1147 justdanpo at gmail dot com
                   ` (7 preceding siblings ...)
  2012-09-13 15:14 ` jason at gcc dot gnu.org
@ 2012-09-13 15:15 ` jason at gcc dot gnu.org
  2012-09-13 15:29 ` jason at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu.org @ 2012-09-13 15:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2012-09-13 15:14:03 UTC ---
Author: jason
Date: Thu Sep 13 15:13:45 2012
New Revision: 191262

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191262
Log:
    PR c++/54511
    * pt.c (tsubst_decl) [VAR_DECL]: Handle DECL_ANON_UNION_VAR_P.

Added:
    trunk/gcc/testsuite/g++.dg/template/anonunion2.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog

--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> 2012-09-13 15:15:06 UTC ---
Author: jason
Date: Thu Sep 13 15:14:49 2012
New Revision: 191265

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191265
Log:
    PR c++/54511
    * pt.c (tsubst_decl) [VAR_DECL]: Handle DECL_ANON_UNION_VAR_P.

Added:
    branches/gcc-4_7-branch/gcc/testsuite/g++.dg/template/anonunion2.C
Modified:
    branches/gcc-4_7-branch/gcc/cp/ChangeLog
    branches/gcc-4_7-branch/gcc/cp/pt.c
    branches/gcc-4_7-branch/gcc/testsuite/ChangeLog


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

* [Bug c++/54511] [4.6/4.7/4.8 Regression] internal compiler error: in make_decl_rtl, at varasm.c:1147
  2012-09-06 22:57 [Bug c++/54511] New: internal compiler error: in make_decl_rtl, at varasm.c:1147 justdanpo at gmail dot com
                   ` (8 preceding siblings ...)
  2012-09-13 15:15 ` jason at gcc dot gnu.org
@ 2012-09-13 15:29 ` jason at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu.org @ 2012-09-13 15:29 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

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

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2012-09-13 15:14:03 UTC ---
Author: jason
Date: Thu Sep 13 15:13:45 2012
New Revision: 191262

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191262
Log:
    PR c++/54511
    * pt.c (tsubst_decl) [VAR_DECL]: Handle DECL_ANON_UNION_VAR_P.

Added:
    trunk/gcc/testsuite/g++.dg/template/anonunion2.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog

--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> 2012-09-13 15:15:06 UTC ---
Author: jason
Date: Thu Sep 13 15:14:49 2012
New Revision: 191265

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191265
Log:
    PR c++/54511
    * pt.c (tsubst_decl) [VAR_DECL]: Handle DECL_ANON_UNION_VAR_P.

Added:
    branches/gcc-4_7-branch/gcc/testsuite/g++.dg/template/anonunion2.C
Modified:
    branches/gcc-4_7-branch/gcc/cp/ChangeLog
    branches/gcc-4_7-branch/gcc/cp/pt.c
    branches/gcc-4_7-branch/gcc/testsuite/ChangeLog

--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> 2012-09-13 15:29:12 UTC ---
Fixed for 4.6.4.


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

end of thread, other threads:[~2012-09-13 15:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-06 22:57 [Bug c++/54511] New: internal compiler error: in make_decl_rtl, at varasm.c:1147 justdanpo at gmail dot com
2012-09-07  5:53 ` [Bug c++/54511] " daniel.kruegler at googlemail dot com
2012-09-07  8:03 ` jakub at gcc dot gnu.org
2012-09-07  8:19 ` [Bug c++/54511] [4.6/4.7/4.8 Regression] " rguenth at gcc dot gnu.org
2012-09-07  8:22 ` jakub at gcc dot gnu.org
2012-09-07  9:05 ` jakub at gcc dot gnu.org
2012-09-07 10:53 ` rguenth at gcc dot gnu.org
2012-09-13 15:13 ` jason at gcc dot gnu.org
2012-09-13 15:14 ` jason at gcc dot gnu.org
2012-09-13 15:15 ` jason at gcc dot gnu.org
2012-09-13 15:29 ` jason 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).