Re: Bootstrap broken in libobjc/sendmsg.c

2013-09-06 Thread H.J. Lu
On Fri, Sep 6, 2013 at 7:40 AM, Jan Hubicka  wrote:
>> On Fri, Sep 06, 2013 at 02:38:01PM +0200, Jan Hubicka wrote:
>> > > > .. looks like this is target/58269, which therefore affects
>> > > > x86_64-linux too.
>> > >
>> > > Now this reproduces to me, too.  apppy_args expansion is trying to 
>> > > preserve AVX
>> > > register in V8SF mode when AVX is disabled.  This leads to move expander 
>> > > to not
>> > > allow moving it and we end up infinitely recursing trying to expand the 
>> > > move.
>> > > I am not sure what change triggered it.  I am looking into fix.
>> >
>> > I am testing the following.  Obviously AVX mode is not OK for SSE reg
>> > when AVX is disabled.  Other code paths allowing AVX modes seems to be 
>> > propertly
>> > guarded.
>>
>> Sounds like http://gcc.gnu.org/ml/gcc-bugs/2013-09/msg00308.html
>> Please look at PR58139 and PR58269, various patches have been posted or
>> attached for that.
>>
>> BTW, I wonder why this spot doesn't contain also
>> (TARGET_AVX512F && VALID_AVX512F_REG_MODE (mode))
>
> I have tested and comitted the patch now.  Hj, can you please look into the
> (TARGET_AVX512F && VALID_AVX512F_REG_MODE (mode)) issue?  It seems like 
> obvious
> omission but I can not test the patch.

There are

  if (TARGET_AVX512F
  && (mode == XImode
  || VALID_AVX512F_REG_MODE (mode)
  || VALID_AVX512F_SCALAR_MODE (mode)))
return true;

> Honza
>>
>> > --- config/i386/i386.c  (revision 202322)
>> > +++ config/i386/i386.c  (working copy)
>> > @@ -34466,7 +34471,7 @@ ix86_hard_regno_mode_ok (int regno, enum
>> >
>> >/* OImode move is available only when AVX is enabled.  */
>> >return ((TARGET_AVX && mode == OImode)
>> > - || VALID_AVX256_REG_MODE (mode)
>> > + || (TARGET_AVX && VALID_AVX256_REG_MODE (mode))
>> >   || VALID_SSE_REG_MODE (mode)
>> >   || VALID_SSE2_REG_MODE (mode)
>> >   || VALID_MMX_REG_MODE (mode)
>>

Or we can do

  return ((TARGET_AVX && VALID_AVX256_REG_OR_OI_MODE (mode))
  || VALID_SSE_REG_MODE (mode)
  || VALID_SSE2_REG_MODE (mode)
  || VALID_MMX_REG_MODE (mode)
  || VALID_MMX_REG_MODE_3DNOW (mode));

-- 
H.J.


Re: Bootstrap broken in libobjc/sendmsg.c

2013-09-06 Thread Jan Hubicka
> On Fri, Sep 06, 2013 at 02:38:01PM +0200, Jan Hubicka wrote:
> > > > .. looks like this is target/58269, which therefore affects
> > > > x86_64-linux too.
> > > 
> > > Now this reproduces to me, too.  apppy_args expansion is trying to 
> > > preserve AVX
> > > register in V8SF mode when AVX is disabled.  This leads to move expander 
> > > to not
> > > allow moving it and we end up infinitely recursing trying to expand the 
> > > move.
> > > I am not sure what change triggered it.  I am looking into fix.
> > 
> > I am testing the following.  Obviously AVX mode is not OK for SSE reg
> > when AVX is disabled.  Other code paths allowing AVX modes seems to be 
> > propertly
> > guarded.
> 
> Sounds like http://gcc.gnu.org/ml/gcc-bugs/2013-09/msg00308.html
> Please look at PR58139 and PR58269, various patches have been posted or
> attached for that.
> 
> BTW, I wonder why this spot doesn't contain also
> (TARGET_AVX512F && VALID_AVX512F_REG_MODE (mode))

I have tested and comitted the patch now.  Hj, can you please look into the
(TARGET_AVX512F && VALID_AVX512F_REG_MODE (mode)) issue?  It seems like obvious
omission but I can not test the patch.

Honza
> 
> > --- config/i386/i386.c  (revision 202322)
> > +++ config/i386/i386.c  (working copy)
> > @@ -34466,7 +34471,7 @@ ix86_hard_regno_mode_ok (int regno, enum
> >  
> >/* OImode move is available only when AVX is enabled.  */
> >return ((TARGET_AVX && mode == OImode)
> > - || VALID_AVX256_REG_MODE (mode)
> > + || (TARGET_AVX && VALID_AVX256_REG_MODE (mode))
> >   || VALID_SSE_REG_MODE (mode)
> >   || VALID_SSE2_REG_MODE (mode)
> >   || VALID_MMX_REG_MODE (mode)
> 
>   Jakub


Re: Bootstrap broken in libobjc/sendmsg.c

2013-09-06 Thread Jakub Jelinek
On Fri, Sep 06, 2013 at 02:38:01PM +0200, Jan Hubicka wrote:
> > > .. looks like this is target/58269, which therefore affects
> > > x86_64-linux too.
> > 
> > Now this reproduces to me, too.  apppy_args expansion is trying to preserve 
> > AVX
> > register in V8SF mode when AVX is disabled.  This leads to move expander to 
> > not
> > allow moving it and we end up infinitely recursing trying to expand the 
> > move.
> > I am not sure what change triggered it.  I am looking into fix.
> 
> I am testing the following.  Obviously AVX mode is not OK for SSE reg
> when AVX is disabled.  Other code paths allowing AVX modes seems to be 
> propertly
> guarded.

Sounds like http://gcc.gnu.org/ml/gcc-bugs/2013-09/msg00308.html
Please look at PR58139 and PR58269, various patches have been posted or
attached for that.

BTW, I wonder why this spot doesn't contain also
(TARGET_AVX512F && VALID_AVX512F_REG_MODE (mode))

> --- config/i386/i386.c(revision 202322)
> +++ config/i386/i386.c(working copy)
> @@ -34466,7 +34471,7 @@ ix86_hard_regno_mode_ok (int regno, enum
>  
>/* OImode move is available only when AVX is enabled.  */
>return ((TARGET_AVX && mode == OImode)
> -   || VALID_AVX256_REG_MODE (mode)
> +   || (TARGET_AVX && VALID_AVX256_REG_MODE (mode))
> || VALID_SSE_REG_MODE (mode)
> || VALID_SSE2_REG_MODE (mode)
> || VALID_MMX_REG_MODE (mode)

Jakub


Re: Bootstrap broken in libobjc/sendmsg.c

2013-09-06 Thread Jan Hubicka
> > .. looks like this is target/58269, which therefore affects
> > x86_64-linux too.
> 
> Now this reproduces to me, too.  apppy_args expansion is trying to preserve 
> AVX
> register in V8SF mode when AVX is disabled.  This leads to move expander to 
> not
> allow moving it and we end up infinitely recursing trying to expand the move.
> I am not sure what change triggered it.  I am looking into fix.

I am testing the following.  Obviously AVX mode is not OK for SSE reg
when AVX is disabled.  Other code paths allowing AVX modes seems to be propertly
guarded.

Index: config/i386/i386.c
===
--- config/i386/i386.c  (revision 202322)
+++ config/i386/i386.c  (working copy)
@@ -34466,7 +34471,7 @@ ix86_hard_regno_mode_ok (int regno, enum
 
   /* OImode move is available only when AVX is enabled.  */
   return ((TARGET_AVX && mode == OImode)
- || VALID_AVX256_REG_MODE (mode)
+ || (TARGET_AVX && VALID_AVX256_REG_MODE (mode))
  || VALID_SSE_REG_MODE (mode)
  || VALID_SSE2_REG_MODE (mode)
  || VALID_MMX_REG_MODE (mode)


Re: Bootstrap broken in libobjc/sendmsg.c

2013-09-06 Thread Jan Hubicka
> .. looks like this is target/58269, which therefore affects
> x86_64-linux too.

Now this reproduces to me, too.  apppy_args expansion is trying to preserve AVX
register in V8SF mode when AVX is disabled.  This leads to move expander to not
allow moving it and we end up infinitely recursing trying to expand the move.
I am not sure what change triggered it.  I am looking into fix.

Honza


Re: Bootstrap broken in libobjc/sendmsg.c

2013-09-06 Thread Paolo Carlini

Hi,

On 09/06/2013 01:46 PM, Peter Bergner wrote:

On Fri, 2013-09-06 at 13:36 +0200, Paolo Carlini wrote:

. on x86_64-linux, this commit broke the build of that file:

http://gcc.gnu.org/ml/gcc-cvs/2013-09/msg00149.html

CC-ing Peter.

Can you try the patch that HJ suggested?

   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58139#c9
Thanks. It works, in the sense that the file compiles again for me and a 
quick build completes. Whether it's the right thing to do, I can't say 
of course.


Paolo.


Re: Bootstrap broken in libobjc/sendmsg.c

2013-09-06 Thread Peter Bergner
On Fri, 2013-09-06 at 13:36 +0200, Paolo Carlini wrote:
> . on x86_64-linux, this commit broke the build of that file:
> 
> http://gcc.gnu.org/ml/gcc-cvs/2013-09/msg00149.html
> 
> CC-ing Peter.

Can you try the patch that HJ suggested?

  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58139#c9

Peter





Re: Bootstrap broken in libobjc/sendmsg.c

2013-09-06 Thread Paolo Carlini

. on x86_64-linux, this commit broke the build of that file:

http://gcc.gnu.org/ml/gcc-cvs/2013-09/msg00149.html

CC-ing Peter.

Thanks,
Paolo.


Re: Bootstrap broken in libobjc/sendmsg.c

2013-09-06 Thread Paolo Carlini
.. looks like this is target/58269, which therefore affects 
x86_64-linux too.


Paolo.