PR target/39361
Jan Hubicka
hubicka@ucw.cz
Sun Mar 8 13:37:00 GMT 2009
Hi,
the problem is that my patch to disable SSA substitutions in inliner for
debug info at -O0 was bit overactive wrt always_inline functions with
const arguments where we need substitution to be done in order to be
able to use them for calling builtins requiring compile time constants
as arguments.
Bootstrapped/regtested x86_64-linux, OK?
Honza
PR target/39361
* tree-inline.c (setup_one_parameter): Do replacement of const argument
by constant in SSA form.
Index: tree-inline.c
===================================================================
*** tree-inline.c (revision 144708)
--- tree-inline.c (working copy)
*************** setup_one_parameter (copy_body_data *id,
*** 2110,2115 ****
--- 2110,2119 ----
We need to construct map for the variable anyway as it might be used
in different SSA names when parameter is set in function.
+ Do replacement at -O0 for const arguments replaced by constant.
+ This is important for builtin_constant_p and other construct requiring
+ constant argument to be visible in inlined function body.
+
FIXME: This usually kills the last connection in between inlined
function parameter and the actual value in debug info. Can we do
better here? If we just inserted the statement, copy propagation
*************** setup_one_parameter (copy_body_data *id,
*** 2118,2124 ****
We might want to introduce a notion that single SSA_NAME might
represent multiple variables for purposes of debugging. */
if (gimple_in_ssa_p (cfun) && rhs && def && is_gimple_reg (p)
! && optimize
&& (TREE_CODE (rhs) == SSA_NAME
|| is_gimple_min_invariant (rhs))
&& !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (def))
--- 2122,2130 ----
We might want to introduce a notion that single SSA_NAME might
represent multiple variables for purposes of debugging. */
if (gimple_in_ssa_p (cfun) && rhs && def && is_gimple_reg (p)
! && (optimize
! || (TREE_READONLY (p)
! && is_gimple_min_invariant (rhs)))
&& (TREE_CODE (rhs) == SSA_NAME
|| is_gimple_min_invariant (rhs))
&& !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (def))
More information about the Gcc-patches
mailing list