diff options
author | Richard Biener <rguenther@suse.de> | 2014-10-23 08:25:55 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2014-10-23 08:25:55 +0000 |
commit | 4d885a639e4a72665b95fa895032d2600418d390 (patch) | |
tree | 004e2ca23be9197e0f29a83864df1f382bc5f99b /gcc/stor-layout.c | |
parent | a15d2ea8adf0aeb4e02872b0fb55b513035de2d6 (diff) | |
download | gcc-4d885a639e4a72665b95fa895032d2600418d390.zip gcc-4d885a639e4a72665b95fa895032d2600418d390.tar.gz gcc-4d885a639e4a72665b95fa895032d2600418d390.tar.bz2 |
fold-const.c (fold_binary_loc): Preserve side-effects of X - X when simplifying to 0.
2014-10-22 Richard Biener <rguenther@suse.de>
* fold-const.c (fold_binary_loc): Preserve side-effects of
X - X when simplifying to 0.
* stor-layout.c (finish_bitfield_representative): Strip
side-effects of evaluating the difference of two DECL_FIELD_OFFSET.
From-SVN: r216575
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r-- | gcc/stor-layout.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 237cf69..9f0064b 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -1860,6 +1860,8 @@ finish_bitfield_representative (tree repr, tree field) size = size_diffop (DECL_FIELD_OFFSET (field), DECL_FIELD_OFFSET (repr)); + while (TREE_CODE (size) == COMPOUND_EXPR) + size = TREE_OPERAND (size, 1); gcc_assert (tree_fits_uhwi_p (size)); bitsize = (tree_to_uhwi (size) * BITS_PER_UNIT + tree_to_uhwi (DECL_FIELD_BIT_OFFSET (field)) |