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]
Other format: [Raw text]

[tree-ssa] C++ Question


I found this gem while debugging a C++ testsuite failure while working
on the CFG issues for C++.

C++ inlining can clobber "current_function_decl".

The inliner calls cp_cannot_inline_tree_fn, which in turn may call
instantiate_decl, which may call start_function which in turn 
resets current_function_decl.  However, no code restores the original
value of current_function_decl.

This can cause problems with the tree-ssa optimizers, particularly the
code to create new variables (they get created in the wrong funtion).

Anyway, I'm not sure how you want to fix this.  We could save/restore
current_function_decl in  cp_cannot_inline_tree_fn, the generic
inliner, or in instantiate_decl.

Jeff







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