diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2015-10-12 07:26:47 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2015-10-12 05:26:47 +0000 |
commit | 38e9e539bc63af71d76c3d5292fb08bb8262a5bf (patch) | |
tree | 186f32cb02bcc0b34ce572b5f6a7fd63ddb605a8 /gcc/fold-const.c | |
parent | 0732f75fce0fb24a4989b510d57ebd2b05c1a67f (diff) | |
download | gcc-38e9e539bc63af71d76c3d5292fb08bb8262a5bf.zip gcc-38e9e539bc63af71d76c3d5292fb08bb8262a5bf.tar.gz gcc-38e9e539bc63af71d76c3d5292fb08bb8262a5bf.tar.bz2 |
fold-const.c (fold_comparsion): Pass OEP_ADDRESS_OF when comparing addresses.
* fold-const.c (fold_comparsion): Pass OEP_ADDRESS_OF when comparing
addresses.
(fold_addr_of_array_ref_difference): Likewise.
From-SVN: r228701
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index bdfda9a..de45a2c 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -8426,7 +8426,8 @@ fold_comparison (location_t loc, enum tree_code code, tree type, /* If we have equivalent bases we might be able to simplify. */ if (indirect_base0 == indirect_base1 - && operand_equal_p (base0, base1, 0)) + && operand_equal_p (base0, base1, + indirect_base0 ? OEP_ADDRESS_OF : 0)) { /* We can fold this expression to a constant if the non-constant offset parts are equal. */ @@ -8846,7 +8847,7 @@ fold_addr_of_array_ref_difference (location_t loc, tree type, && (base_offset = fold_binary_loc (loc, MINUS_EXPR, type, TREE_OPERAND (base0, 0), TREE_OPERAND (base1, 0)))) - || operand_equal_p (base0, base1, 0)) + || operand_equal_p (base0, base1, OEP_ADDRESS_OF)) { tree op0 = fold_convert_loc (loc, type, TREE_OPERAND (aref0, 1)); tree op1 = fold_convert_loc (loc, type, TREE_OPERAND (aref1, 1)); |