stor-layout.c (compute_record_type): Don't use mode of single field as mode of record...
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>
Fri, 18 Aug 2000 20:52:28 +0000 (20:52 +0000)
committerRichard Kenner <kenner@gcc.gnu.org>
Fri, 18 Aug 2000 20:52:28 +0000 (16:52 -0400)
* stor-layout.c (compute_record_type): Don't use mode of single
field as mode of record if not integer mode of same type.

From-SVN: r35796

gcc/ChangeLog
gcc/stor-layout.c

index 48bed93a6bd472de931dbb1f215e2b7c3f1997ee..2b97062c8ddeb8b941de66ff753b03f82e798405 100644 (file)
@@ -6,13 +6,14 @@ Fri Aug 18 16:22:20 2000  Alexandre Oliva  <aoliva@redhat.com>
        * configure.in: Get them included with `tm_file's.
        * configure: Rebuilt.
 
-Fri Aug 18 16:01:18 2000  Alexandre Oliva  <aoliva@redhat.com>
-
        * config/sh/sh.md (fpu_switch0, fpu_switch1): Simplify.
        * config/sh/sh.c (fpscr_set_from_mem): Use them.
 
 Fri Aug 18 14:23:18 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
+       * stor-layout.c (compute_record_type): Don't use mode of single
+       field as mode of record if not integer mode of same type.
+
        * regmove.c (perhaps_ends_bb_p): New function.
        (optimize_reg_copy_1, optimize_reg_copy_2): Call it.
        (optimize_reg_copy_3, fixup_match_2, regmove_optimize): Likewise.
index 159e2a8551f193b134ea64166d8865cb82410fd4..294f2d400ed0e4557bc70b33402c3bee800da373 100644 (file)
@@ -1062,8 +1062,11 @@ compute_record_mode (type)
 
       /* If this field is the whole struct, remember its mode so
         that, say, we can put a double in a class into a DF
-        register instead of forcing it to live in the stack.  */
-      if (field == TYPE_FIELDS (type) && TREE_CHAIN (field) == 0)
+        register instead of forcing it to live in the stack.  However,
+        we don't support using such a mode if there is no integer mode
+        of the same size, so don't set it here.  */
+      if (field == TYPE_FIELDS (type) && TREE_CHAIN (field) == 0
+         && int_mode_for_mode (DECL_MODE (field)) != BLKmode)
        mode = DECL_MODE (field);
 
 #ifdef STRUCT_FORCE_BLK