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/fold-const.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/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index a1efab1..b35dfbf 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -3296,7 +3296,7 @@ decode_field_reference (tree exp, HOST_WIDE_INT *pbitsize, /* If the number of bits in the reference is the same as the bitsize of the outer type, then the outer type gives the signedness. Otherwise (in case of a small bitfield) the signedness is unchanged. */ - if (outer_type && *pbitsize == tree_low_cst (TYPE_SIZE (outer_type), 1)) + if (outer_type && *pbitsize == TYPE_PRECISION (outer_type)) *punsignedp = TYPE_UNSIGNED (outer_type); /* Compute the mask to access the bitfield. */ |