diff options
author | Jan Hubicka <jh@suse.cz> | 2006-12-04 23:51:42 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2006-12-04 22:51:42 +0000 |
commit | 26979bc292e163864289597602beb01705188349 (patch) | |
tree | aec6f99c441c9265e6586e4694d0aa72c7570eaa /gcc/builtins.c | |
parent | 477d851ce1a3b9fbe06c921ebd99925276792085 (diff) | |
download | gcc-26979bc292e163864289597602beb01705188349.zip gcc-26979bc292e163864289597602beb01705188349.tar.gz gcc-26979bc292e163864289597602beb01705188349.tar.bz2 |
cp-objcp-common.c (cp_expr_size): Return NULL in the case size is undefined.
* cp-objcp-common.c (cp_expr_size): Return NULL in the case
size is undefined.
* builtins.c (fold_builtin_memory_op): Check that expr_size match.
* explow.c (expr_size, int_expr_size): Assert that size is non_NULL.
From-SVN: r119515
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index 80c5e1f..0cfdb9a 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -8202,8 +8202,8 @@ fold_builtin_memory_op (tree arglist, tree type, bool ignore, int endp) || !TYPE_SIZE_UNIT (desttype) || TREE_CODE (TYPE_SIZE_UNIT (srctype)) != INTEGER_CST || TREE_CODE (TYPE_SIZE_UNIT (desttype)) != INTEGER_CST - || !operand_equal_p (TYPE_SIZE_UNIT (srctype), len, 0) - || !operand_equal_p (TYPE_SIZE_UNIT (desttype), len, 0)) + || !tree_int_cst_equal (TYPE_SIZE_UNIT (srctype), len) + || !tree_int_cst_equal (TYPE_SIZE_UNIT (desttype), len)) return 0; if (get_pointer_alignment (dest, BIGGEST_ALIGNMENT) @@ -8218,6 +8218,8 @@ fold_builtin_memory_op (tree arglist, tree type, bool ignore, int endp) srcvar = build_fold_indirect_ref (src); if (TREE_THIS_VOLATILE (srcvar)) return 0; + if (!tree_int_cst_equal (lang_hooks.expr_size (srcvar), len)) + return 0; /* With memcpy, it is possible to bypass aliasing rules, so without this check i. e. execute/20060930-2.c would be misoptimized, because it use conflicting alias set to hold argument for the memcpy call. @@ -8233,6 +8235,8 @@ fold_builtin_memory_op (tree arglist, tree type, bool ignore, int endp) destvar = build_fold_indirect_ref (dest); if (TREE_THIS_VOLATILE (destvar)) return 0; + if (!tree_int_cst_equal (lang_hooks.expr_size (destvar), len)) + return 0; if (!var_decl_component_p (destvar)) return 0; |