This is the mail archive of the
mailing list for the GCC project.
Re: Bypassing jump optimization
- To: Casper Hornstrup <chorns at users dot sourceforge dot net>
- Subject: Re: Bypassing jump optimization
- From: Geoff Keating <geoffk at geoffk dot org>
- Date: 12 Oct 2001 14:43:41 -0700
- CC: gcc at gcc dot gnu dot org
- References: <email@example.com>
Casper Hornstrup <firstname.lastname@example.org> writes:
> I'm implementing structured exception handling in gcc. What is the correct
> way (if any exist) to bypass jump optimization on a range of insns?
> If I have gcc to generate code like this:
> <protected code>
> jmp after_exception_handler
> movl $0, %eax
> <exception handler code>
> then gcc optimizes all the code above away. This happens even if using the
> -O0 option to disable optimization.
> If I use LABEL_PRESERVE_P(<label>) = 1 on all labels, then the labels are
> preserved, but the code is still removed.
> I'm using gcc-3.0-release.
The correct way is to make the uses of exception_filter visible to
GCC's backend, if there are any uses; if there aren't, of course this
optimisation is correct.
I'm not sure what you're doing, but you should know that questions
like this one often indicate that a completely wrong approach is being
- Geoffrey Keating <email@example.com>