RFC: PR target/40722: [4.5 Regression] ia32intrin.h defines of _rotl, _rotr conflict with target stdlib.h decls

H.J. Lu hjl.tools@gmail.com
Sun Mar 21 07:21:00 GMT 2010


On Sat, Mar 20, 2010 at 1:57 PM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Sat, Mar 20, 2010 at 10:37 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Sat, Mar 20, 2010 at 10:40 AM, Richard Guenther
>> <richard.guenther@gmail.com> wrote:
>>> On Sat, Mar 20, 2010 at 7:08 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>>>> On Sat, Mar 20, 2010 at 10:59:35AM -0700, H.J. Lu wrote:
>>>>> Hi,
>>>>>
>>>>> stdlib.h on mingw defines some new gcc 4.5 intrinsics as normal functions.
>>>>> We can either disable gcc intrinsics on mingw or fix stdlib.h on mingw.
>>>>> But fixincludes isn't run on mingw. Here is a hack to fix stdlib.h
>>>>> mingw.
>>>>>
>>>>>
>>>>> H.J.
>>>>> ---
>>>>> 2010-03-20  H.J. Lu  <hongjiu.lu@intel.com>
>>>>>
>>>>>       PR target/40722
>>>>>       * mkfixinc.sh: Fix stdlib.h for mingw.
>>>>>
>>>>
>>>>
>>>> Of course, we need to include <x86intrin.h> for gcc 4.5 and above.
>>>> Otherwise, those functions won't be available in <stdlib.h>.
>>>
>>> Hm.  It makes more sense to disable gcc intrinsics, otherwise you'd
>>> get different behavior when compiling with different GCC versions.
>>
>> I am not familiar with mingw. We should support
>>
>> --
>> #include <x86intrin.h>
>>
>> int
>> foo (unsigned int x, int y)
>> {
>>  return _rotl (x, y);
>> }
>
> I don't think we need to support this one on mingw.  Well, _rotl was a bad
> identifier to use from x86intrin.h anyway IMHO
>

The whole idea of intrinsics in <ia32intrin.h> is to support intrinsics
provided by other x86 compilers. _rotl is one of them. On the other
hand, either way is fine with me. I will leave it to mingw maintainers.

-- 
H.J.



More information about the Gcc-patches mailing list