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]

Re: PATCH: PR target/53425: No warnings are given for -mno-sse


On Sun, May 20, 2012 at 11:53 PM, H.J. Lu <hjl.tools@gmail.com> wrote:

>>> We should warn passing SSE vector argument without SSE enabled changes
>>> the ABI for 64-bit. Tested on Linux/x86-64. ?OK to install?

>>> @@ -5828,7 +5833,22 @@ type_natural_mode (const_tree type, const CUMULATIVE_ARGS *cum)
>>> ? ? ? ? ? ? ? ? ? ?return TYPE_MODE (type);
>>> ? ? ? ? ? ? ? ? ?}
>>> ? ? ? ? ? ? ? ?else
>>> - ? ? ? ? ? ? ? ? return mode;
>>> + ? ? ? ? ? ? ? ? {
>>
>> No need for these outermost braces.
>
> It is needed to avoid
>
> /export/gnu/import/git/gcc/gcc/config/i386/i386.c: In function
> \u2018type_natural_mode\u2019:
> /export/gnu/import/git/gcc/gcc/config/i386/i386.c:5813:9: warning:
> suggest explicit braces to avoid ambiguous \u2018else\u2019
> [-Wparentheses]

Sure, you need

else if ( ... )
  {
     ...
  }
else
  return mode;

there.

>> BTW: Can you please also add MMX warning for -mno-mmx to be consistent
>> with 32bit targets?
>
> 64-bit passes 8-byte vector in SSE register, not MMX register.
> I updated the patch to want 8-byte vector. Is this patch OK?
>
> Thanks.
>
> --
> H.J.
> ----
> gcc/
>
> 2012-05-20 ?H.J. Lu ?<hongjiu.lu@intel.com>
>
> ? ? ? ?PR target/53425
> ? ? ? ?* config/i386/i386.c (type_natural_mode): Warn passing SSE
> ? ? ? ?vector argument without SSE enabled changes the ABI.
>
> gcc/testsuite/
>
> 2012-05-20 ?H.J. Lu ?<hongjiu.lu@intel.com>
>
> ? ? ? ?PR target/53425
> ? ? ? ?* gcc.target/i386/pr53425-1.c: New file.
> ? ? ? ?* gcc.target/i386/pr53425-2.c: Likewise.

OK with the above change.

Thanks,
Uros.


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