aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2004-03-04 22:00:59 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2004-03-04 17:00:59 -0500
commitdaae8185c813fc4970409ccb50231607494ca0f2 (patch)
tree69b234d253f52addaf041f13820cbfe3ccc1701d /gcc/expr.c
parentf345f21a90e56d8f1f9a61e96519a9de2ede2d04 (diff)
downloadgcc-daae8185c813fc4970409ccb50231607494ca0f2.zip
gcc-daae8185c813fc4970409ccb50231607494ca0f2.tar.gz
gcc-daae8185c813fc4970409ccb50231607494ca0f2.tar.bz2
expr.c (expand_expr_real, [...]): Get proper type of stack slot for temp used for result of BLKmode but in...
* expr.c (expand_expr_real, case COMPONENT_REF): Get proper type of stack slot for temp used for result of BLKmode but in integral mode. From-SVN: r78937
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 1480949..9bd2740 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -7240,12 +7240,19 @@ expand_expr_real (tree exp, rtx target, enum machine_mode tmode,
- bitsize),
op0, 1);
+ /* If the result type is BLKmode, store the data into a temporary
+ of the appropriate type, but with the mode corresponding to the
+ mode for the data we have (op0's mode). It's tempting to make
+ this a constant type, since we know it's only being stored once,
+ but that can cause problems if we are taking the address of this
+ COMPONENT_REF because the MEM of any reference via that address
+ will have flags corresponding to the type, which will not
+ necessarily be constant. */
if (mode == BLKmode)
{
- rtx new = assign_temp (build_qualified_type
- ((*lang_hooks.types.type_for_mode)
- (ext_mode, 0),
- TYPE_QUAL_CONST), 0, 1, 1);
+ rtx new
+ = assign_stack_temp_for_type
+ (ext_mode, GET_MODE_BITSIZE (ext_mode), 0, type);
emit_move_insn (new, op0);
op0 = copy_rtx (new);