summaryrefslogtreecommitdiffstats
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-26 23:18:14 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-26 23:18:14 +0000
commita94ca2175201d6aabd23d7fecfc739fc7f307bfc (patch)
treec288833747703ad1533d198a783c87c3ac5711f2 /gcc/c-decl.c
parentfe7266faca0e506a4e90ffd60f03b22c936d0655 (diff)
downloadppe42-gcc-a94ca2175201d6aabd23d7fecfc739fc7f307bfc.tar.gz
ppe42-gcc-a94ca2175201d6aabd23d7fecfc739fc7f307bfc.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94290 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 6673927eab6..61521e861c7 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
OpenPOWER on IntegriCloud