diff options
author | Joseph Myers <jsm@polyomino.org.uk> | 2004-07-11 10:45:39 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2004-07-11 10:45:39 +0100 |
commit | fae1b38dc82248b70271f42647fa92b82ca6e200 (patch) | |
tree | 1b02a4649bd7dcfe9f9116eb1060eb0d1e1d01b3 /gcc/c-common.c | |
parent | 7d3998a4453d9aa086113cb353eebda4c0a87563 (diff) | |
download | gcc-fae1b38dc82248b70271f42647fa92b82ca6e200.zip gcc-fae1b38dc82248b70271f42647fa92b82ca6e200.tar.gz gcc-fae1b38dc82248b70271f42647fa92b82ca6e200.tar.bz2 |
re PR tree-optimization/16437 (New c-torture failures after bitfield patch)
PR tree-optimization/16437
* c-common.c (shorten_compare): Don't mark result of conversion to
narrower signed type as overflowing.
* fold-const.c (decode_field_reference): Determine whether
signedness comes from outer type using precision rather than size.
testsuite:
* gcc.c-torture/execute/bitfld-4.c: New test.
From-SVN: r84498
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r-- | gcc/c-common.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index ebb5e65..e177d88 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -1924,7 +1924,12 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr, *restype_ptr = c_common_signed_type (*restype_ptr); if (TREE_TYPE (primop1) != *restype_ptr) - primop1 = convert (*restype_ptr, primop1); + { + tree tmp = convert (*restype_ptr, primop1); + TREE_OVERFLOW (tmp) = TREE_OVERFLOW (primop1); + TREE_CONSTANT_OVERFLOW (tmp) = TREE_CONSTANT_OVERFLOW (primop1); + primop1 = tmp; + } if (type != *restype_ptr) { minval = convert (*restype_ptr, minval); |