diff options
author | Richard Henderson <rth@redhat.com> | 2005-01-26 15:18:14 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2005-01-26 15:18:14 -0800 |
commit | 78ef1e3d9fbe214ead3c117ec54a5c10da91a0df (patch) | |
tree | c288833747703ad1533d198a783c87c3ac5711f2 /gcc/c-decl.c | |
parent | 5596990fafed164e66c78bb1f4ec82eb58ba0042 (diff) | |
download | gcc-78ef1e3d9fbe214ead3c117ec54a5c10da91a0df.zip gcc-78ef1e3d9fbe214ead3c117ec54a5c10da91a0df.tar.gz gcc-78ef1e3d9fbe214ead3c117ec54a5c10da91a0df.tar.bz2 |
re PR middle-end/18008 (Duplicate mask on bitfield insertion)
PR middle-end/18008
* c-decl.c (finish_struct): Set DECL_MODE after resetting a
field's type.
* expmed.c (store_fixed_bit_field): Create a paradoxical subreg
if we don't need the bits above those present in the current mode.
* expr.c (store_field): Strip conversions to odd-bit-sized types
if the destination field width matches.
From-SVN: r94290
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 6673927..61521e8 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -5301,8 +5301,11 @@ finish_struct (tree t, tree fieldlist, tree attributes) = tree_low_cst (DECL_INITIAL (*fieldlistp), 1); tree type = TREE_TYPE (*fieldlistp); if (width != TYPE_PRECISION (type)) - TREE_TYPE (*fieldlistp) - = build_nonstandard_integer_type (width, TYPE_UNSIGNED (type)); + { + TREE_TYPE (*fieldlistp) + = build_nonstandard_integer_type (width, TYPE_UNSIGNED (type)); + DECL_MODE (*fieldlistp) = TYPE_MODE (TREE_TYPE (*fieldlistp)); + } DECL_INITIAL (*fieldlistp) = 0; } else |