Exception handler table entries lost

David Capshaw capshaw@metrowerks.com
Tue May 1 14:12:00 GMT 2001


This report relates to
  gcc version 2.95.3 20010315 (release)
and involves incorrect code being generated by the compiler.
My testing was on a Solaris/SPARC 2.5.1 system.


Exception handler table entries can be lost based on source
changes unrelated to the try/catch block.  The cause is the
freeing but continued reference to the exception handler label 
object.
 
Retained exception handler labels (see gen_exception_label)
should be permanent, but the ones generated during calls to
expand_inline_function end up on the maybepermanent obstack
and are freed by permanent_alloction.  The reference remains 
and a later call to remove_handler may or may not remove the 
handler depending on how the location was reused.
 
My quick-fix was to ensure that the generated exception labels 
are on the permanent obstack.  Perhaps when the expansion in
expand_inline_function is successful it should arrange to 
preserve the data on the maybepermanent obstack.



More information about the Gcc-bugs mailing list