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

Bypassing jump optimization


Hi.

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
exception_filter:
	movl $0, %eax
	ret
exception_handler:
	<exception handler code>
after_exception_handler:

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.

Casper Hornstrup


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