Thread View: gnu.g++.bug
1 messages
1 total messages
Started by Mark W. Eichin
Thu, 30 Nov 1989 03:25
G++ 1.36.1, Sun4-os4, more (or same?) builtin_saveregs lossage
Author: Mark W. Eichin
Date: Thu, 30 Nov 1989 03:25
Date: Thu, 30 Nov 1989 03:25
60 lines
2103 bytes
2103 bytes
// The following code under all options should print 111 222 333.
// Under g++ 1.36.1 sun4-os4, I get f7fffe08 111 222.
// If I punt the body of bam::bam (so that it doesn't actually use
// builtin_saveregs, ie. va_start) it works fine. Also, if I change
// bar::bar from taking a loseme& to a loseme (copy instead of ref)
// it also works.
// THE TRICKY PART: this goes right into the expand_builtin code that
// I reported earlier as not working at all (expr.c, line 3511, is the
// start of an infinite loop.) And in fact, this is derived from a
// case which triggered the loop... so the error reported above occurs
// in code generated from a *GCC* 1.36 expand_builtin (ie. I took out
// the part that was obviously broken.)
// SO: can anyone tell me either (1) is there a patch to 1.36.1 that
// will solve the original looping problem (2) does this problem go
// away under 1.36.2 (3) what exactly was that loop *trying* to do, so
// maybe I can fix it?
// Mark Eichin <eichin@athena.mit.edu>
class loseme {
public:
void *a;
void *b;
void *c;
loseme(void*aa,void*bb,void*cc) { a=aa; b=bb; c=cc; };
};
class foo {
public:
foo(loseme);
};
foo::foo(loseme lm) {
printf("%x %x %x\n",lm.a,lm.b,lm.c);
};
class bar:public foo {
public:
bar(loseme&);
};
bar::bar(loseme& lm):(lm) { }
#include <stdarg.h>
class bam:public bar {
public:
bam(loseme,...);
};
bam::bam(loseme lm, ...):(lm) {
va_list ap;
va_start(ap,lm);
va_end(ap);
}
int main(int,char**) {
bam(loseme((void*)0x111,(void*)0x222,(void*)0x333));
}
// end of code
Mark Eichin <eichin@athena.mit.edu>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads