aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2009-04-09 16:07:43 +0000
committerPaolo Bonzini <bonzini@gcc.gnu.org>2009-04-09 16:07:43 +0000
commitb45f0e58d72a6ea2f54d007152b55fc44311359f (patch)
treed12ca0de4241fd0f950beabe6b910ba0a883eabd /gcc/fold-const.c
parent9332c6ebd1b4ce843ddf9be3d9abdf6abeb3dfcd (diff)
downloadgcc-b45f0e58d72a6ea2f54d007152b55fc44311359f.zip
gcc-b45f0e58d72a6ea2f54d007152b55fc44311359f.tar.gz
gcc-b45f0e58d72a6ea2f54d007152b55fc44311359f.tar.bz2
expmed.c (expand_divmod): Always use a comparison for a division by a large unsigned integer.
2009-04-09 Paolo Bonzini <bonzini@gnu.org> * expmed.c (expand_divmod): Always use a comparison for a division by a large unsigned integer. * fold-const.c (tree_single_nonzero_warnv_p): Always treat decls for things others than variables or functions as nonzero. testsuite: 2009-04-09 Paolo Bonzini <bonzini@gnu.org> * gcc.dg/pr27150-1.c: Change to a link test. From-SVN: r145846
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 7dcf993..821e581 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -15018,8 +15018,8 @@ tree_single_nonzero_warnv_p (tree t, bool *strict_overflow_p)
return false;
/* Weak declarations may link to NULL. */
- if (VAR_OR_FUNCTION_DECL_P (base))
- return !DECL_WEAK (base);
+ if (DECL_P (base) && flag_delete_null_pointer_checks)
+ return !VAR_OR_FUNCTION_DECL_P (base) || !DECL_WEAK (base);
/* Constants are never weak. */
if (CONSTANT_CLASS_P (base))