2.95.2 Internal compiler error on alpha (testcase included)
J.H.M. Dassen (Ray)
jdassen@cistron.nl
Sat Apr 1 06:00:00 GMT 2000
[This problem was reported via the Debian Bugtracking System
( http://bugs.debian.org ); please Cc: 55291@bugs.debian.org on on-topic
replies]
The following code triggers an internal compiler error with gcc 2.95.2 on
Alpha systems:
/*
$ gcc -v -c -O
Reading specs from /usr/lib/gcc-lib/alpha-linux/2.95.2/specs
gcc version 2.95.2 20000313 (Debian GNU/Linux)
Produces internal compiler error in find_basic_blocks_1', at flow.c:732.
The program evokes undefined behaviour by jumping over a nontrivial destructor,
so there is no need for the compiler to actually produce working code. Ideally
one would like to see a warning message instead.
The word "must" in the following code refers to things that are necessary in
order to reproduce the problem.
*/
int foo(); // (some operation that won't be optimized away)
struct MyString
{
MyString(int) {} // constructor must have at least one argument
~MyString() { foo(); } // destructor must be inline and nontrivial
};
void trigger()
{
while (1) // must be a real loop--`if' or `while (false)' doesn't fail
{
MyString text(0); // create object with nontrivial destructor
// conditionally skip past text.~MyString(): UNDEFINED BEHAVIOUR
if (foo()) goto finish;
foo(); // perform conditional operation, creating 2 realistic exit paths
}
finish:
{} // (not relevant)
} // (internal compiler error)
--
"When you are finished spreading joy on Christmas Eve, come and kick back
with me and Erwin for a while. [...] We'll provide the cocoa and cookies,
and we'll even teach you how to play Quake."
From the Dust Puppy's letter to Santa Claus.
More information about the Gcc-bugs
mailing list