aboutsummaryrefslogtreecommitdiff
path: root/gcc/explow.c
diff options
context:
space:
mode:
authorAndreas Krebbel <Andreas.Krebbel@de.ibm.com>2011-05-04 12:01:21 +0000
committerAndreas Krebbel <krebbel@gcc.gnu.org>2011-05-04 12:01:21 +0000
commit5e617be801a07a59e464005f9e1bac1959b6cf56 (patch)
tree8900c45044a2c5fcbab68008ebff0cf2f9c08fa3 /gcc/explow.c
parent23ee028b82aaf3615dca2639a3443fcb216846cc (diff)
downloadgcc-5e617be801a07a59e464005f9e1bac1959b6cf56.zip
gcc-5e617be801a07a59e464005f9e1bac1959b6cf56.tar.gz
gcc-5e617be801a07a59e464005f9e1bac1959b6cf56.tar.bz2
calls.c (emit_library_call_value_1): Invoke promote_function_mode hook on libcall arguments.
2011-05-04 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> * calls.c (emit_library_call_value_1): Invoke promote_function_mode hook on libcall arguments. * explow.c (promote_function_mode, promote_mode): Handle TYPE argument being NULL. * targhooks.c (default_promote_function_mode): Lisewise. * config/s390/s390.c (s390_promote_function_mode): Likewise. * config/sparc/sparc.c (sparc_promote_function_mode): Likewise. * doc/tm.texi: Document that TYPE argument might be NULL. From-SVN: r173371
Diffstat (limited to 'gcc/explow.c')
-rw-r--r--gcc/explow.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/explow.c b/gcc/explow.c
index a0a160d..da04505 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -771,6 +771,17 @@ enum machine_mode
promote_function_mode (const_tree type, enum machine_mode mode, int *punsignedp,
const_tree funtype, int for_return)
{
+ /* Called without a type node for a libcall. */
+ if (type == NULL_TREE)
+ {
+ if (INTEGRAL_MODE_P (mode))
+ return targetm.calls.promote_function_mode (NULL_TREE, mode,
+ punsignedp, funtype,
+ for_return);
+ else
+ return mode;
+ }
+
switch (TREE_CODE (type))
{
case INTEGER_TYPE: case ENUMERAL_TYPE: case BOOLEAN_TYPE:
@@ -791,6 +802,12 @@ enum machine_mode
promote_mode (const_tree type ATTRIBUTE_UNUSED, enum machine_mode mode,
int *punsignedp ATTRIBUTE_UNUSED)
{
+ /* For libcalls this is invoked without TYPE from the backends
+ TARGET_PROMOTE_FUNCTION_MODE hooks. Don't do anything in that
+ case. */
+ if (type == NULL_TREE)
+ return mode;
+
/* FIXME: this is the same logic that was there until GCC 4.4, but we
probably want to test POINTERS_EXTEND_UNSIGNED even if PROMOTE_MODE
is not defined. The affected targets are M32C, S390, SPARC. */