This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

1.0.3a: -O1 -fregmove internal compiler error (code sample)


Compiler: g++ [ gcc version egcs-2.90.29 980515 (egcs-1.0.3 release) ]
System: Debian GNU/Linux "hamm" on i386.

With the make.cpp file from Maelstrom 1.4.3-L2.0.6-6
(ftp://ftp.debian.org/debian/dists/frozen/non-free/source/games/maelstrom*),
compiled with
g++ -O1 -fregmove -fomit-frame-pointer -I.. -Inetlogic -I/usr/X11R6/include
-DNETPLAY -c make.cpp
or more optimisation (e.g. -O2), egcs fails with an internal compiler error.

Here's a stripped down version (courtesy of Richard Braakman
<dark@xs4all.nl>) which triggers the problem.

/\/\/\/\/\/\/\/\/\/\/\ CUT ME /\/\/\/\/\/\/\/\/\/\/\
class Object {
public:
        Object(int X, int Y, int Xvec, int Yvec, void *blit, int PhaseTime);
};

extern Object *gSprites[100 ];

class Multiplier : public Object {
public:
        Multiplier(int X, int Y, int Mult) :
                        Object(X, Y, 0, 0, 0, -1 ) {
        }
};

void MakeMultiplier(void)
{
        int     newsprite, x, y;
        x = FastRandom( 32 ) + 32 ;
        y = FastRandom( 32  - 14 ) + 32 ;
        x *= 16 ;
        y *= 16 ;
        newsprite = 0;
        gSprites[newsprite] = new Multiplier(x, y, FastRandom(4)+2);
        return;
}
/\/\/\/\/\/\/\/\/\/\/\ CUT ME /\/\/\/\/\/\/\/\/\/\/\

g++ -O1 -fregmove trigger.cc

trigger.cc: In function `void MakeMultiplier()':
trigger.cc:18: warning: implicit declaration of function `int
FastRandom(...)'
trigger.cc:25: Internal compiler error.
trigger.cc:25: Please submit a full bug report to `egcs-bugs@cygnus.com'.

Without -fregmove (g++ -O1 trigger.cc), everything works.

I cannot reproduce the problem with gcc version egcs-2.91.40 19980608 (gcc2
ss-980502 experimental).

Greetings,
-- 
Ray Dassen <jdassen@wi.LeidenUniv.nl>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]