public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* vect pat recog fails in sbitmap.c on ia64
@ 2010-06-11 19:58 Alexandre Oliva
  2010-06-12  0:46 ` Richard Guenther
  0 siblings, 1 reply; 3+ messages in thread
From: Alexandre Oliva @ 2010-06-11 19:58 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 458 bytes --]

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?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: tree-vect-recog-no-out.patch --]
[-- Type: text/x-diff, Size: 775 bytes --]

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;

[-- Attachment #3: Type: text/plain, Size: 257 bytes --]


-- 
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: vect pat recog fails in sbitmap.c on ia64
  2010-06-11 19:58 vect pat recog fails in sbitmap.c on ia64 Alexandre Oliva
@ 2010-06-12  0:46 ` Richard Guenther
  2010-06-15 13:45   ` Alexandre Oliva
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Guenther @ 2010-06-12  0:46 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: gcc-patches

On Fri, Jun 11, 2010 at 9:25 PM, Alexandre Oliva <aoliva@redhat.com> wrote:
> 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?

You should instead bail out immediately.

Ok with that change.

Thanks,
Richard.

>
>
> --
> 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
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: vect pat recog fails in sbitmap.c on ia64
  2010-06-12  0:46 ` Richard Guenther
@ 2010-06-15 13:45   ` Alexandre Oliva
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Oliva @ 2010-06-15 13:45 UTC (permalink / raw)
  To: Richard Guenther; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 540 bytes --]

On Jun 11, 2010, Richard Guenther <richard.guenther@gmail.com> wrote:

> On Fri, Jun 11, 2010 at 9:25 PM, Alexandre Oliva <aoliva@redhat.com> wrote:
>> 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.

> You should instead bail out immediately.

> Ok with that change.

Thanks, here's what I'm checking in.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: tree-vect-recog-no-out.patch --]
[-- Type: text/x-diff, Size: 642 bytes --]

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

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

Index: gcc/tree-vect-patterns.c
===================================================================
--- gcc/tree-vect-patterns.c.orig	2010-06-14 16:08:23.000000000 -0300
+++ gcc/tree-vect-patterns.c	2010-06-14 16:25:04.000000000 -0300
@@ -699,6 +699,8 @@ vect_pattern_recog_1 (
 	type_out = get_vectype_for_scalar_type (type_out);
       else
 	type_out = type_in;
+      if (!type_out)
+	return;
       pattern_vectype = type_out;
 
       if (is_gimple_assign (pattern_stmt))

[-- Attachment #3: Type: text/plain, Size: 257 bytes --]


-- 
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-06-15 12:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-11 19:58 vect pat recog fails in sbitmap.c on ia64 Alexandre Oliva
2010-06-12  0:46 ` Richard Guenther
2010-06-15 13:45   ` Alexandre Oliva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).