]> gcc.gnu.org Git - gcc.git/commitdiff
(expand_inline_function): Avoid creating paradoxical subreg wider than
authorRichard Kenner <kenner@gcc.gnu.org>
Tue, 24 Sep 1996 12:13:52 +0000 (08:13 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Tue, 24 Sep 1996 12:13:52 +0000 (08:13 -0400)
BITS_PER_WORD as inlined function result.

From-SVN: r12832

gcc/integrate.c

index f1e778a81d8033dab86ef37ee181c10be4d8b2a7..1c5a4a7dd636afedcc710809c2e93e8df5bfeb57 100644 (file)
@@ -1673,7 +1673,21 @@ expand_inline_function (fndecl, parms, target, ignore, type,
         avoid machine mode mismatch when we substitute INLINE_TARGET.
         But TARGET is what we will return to the caller.  */
       if (arriving_mode != departing_mode)
-       reg_to_map = gen_rtx (SUBREG, arriving_mode, target, 0);
+       {
+         /* Avoid creating a paradoxical subreg wider than
+            BITS_PER_WORD, since that is illegal.  */
+         if (GET_MODE_BITSIZE (arriving_mode) > BITS_PER_WORD)
+           {
+             if (!TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (departing_mode),
+                                         GET_MODE_BITSIZE (arriving_mode)))
+               /* Maybe could be handled by using convert_move () ?  */
+               abort ();
+             reg_to_map = gen_reg_rtx (arriving_mode);
+             target = gen_lowpart (departing_mode, reg_to_map);
+           }
+         else
+           reg_to_map = gen_rtx (SUBREG, arriving_mode, target, 0);
+       }
       else
        reg_to_map = target;
 
This page took 0.068505 seconds and 5 git commands to generate.