(expand_inline_function): Don't call convert_to_mode unless we need to...
authorRichard Kenner <kenner@gcc.gnu.org>
Thu, 6 May 1993 16:54:41 +0000 (12:54 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Thu, 6 May 1993 16:54:41 +0000 (12:54 -0400)
(expand_inline_function): Don't call convert_to_mode unless we need
to; some converstions of VOIDmode objects can mess them up.

From-SVN: r4359

gcc/integrate.c

index ebc219fab90e41fdaa91fd1a8a1bae4349a9e753..6a7fef56a9f9f379c2b3bbe1616430154d36492c 100644 (file)
@@ -1,5 +1,5 @@
 /* Procedure integration for GNU CC.
-   Copyright (C) 1988, 1991 Free Software Foundation, Inc.
+   Copyright (C) 1988, 1991, 1993 Free Software Foundation, Inc.
    Contributed by Michael Tiemann (tiemann@cygnus.com)
 
 This file is part of GNU CC.
@@ -1242,12 +1242,17 @@ expand_inline_function (fndecl, parms, target, ignore, type, structure_value_add
          arg_vals[i] = XEXP (stack_slot, 0);
        }
       else if (GET_CODE (loc) != MEM)
-       /* The mode if LOC and ARG can differ if LOC was a variable
-          that had its mode promoted via PROMOTED_MODE.  */
-       arg_vals[i] = convert_to_mode (GET_MODE (loc),
-                                      expand_expr (arg, NULL_RTX, mode,
-                                                   EXPAND_SUM),
-                                      TREE_UNSIGNED (TREE_TYPE (formal)));
+       {
+         if (GET_MODE (loc) != TYPE_MODE (TREE_TYPE (arg)))
+           /* The mode if LOC and ARG can differ if LOC was a variable
+              that had its mode promoted via PROMOTED_MODE.  */
+           arg_vals[i] = convert_to_mode (GET_MODE (loc),
+                                          expand_expr (arg, NULL_RTX, mode,
+                                                       EXPAND_SUM),
+                                          TREE_UNSIGNED (TREE_TYPE (formal)));
+         else
+           arg_vals[i] = expand_expr (arg, NULL_RTX, mode, EXPAND_SUM);
+       }
       else
        arg_vals[i] = 0;