+2010-05-09 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/44024
+ * fold-const.c (tree_single_nonzero_warnv_p): Properly
+ handle &FUNCTION_DECL.
+
2010-05-09 Joseph Myers <joseph@codesourcery.com>
PR c/4784
case ADDR_EXPR:
{
- tree base = get_base_address (TREE_OPERAND (t, 0));
+ tree base = TREE_OPERAND (t, 0);
+ if (!DECL_P (base))
+ base = get_base_address (base);
if (!base)
return false;
allocated on the stack. */
if (DECL_P (base)
&& (flag_delete_null_pointer_checks
- || (TREE_CODE (base) == VAR_DECL && !TREE_STATIC (base))))
+ || (DECL_CONTEXT (base)
+ && TREE_CODE (DECL_CONTEXT (base)) == FUNCTION_DECL
+ && auto_var_in_fn_p (base, DECL_CONTEXT (base)))))
return !VAR_OR_FUNCTION_DECL_P (base) || !DECL_WEAK (base);
/* Constants are never weak. */