This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH sh] Fix thinko in FUNCTION_VALUE
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 17 Apr 2009 07:30:32 -0400
- Subject: [PATCH sh] Fix thinko in FUNCTION_VALUE
I found this by inspection in config/sh/sh.h.
The call to sh_promote_prototypes is wrong, and this could lead to subtle
bugs for functions using attribute renesas.
Ok for mainline?
Paolo
2009-04-17 Paolo Bonzini <bonzini@gnu.org>
* config/sh/sh.h (FUNCTION_VALUE): Fix call to sh_promote_prototypes.
Index: gcc/config/sh/sh.h
===================================================================
--- gcc/config/sh/sh.h (branch promote-function-mode)
+++ gcc/config/sh/sh.h (working copy)
@@ -1743,7 +1743,7 @@ extern enum reg_class regno_reg_class[FI
|| TREE_CODE (VALTYPE) == BOOLEAN_TYPE \
|| TREE_CODE (VALTYPE) == REAL_TYPE \
|| TREE_CODE (VALTYPE) == OFFSET_TYPE)) \
- && sh_promote_prototypes (VALTYPE) \
+ && sh_promote_prototypes (FUNC) \
? (TARGET_SHMEDIA64 ? DImode : SImode) : TYPE_MODE (VALTYPE)), \
BASE_RETURN_VALUE_REG (TYPE_MODE (VALTYPE)))