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]

Exception handler table entries lost


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.


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