This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR target/41145, Restore reporting of Altivec errors
- From: Michael Meissner <meissner at linux dot vnet dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org, dje dot gcc at gmail dot com
- Date: Fri, 21 Aug 2009 18:39:17 -0400
- Subject: [PATCH] Fix PR target/41145, Restore reporting of Altivec errors
My VSX patches broke reporting of mixing __vector with boolean, complex, and
decimal types unless the -mvsx switch was used. This patch restores the error
message, and makes the testsuite pass. I bootstrapped the compiler and reran
the testsuite, and it fixed gcc.dg/dfp/altivec-types.c and other tests.
Is it ok to install?
2009-08-21 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/41145
* config/rs6000/rs6000.c (rs6000_handle_altivec_attribute): Fix
reporting of vector + decimal/boolean/complex,
Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c (revision 151002)
+++ gcc/config/rs6000/rs6000.c (working copy)
@@ -22827,7 +22827,15 @@ rs6000_handle_altivec_attribute (tree *n
mode = TYPE_MODE (type);
/* Check for invalid AltiVec type qualifiers. */
- if (!TARGET_VSX)
+ if (type == long_double_type_node)
+ error ("use of %<long double%> in AltiVec types is invalid");
+ else if (type == boolean_type_node)
+ error ("use of boolean types in AltiVec types is invalid");
+ else if (TREE_CODE (type) == COMPLEX_TYPE)
+ error ("use of %<complex%> in AltiVec types is invalid");
+ else if (DECIMAL_FLOAT_MODE_P (mode))
+ error ("use of decimal floating point types in AltiVec types is invalid");
+ else if (!TARGET_VSX)
{
if (type == long_unsigned_type_node || type == long_integer_type_node)
{
@@ -22845,14 +22853,6 @@ rs6000_handle_altivec_attribute (tree *n
else if (type == double_type_node)
error ("use of %<double%> in AltiVec types is invalid without -mvsx");
}
- else if (type == long_double_type_node)
- error ("use of %<long double%> in AltiVec types is invalid");
- else if (type == boolean_type_node)
- error ("use of boolean types in AltiVec types is invalid");
- else if (TREE_CODE (type) == COMPLEX_TYPE)
- error ("use of %<complex%> in AltiVec types is invalid");
- else if (DECIMAL_FLOAT_MODE_P (mode))
- error ("use of decimal floating point types in AltiVec types is invalid");
switch (altivec_type)
{
--
Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
meissner@linux.vnet.ibm.com