This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Dead code elimination problem?
- To: gcc-patches at gcc dot gnu dot org
- Subject: Dead code elimination problem?
- From: Peter Nenzén <di7petn at cse dot kau dot se>
- Date: Wed, 10 May 2000 08:46:22 +0200
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];
}
*************************************