This is the mail archive of the gcc-patches@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]

Dead code elimination problem?


Hi,

We have some problems with the code below. During compilation, gcc seams to
eliminate the rows after the return statement in each function. Is there
any way to avoid this? Is it a dead code elimination problem or is the
problem related to the tail call patches posted on this list mid March?

Is there any way to turn off the dead code elimination, like a flag or
something?
The target environment is sparc.

Would really appreciate some help with this, thanx in advance!

Peter

******************************
int x = 0;
void one();
void two();
void *array[2];

int main()
{
	one():
	two();
	goto *array[0];
}
void one()
{
	array[0] = &&onelabel;
	return;
	onelabel:
	printf("One %i\n",x++);
	goto *array[1];
}       
void two()
{
	array[1] = &&twolabel;
	return;
	twolabel:
	printf("Two %i\n",x++);
	goto *array[0];
} 
*************************************


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