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]

vect pat recog fails in sbitmap.c on ia64


A -O3 bootstrap on ia64-linux-gnu crashes building sbitmap.c in stage2.
The problem is that get_vectype_for_scalar_type (type_out = <unsigned
long int>) returns type_out = NULL, and then vect_pattern_recog_1
crashes when it attempts to take the mode of the returned type.

I'm not sure whether returning immediately (like we do for type_in) or
using the original scalar type_out is best.  The latter is what I
regstrapped on ia64-linux-gnu.  Ok to install?

for  gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* tree-vect-patterns.c (vect_pattern_recog_1): Use scalar type
	if we don't get a vector type for output.

Index: gcc/tree-vect-patterns.c
===================================================================
--- gcc/tree-vect-patterns.c.orig	2010-06-10 14:28:05.000000000 -0300
+++ gcc/tree-vect-patterns.c	2010-06-10 14:29:26.000000000 -0300
@@ -696,7 +696,12 @@ vect_pattern_recog_1 (
       if (!type_in)
 	return;
       if (type_out)
-	type_out = get_vectype_for_scalar_type (type_out);
+	{
+	  tree saved_type_out = type_out;
+	  type_out = get_vectype_for_scalar_type (type_out);
+	  if (!type_out)
+	    type_out = saved_type_out;
+	}
       else
 	type_out = type_in;
       pattern_vectype = type_out;
-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer

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