This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Exception handler table entries lost
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Exception handler table entries lost
- From: David Capshaw <capshaw at metrowerks dot com>
- Date: Tue, 01 May 2001 16:11:53 -0500
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.