+2008-07-07 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36713
+ * tree-flow-inline.h (is_call_used): New function.
+ * tree-nrv.c (dest_safe_for_nrv_p): Use it.
+ * tree-tailcall.c (suitable_for_tail_opt_p): Likewise.
+ * tree-outof-ssa.c (create_temp): Set call-used flag if required.
+
2008-07-07 Maxim Kuvyrkov <maxim@codesourcery.com>
* config/m68k/m68k.c (m68k_return_in_memory): Fix arguments types.
return TREE_CODE (SSA_NAME_VAR (name)) == MEMORY_PARTITION_TAG;
}
-/* Return true if VAR is a clobbered by function calls. */
+/* Return true if VAR is used by function calls. */
+static inline bool
+is_call_used (const_tree var)
+{
+ return (var_ann (var)->call_clobbered
+ || bitmap_bit_p (gimple_call_used_vars (cfun), DECL_UID (var)));
+}
+
+/* Return true if VAR is clobbered by function calls. */
static inline bool
is_call_clobbered (const_tree var)
{
if (TREE_CODE (dest) == SSA_NAME)
dest = SSA_NAME_VAR (dest);
- if (is_call_clobbered (dest))
+ if (is_call_used (dest))
return false;
return true;
set_symbol_mem_tag (tmp, symbol_mem_tag (t));
if (is_call_clobbered (t))
mark_call_clobbered (tmp, var_ann (t)->escape_mask);
+ if (bitmap_bit_p (gimple_call_used_vars (cfun), DECL_UID (t)))
+ bitmap_set_bit (gimple_call_used_vars (cfun), DECL_UID (tmp));
return tmp;
}
if (cfun->stdarg)
return false;
- /* No local variable nor structure field should be call-clobbered. We
+ /* No local variable nor structure field should be call-used. We
ignore any kind of memory tag, as these are not real variables. */
FOR_EACH_REFERENCED_VAR (var, rvi)
{
if (!is_global_var (var)
&& !MTAG_P (var)
- && (gimple_aliases_computed_p (cfun) ? is_call_clobbered (var)
+ && (gimple_aliases_computed_p (cfun)? is_call_used (var)
: TREE_ADDRESSABLE (var)))
return false;
}