diff options
author | krebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-05-04 12:01:21 +0000 |
---|---|---|
committer | krebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-05-04 12:01:21 +0000 |
commit | adaf4ef091f57a9a977db881fc2f3ce5a7fdd3bb (patch) | |
tree | 8900c45044a2c5fcbab68008ebff0cf2f9c08fa3 /gcc/explow.c | |
parent | 852640e9c5bf075aaa74b75ee6bd276f81a135d9 (diff) | |
download | gcc-adaf4ef091f57a9a977db881fc2f3ce5a7fdd3bb.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173371 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/explow.c')
-rw-r--r-- | gcc/explow.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/explow.c b/gcc/explow.c index a0a160dd2bd..da04505a7e8 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. */ |