public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/48446] New: internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946
@ 2011-04-05 3:54 headch at gmail dot com
2011-04-05 11:14 ` [Bug c++/48446] " rguenth at gcc dot gnu.org
` (12 more replies)
0 siblings, 13 replies; 14+ messages in thread
From: headch at gmail dot com @ 2011-04-05 3:54 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48446
Summary: internal compiler error: in gimplify_var_or_parm_decl,
at gimplify.c:1946
Product: gcc
Version: 4.4.5
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: headch@gmail.com
Created attachment 23878
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23878
The failing source file
I compile the attached file using this command:
$ g++ -std=gnu++0x -Wall -Wextra -c test.cpp
with this version of GCC:
$ gcc --version
gcc (Gentoo 4.4.5 p1.2, pie-0.4.5) 4.4.5
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
on Gentoo x86-64 and x86 (both produce identical error messages). I get this
output:
test.cpp: In member function ‘void Sender::flush()’:
test.cpp:168: internal compiler error: in gimplify_var_or_parm_decl, at
gimplify.c:1946
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.gentoo.org/> for instructions.
I also have access to an OpenSUSE x86-64 environment reading out this version:
$ gcc --version
gcc (SUSE Linux) 4.5.0 20100604 [gcc-4_5-branch revision 160292]
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This gives the following output:
test.cpp: In member function ‘void Sender::flush()’:
test.cpp:175:71: internal compiler error: in gimplify_var_or_parm_decl, at
gimplify.c:1816
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.opensuse.org/> for instructions.
(yes, the source line number of the error in test.cpp is different for this GCC
version even though the sources are identical).
Finally, a friend using Arch Linux x86-64 tested the same code on GCC 4.6 and
also reproduced the bug, though I don't have the line numbers from that test.
I can attach preprocessed source if you want, though the source doesn't use
anything but standard headers and the problem seems quite easily reproducible
as I already described.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/48446] internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946
2011-04-05 3:54 [Bug c++/48446] New: internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946 headch at gmail dot com
@ 2011-04-05 11:14 ` rguenth at gcc dot gnu.org
2011-04-05 11:23 ` redi at gcc dot gnu.org
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-04-05 11:14 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48446
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-valid-code
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.04.05 11:13:04
Ever Confirmed|0 |1
Known to fail| |4.3.5, 4.5.2, 4.6.0
--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-04-05 11:13:04 UTC ---
Confirmed. Seems to have always crashed. ICC accepts it.
Reduced testcase:
namespace std {
typedef long unsigned int size_t;
}
typedef unsigned char uint8_t;
template<typename T> class RefPtr {
public:
~RefPtr();
T *operator->() const;
};
class Message {
public:
typedef RefPtr<Message> Ptr;
static Ptr create(const void *data, std::size_t len);
};
template<std::size_t N> class BitArray {
public:
static const std::size_t byte_count = (N + 7) / 8;
};
class Recipient {
public:
typedef RefPtr<Recipient> Ptr;
BitArray<80> data;
};
class Sender {
Recipient::Ptr recipient(unsigned int i);
void flush();
};
void Sender::flush()
{
uint8_t buffer[64 / (recipient(0)->data.byte_count +
2)][recipient(0)->data.byte_count + 2];
std::size_t wptr = 0;
if (wptr == sizeof(buffer) / sizeof(*buffer)) {
Message::Ptr msg = Message::create(buffer, wptr * sizeof(buffer[0]));
}
}
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/48446] internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946
2011-04-05 3:54 [Bug c++/48446] New: internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946 headch at gmail dot com
2011-04-05 11:14 ` [Bug c++/48446] " rguenth at gcc dot gnu.org
@ 2011-04-05 11:23 ` redi at gcc dot gnu.org
2011-04-05 11:30 ` [Bug c++/48446] [4.3/4.4/4.5/4.6 Regression] " redi at gcc dot gnu.org
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: redi at gcc dot gnu.org @ 2011-04-05 11:23 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48446
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-04-05 11:21:35 UTC ---
slightly further reduced:
template<typename T> struct RefPtr {
~RefPtr();
T *operator->() const;
};
struct Message {
typedef RefPtr<Message> Ptr;
static Ptr create(int);
};
struct Recipient {
typedef RefPtr<Recipient> Ptr;
static const int byte_count = 80;
};
Recipient::Ptr recipient();
void flush()
{
char buffer[(recipient()->byte_count)];
{
Message::Ptr msg = Message::create(sizeof(buffer));
}
}
This is a regression as it compiles OK with GCC 4.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/48446] [4.3/4.4/4.5/4.6 Regression] internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946
2011-04-05 3:54 [Bug c++/48446] New: internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946 headch at gmail dot com
2011-04-05 11:14 ` [Bug c++/48446] " rguenth at gcc dot gnu.org
2011-04-05 11:23 ` redi at gcc dot gnu.org
@ 2011-04-05 11:30 ` redi at gcc dot gnu.org
2011-04-05 11:57 ` rguenth at gcc dot gnu.org
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: redi at gcc dot gnu.org @ 2011-04-05 11:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48446
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |3.4.3
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-04-05 11:28:17 UTC ---
(In reply to comment #2)
> This is a regression as it compiles OK with GCC 4.1
... and 3.4
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/48446] [4.3/4.4/4.5/4.6 Regression] internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946
2011-04-05 3:54 [Bug c++/48446] New: internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946 headch at gmail dot com
` (2 preceding siblings ...)
2011-04-05 11:30 ` [Bug c++/48446] [4.3/4.4/4.5/4.6 Regression] " redi at gcc dot gnu.org
@ 2011-04-05 11:57 ` rguenth at gcc dot gnu.org
2011-04-07 8:31 ` jakub at gcc dot gnu.org
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-04-05 11:57 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48446
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.3.6
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/48446] [4.3/4.4/4.5/4.6 Regression] internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946
2011-04-05 3:54 [Bug c++/48446] New: internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946 headch at gmail dot com
` (3 preceding siblings ...)
2011-04-05 11:57 ` rguenth at gcc dot gnu.org
@ 2011-04-07 8:31 ` jakub at gcc dot gnu.org
2011-04-07 8:36 ` jakub at gcc dot gnu.org
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-04-07 8:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48446
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-04-07 08:30:57 UTC ---
template<typename T>
struct A
{
~A ();
T *operator-> () const;
};
struct B
{
typedef A <B> P;
static P foo (int);
};
struct C
{
typedef A<C> P;
static const int c = 80;
};
C::P bar ();
void
baz ()
{
char z[bar ()->c];
{
B::P m = B::foo (sizeof (z));
}
}
Yeah, apparently some problem on the FE side with cleanups, where
CLEANUP_POINT_EXPR already for z is given the cleanups for m, which are in a
nested bind though and thus m wasn't seen in bind expr yet.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/48446] [4.3/4.4/4.5/4.6 Regression] internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946
2011-04-05 3:54 [Bug c++/48446] New: internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946 headch at gmail dot com
` (4 preceding siblings ...)
2011-04-07 8:31 ` jakub at gcc dot gnu.org
@ 2011-04-07 8:36 ` jakub at gcc dot gnu.org
2011-04-07 8:55 ` jakub at gcc dot gnu.org
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-04-07 8:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48446
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-04-07 08:36:41 UTC ---
Most likely caused by
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128979
(r128750 works, r129000 ICEs, am lazy to bisect it exactly).
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/48446] [4.3/4.4/4.5/4.6 Regression] internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946
2011-04-05 3:54 [Bug c++/48446] New: internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946 headch at gmail dot com
` (5 preceding siblings ...)
2011-04-07 8:36 ` jakub at gcc dot gnu.org
@ 2011-04-07 8:55 ` jakub at gcc dot gnu.org
2011-04-10 10:47 ` rguenth at gcc dot gnu.org
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-04-07 8:55 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48446
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-04-07 08:55:37 UTC ---
Actually now verified that it is r128979.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/48446] [4.3/4.4/4.5/4.6 Regression] internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946
2011-04-05 3:54 [Bug c++/48446] New: internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946 headch at gmail dot com
` (6 preceding siblings ...)
2011-04-07 8:55 ` jakub at gcc dot gnu.org
@ 2011-04-10 10:47 ` rguenth at gcc dot gnu.org
2011-04-14 15:00 ` jason at gcc dot gnu.org
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-04-10 10:47 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48446
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/48446] [4.3/4.4/4.5/4.6 Regression] internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946
2011-04-05 3:54 [Bug c++/48446] New: internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946 headch at gmail dot com
` (7 preceding siblings ...)
2011-04-10 10:47 ` rguenth at gcc dot gnu.org
@ 2011-04-14 15:00 ` jason at gcc dot gnu.org
2011-04-14 15:22 ` jason at gcc dot gnu.org
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu.org @ 2011-04-14 15:00 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48446
--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> 2011-04-14 15:00:03 UTC ---
Author: jason
Date: Thu Apr 14 14:59:58 2011
New Revision: 172432
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172432
Log:
PR c++/48446
* decl.c (compute_array_index_type): Use get_temp_regvar instead
of variable_size.
* init.c (get_temp_regvar): No longer static.
* cp-tree.h: Declare it.
Added:
trunk/gcc/testsuite/g++.dg/ext/vla10.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/cp/init.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/48446] [4.3/4.4/4.5/4.6 Regression] internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946
2011-04-05 3:54 [Bug c++/48446] New: internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946 headch at gmail dot com
` (8 preceding siblings ...)
2011-04-14 15:00 ` jason at gcc dot gnu.org
@ 2011-04-14 15:22 ` jason at gcc dot gnu.org
2011-05-02 18:42 ` jason at gcc dot gnu.org
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu.org @ 2011-04-14 15:22 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48446
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |4.7.0
--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> 2011-04-14 15:22:41 UTC ---
This is now fixed for 4.7.0. The fix seems reasonably safe to backport since
it only affects bounds expressions with side-effects, but it also seems easy to
work around in user code: just factor out the bounds expression into a local
variable.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/48446] [4.3/4.4/4.5/4.6 Regression] internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946
2011-04-05 3:54 [Bug c++/48446] New: internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946 headch at gmail dot com
` (9 preceding siblings ...)
2011-04-14 15:22 ` jason at gcc dot gnu.org
@ 2011-05-02 18:42 ` jason at gcc dot gnu.org
2011-05-06 22:03 ` jason at gcc dot gnu.org
2011-05-07 1:54 ` jason at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-02 18:42 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48446
--- Comment #9 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-02 18:38:49 UTC ---
Author: jason
Date: Mon May 2 18:38:44 2011
New Revision: 173264
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173264
Log:
PR c++/48446
* decl.c (stabilize_save_expr_r, stabilize_vla_size): New.
(compute_array_index_type): Revert earlier 48446 changes.
(grokdeclarator): Use stabilize_vla_size.
Added:
trunk/gcc/testsuite/c-c++-common/vla-1.c
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/48446] [4.3/4.4/4.5/4.6 Regression] internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946
2011-04-05 3:54 [Bug c++/48446] New: internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946 headch at gmail dot com
` (10 preceding siblings ...)
2011-05-02 18:42 ` jason at gcc dot gnu.org
@ 2011-05-06 22:03 ` jason at gcc dot gnu.org
2011-05-07 1:54 ` jason at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-06 22:03 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48446
--- Comment #10 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-06 21:58:32 UTC ---
Author: jason
Date: Fri May 6 21:58:30 2011
New Revision: 173514
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173514
Log:
PR c++/48446
* decl.c (stabilize_save_expr_r, stabilize_vla_size): New.
(grokdeclarator): Use stabilize_vla_size.
* init.c (get_temp_regvar): No longer static.
* cp-tree.h: Declare it.
Added:
branches/gcc-4_6-branch/gcc/testsuite/c-c++-common/vla-1.c
branches/gcc-4_6-branch/gcc/testsuite/g++.dg/ext/vla10.C
Modified:
branches/gcc-4_6-branch/gcc/cp/ChangeLog
branches/gcc-4_6-branch/gcc/cp/cp-tree.h
branches/gcc-4_6-branch/gcc/cp/decl.c
branches/gcc-4_6-branch/gcc/cp/init.c
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/48446] [4.3/4.4/4.5/4.6 Regression] internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946
2011-04-05 3:54 [Bug c++/48446] New: internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946 headch at gmail dot com
` (11 preceding siblings ...)
2011-05-06 22:03 ` jason at gcc dot gnu.org
@ 2011-05-07 1:54 ` jason at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-07 1:54 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48446
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
AssignedTo|unassigned at gcc dot |jason at gcc dot gnu.org
|gnu.org |
Target Milestone|4.3.6 |4.6.1
--- Comment #11 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-07 01:41:03 UTC ---
Fixed for 4.6.1.
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2011-05-07 1:54 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-05 3:54 [Bug c++/48446] New: internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1946 headch at gmail dot com
2011-04-05 11:14 ` [Bug c++/48446] " rguenth at gcc dot gnu.org
2011-04-05 11:23 ` redi at gcc dot gnu.org
2011-04-05 11:30 ` [Bug c++/48446] [4.3/4.4/4.5/4.6 Regression] " redi at gcc dot gnu.org
2011-04-05 11:57 ` rguenth at gcc dot gnu.org
2011-04-07 8:31 ` jakub at gcc dot gnu.org
2011-04-07 8:36 ` jakub at gcc dot gnu.org
2011-04-07 8:55 ` jakub at gcc dot gnu.org
2011-04-10 10:47 ` rguenth at gcc dot gnu.org
2011-04-14 15:00 ` jason at gcc dot gnu.org
2011-04-14 15:22 ` jason at gcc dot gnu.org
2011-05-02 18:42 ` jason at gcc dot gnu.org
2011-05-06 22:03 ` jason at gcc dot gnu.org
2011-05-07 1:54 ` 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).