This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Bug target/14960] -maltivec affects vector return with -mabi=no-altivec
- From: Hartmut Penner <HPENNER at de dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org, Aldy Hernandez <aldyh at redhat dot com>
- Cc: Alan Modra <amodra at bigpond dot net dot au>, Janis Johnson <janis187 at us dot ibm dot com>
- Date: Mon, 19 Apr 2004 13:55:14 +0200
- Subject: [Bug target/14960] -maltivec affects vector return with -mabi=no-altivec
The problem with Bug 14960 is, that rs6000_function_value checks for
TARGET_ALTIVEC instead
of TARGET_ALTIVEC_ABI, when deciding for passing value in gpr or vector
register.
Changed it to check for TARGET_ALTIVEC_ABI.
Aldy,
I also changed rs6000_libcall_value. Is that fix also OK ?
regards, Hartmut
ChangeLog
2004-04-19 Hartmut Penner <hpenner@de.ibm.com>
* config/rs6000/rs6000.c (rs6000_function_value):
Only use AltiVec regs in case of AltiVec ABI.
(rs6000_libcall_value): Ditto.
Index: gcc/config/rs6000/rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.625
diff -u -p -r1.625 rs6000.c
--- gcc/config/rs6000/rs6000.c 17 Apr 2004 12:40:07 -0000 1.625
+++ gcc/config/rs6000/rs6000.c 19 Apr 2004 11:46:39 -0000
@@ -16204,7 +16204,7 @@ rs6000_function_value (tree valtype, tre
&& TARGET_HARD_FLOAT
&& targetm.calls.split_complex_arg)
return rs6000_complex_function_value (mode);
- else if (TREE_CODE (valtype) == VECTOR_TYPE && TARGET_ALTIVEC)
+ else if (TREE_CODE (valtype) == VECTOR_TYPE && TARGET_ALTIVEC_ABI)
regno = ALTIVEC_ARG_RETURN;
else
regno = GP_ARG_RETURN;
@@ -16222,7 +16222,7 @@ rs6000_libcall_value (enum machine_mode
if (GET_MODE_CLASS (mode) == MODE_FLOAT
&& TARGET_HARD_FLOAT && TARGET_FPRS)
regno = FP_ARG_RETURN;
- else if (ALTIVEC_VECTOR_MODE (mode))
+ else if (ALTIVEC_VECTOR_MODE (mode) && TARGET_ALTIVEC_ABI)
regno = ALTIVEC_ARG_RETURN;
else if (COMPLEX_MODE_P (mode) && targetm.calls.split_complex_arg)
return rs6000_complex_function_value (mode);