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]

Re: Dead code elimination problem?


Peter Nenzén <di7petn@cse.kau.se> writes:

> 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!

To quote the gcc manual: 

     You can use this mechanism to jump to code in a different function.
  If you do that, totally unpredictable things will happen.  The best way
  to avoid this is to store the label address only in automatic variables
  and never pass it as an argument.

So don't do it. You have to use setjmp/longjmp to jump between functions.

-Andi

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