This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH to c-pretty-print handling of VECTOR_TYPE


A patch I'm working on for c++/41959 will give an error in the compiler rather than the assembler when we see a mangled name collision, but the error was a bit confusing:

error: declaration of 'void f(float __vector__)'
error: conflicts with previous declaration 'void f(float __vector__)'

when in fact the two argument types have different vector sizes. So this patch changes them to "float __vector[4]" and "float __vector[8]".

OK for 4.5 or 4.6?
commit 4fef27f1ee453b77c27b09250893716f0ff6496b
Author: Jason Merrill <jason@redhat.com>
Date:   Tue Mar 2 12:05:20 2010 -0500

    	* c-pretty-print.c (pp_c_specifier_qualifier_list): Print vector size.

diff --git a/gcc/c-pretty-print.c b/gcc/c-pretty-print.c
index 352ee09..2972a26 100644
--- a/gcc/c-pretty-print.c
+++ b/gcc/c-pretty-print.c
@@ -458,7 +458,12 @@ pp_c_specifier_qualifier_list (c_pretty_printer *pp, tree t)
       if (code == COMPLEX_TYPE)
 	pp_c_ws_string (pp, flag_isoc99 ? "_Complex" : "__complex__");
       else if (code == VECTOR_TYPE)
-	pp_c_ws_string (pp, "__vector__");
+	{
+	  pp_c_ws_string (pp, "__vector");
+	  pp_c_left_bracket (pp);
+	  pp_wide_integer (pp, TYPE_VECTOR_SUBPARTS (t));
+	  pp_c_right_bracket (pp);
+	}
       break;
 
     default:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]