rs6000.c (TARGET_PROMOTE_FUNCTION_MODE): Implement as rs6000_promote_function_mode.
authorSegher Boessenkool <segher@kernel.crashing.org>
Fri, 16 Jan 2015 16:32:51 +0000 (17:32 +0100)
committerSegher Boessenkool <segher@gcc.gnu.org>
Fri, 16 Jan 2015 16:32:51 +0000 (17:32 +0100)
* config/rs6000/rs6000.c (TARGET_PROMOTE_FUNCTION_MODE): Implement
as rs6000_promote_function_mode.  Move comment to there.
(rs6000_promote_function_mode): New function.

From-SVN: r219751

gcc/ChangeLog
gcc/config/rs6000/rs6000.c

index 76ccc9d580a4b58876681b4763f347042c6ff9b1..e6bc709c6886cc212681741860b173bccff73a36 100644 (file)
@@ -1,3 +1,9 @@
+2015-01-16  Segher Boessenkool  <segher@kernel.crashing.org>
+
+       * config/rs6000/rs6000.c (TARGET_PROMOTE_FUNCTION_MODE): Implement
+       as rs6000_promote_function_mode.  Move comment to there.
+       (rs6000_promote_function_mode): New function.
+
 2015-01-16  Segher Boessenkool  <segher@kernel.crashing.org>
 
        * config/rs6000/rs6000.h (PROMOTE_MODE): Correct test for when -m32
index ca214136e1fe09f6a2d441ceef400ffc763ad2af..1a3e7eb61ca8e8258ba28e78783b7109bdb45ba5 100644 (file)
@@ -1511,10 +1511,8 @@ static const struct attribute_spec rs6000_attribute_table[] =
 #undef TARGET_MEMBER_TYPE_FORCES_BLK
 #define TARGET_MEMBER_TYPE_FORCES_BLK rs6000_member_type_forces_blk
 
-/* On rs6000, function arguments are promoted, as are function return
-   values.  */
 #undef TARGET_PROMOTE_FUNCTION_MODE
-#define TARGET_PROMOTE_FUNCTION_MODE default_promote_function_mode_always_promote
+#define TARGET_PROMOTE_FUNCTION_MODE rs6000_promote_function_mode
 
 #undef TARGET_RETURN_IN_MEMORY
 #define TARGET_RETURN_IN_MEMORY rs6000_return_in_memory
@@ -9308,6 +9306,20 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype,
     }
 }
 \f
+/* On rs6000, function arguments are promoted, as are function return
+   values.  */
+
+static machine_mode
+rs6000_promote_function_mode (const_tree type ATTRIBUTE_UNUSED,
+                             machine_mode mode,
+                             int *punsignedp ATTRIBUTE_UNUSED,
+                             const_tree, int)
+{
+  PROMOTE_MODE (mode, *punsignedp, type);
+
+  return mode;
+}
+
 /* Return true if TYPE must be passed on the stack and not in registers.  */
 
 static bool