This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] C++ Question
- From: law at redhat dot com
- To: jason at redhat dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 24 Mar 2003 15:06:26 -0700
- Subject: [tree-ssa] C++ Question
- Reply-to: law at redhat dot com
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