]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
expr.c (expand_expr_real, [...]): Get proper type of stack slot for temp used for...
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>
Thu, 4 Mar 2004 22:00:59 +0000 (22:00 +0000)
committerRichard Kenner <kenner@gcc.gnu.org>
Thu, 4 Mar 2004 22:00:59 +0000 (17:00 -0500)
* 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

gcc/ChangeLog
gcc/expr.c

index f126b1c591b94eeac0d273a9113fc0824f7ef774..a141cc97684c3bc7a278da1ad04ff66e1d6bf054 100644 (file)
@@ -1,3 +1,8 @@
+2004-03-04  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
+
+       * 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.
+
 2004-03-04  Jan Hubicka  <jh@suse.cz>
 
        * reload.c (find_reloads): Reorganize if seqeunce to switch.
index 14809498a937046c7779336ce10d005b92c78e4c..9bd27402768dcc7575e38c070ece2736816ed3ea 100644 (file)
@@ -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);