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
Sat Mar 20 22:15:00 GMT 2010


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);
}
---

--
#include <x86intrin.h>
#include <stdlib.h>

int
foo (unsigned int x, int y)
{
  return _rotl (x, y);
}
--

--
#include <stdlib.h>
#include <x86intrin.h>

int
foo (unsigned int x, int y)
{
  return _rotl (x, y);
}
--

-- 
H.J.



More information about the Gcc-patches mailing list