Re: -fno-strict-aliasing in CWARNFLAGS?

2010-02-03 Thread Michel Dänzer
On Tue, 2010-02-02 at 16:18 -0500, Gaetan Nadon wrote: On Tue, 2010-02-02 at 09:28 -0800, Jeremy Huddleston wrote: What's the rationale behind having -fno-strict-aliasing in CWARNFLAGS? Do we actually have code somewhere that needs -fno-strict-aliasing? If so, we should restrict

Re: -fno-strict-aliasing in CWARNFLAGS?

2010-02-03 Thread Michel Dänzer
On Wed, 2010-02-03 at 10:15 +, Colin Harrison wrote: Michel Dänzer wrote: Traditionally, -fno-strict-aliasing was definitely necessary for the X server and/or some drivers to work correctly. Strict aliasing used to be a can'o worms... http://lkml.org/lkml/2003/2/26/158 and

Re: -fno-strict-aliasing in CWARNFLAGS?

2010-02-03 Thread Dan Nicholson
2010/2/3 Michel Dänzer mic...@daenzer.net: On Tue, 2010-02-02 at 16:18 -0500, Gaetan Nadon wrote: On Tue, 2010-02-02 at 09:28 -0800, Jeremy Huddleston wrote: What's the rationale behind having -fno-strict-aliasing in CWARNFLAGS? Do we actually have code somewhere that needs

Re: -fno-strict-aliasing in CWARNFLAGS?

2010-02-03 Thread Dan Nicholson
2010/2/3 Michel Dänzer mic...@daenzer.net: On Wed, 2010-02-03 at 10:15 +, Colin Harrison wrote: Michel Dänzer wrote: Traditionally, -fno-strict-aliasing was definitely necessary for the X server and/or some drivers to work correctly. Strict aliasing used to be a can'o worms...

Re: -fno-strict-aliasing in CWARNFLAGS?

2010-02-03 Thread Jeremy Huddleston
Ok. In light of the discussion here, I think it would be best to take Gaetan's option 3 here: 1) We should turn -fno-strict-aliasing on in the 9 (note that this number does not include xf86 drivers) modules that traditionally had it: libICE libSM libX11 libXau libXfont libXft libXpm

Re: -fno-strict-aliasing in CWARNFLAGS?

2010-02-03 Thread Peter Harris
On 2010-02-03 15:02, Michael Cree wrote: On 04/02/10 07:55, Soeren Sandmann wrote: I recently turned it on in pixman because completely reasonable code like this: void pixman_contract (uint32_t * dst, const uint64_t *src, int

Re: -fno-strict-aliasing in CWARNFLAGS?

2010-02-03 Thread Michael Cree
On 04/02/10 09:17, Peter Harris wrote: On 2010-02-03 15:02, Michael Cree wrote: On 04/02/10 07:55, Soeren Sandmann wrote: I recently turned it on in pixman because completely reasonable code like this: void pixman_contract (uint32_t * dst, const

Re: -fno-strict-aliasing in CWARNFLAGS?

2010-02-03 Thread Gaetan Nadon
On Wed, 2010-02-03 at 11:35 -0800, Jeremy Huddleston wrote: Ok. In light of the discussion here, I think it would be best to take Gaetan's option 3 here: 1) We should turn -fno-strict-aliasing on in the 9 (note that this number does not include xf86 drivers) modules that

Re: -fno-strict-aliasing in CWARNFLAGS?

2010-02-03 Thread Soeren Sandmann
Michael Cree mc...@orcon.net.nz writes: What I do see is that the variables a, r, g and b are essentially declared unsigned char (what I presume uint8_t is typedefed to) and a calculation is performed that will lose its intended result due to shifting an unsigned char more bits to the left

Re: -fno-strict-aliasing in CWARNFLAGS?

2010-02-03 Thread Michael Cree
On 04/02/10 14:28, Soeren Sandmann wrote: Michael Creemc...@orcon.net.nz writes: What I do see is that the variables a, r, g and b are essentially declared unsigned char (what I presume uint8_t is typedefed to) and a calculation is performed that will lose its intended result due to

Re: -fno-strict-aliasing in CWARNFLAGS?

2010-02-02 Thread Gaetan Nadon
On Tue, 2010-02-02 at 09:28 -0800, Jeremy Huddleston wrote: What's the rationale behind having -fno-strict-aliasing in CWARNFLAGS? Do we actually have code somewhere that needs -fno-strict-aliasing? If so, we should restrict -fno-strict-aliasing to that project (and try to address the

Re: -fno-strict-aliasing in CWARNFLAGS?

2010-02-02 Thread Jeremy Huddleston
On Feb 2, 2010, at 13:18, Gaetan Nadon wrote: I have not seen any compelling reasons to turn off this optimization. Maybe 10 years ago when it was first introduced. I have seen reports of large number of warnings, but from older gcc versions. As it is today, we are losing some optimization

Re: -fno-strict-aliasing in CWARNFLAGS?

2010-02-02 Thread Gaetan Nadon
On Tue, 2010-02-02 at 14:00 -0800, Jeremy Huddleston wrote: On Feb 2, 2010, at 13:18, Gaetan Nadon wrote: I have not seen any compelling reasons to turn off this optimization. Maybe 10 years ago when it was first introduced. I have seen reports of large number of warnings, but from older

Re: -fno-strict-aliasing in CWARNFLAGS?

2010-02-02 Thread Jeremy Huddleston
On Feb 2, 2010, at 17:11, Gaetan Nadon wrote: On Tue, 2010-02-02 at 14:00 -0800, Jeremy Huddleston wrote: On Feb 2, 2010, at 13:18, Gaetan Nadon wrote: I have not seen any compelling reasons to turn off this optimization. Maybe 10 years ago when it was first introduced. I have seen

Re: -fno-strict-aliasing in CWARNFLAGS?

2010-02-02 Thread Gaetan Nadon
On Tue, 2010-02-02 at 17:34 -0800, Jeremy Huddleston wrote: On Feb 2, 2010, at 17:11, Gaetan Nadon wrote: On Tue, 2010-02-02 at 14:00 -0800, Jeremy Huddleston wrote: On Feb 2, 2010, at 13:18, Gaetan Nadon wrote: I have not seen any compelling reasons to turn off this optimization.