-fno-strict-aliasing in CWARNFLAGS?

Gaetan Nadon memsize at videotron.ca
Tue Feb 2 18:42:14 PST 2010


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.
> >>> 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 that could be beneficial.
> >>> 
> >>> This option has been there for so long (most likely copied along), I
> >>> doubt you will will get a clear answer for each of the 240 xorg modules.
> >>> It would take a few modules to try it out first.
> >> 
> >> I see it in libX11 has historically used -fno-strict-aliasing:
> >> http://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=db7c6fdeeaef9475458498e4cf09d6b1329e9aa3
> >> 
> >> but adding XORG_CWARNFLAGS to XORG_DEFAULT_OPTIONS has caused this to change for other modules.
> >> 
> >> Looking at historic versions of modules, I see it present in:
> >> 
> >> libICE
> >> libSM
> >> libX11
> >> libXau
> >> libXfont
> >> libXft
> >> libXpm
> >> libXres
> >> xorg-server
> >> 
> >> of course most of these seem to have just copied the entire GCC_WARNINGS block and probably didn't actually need -fno-strict-aliasing
> > 
> > Of course. Whatever the reasons were, if anyone remembers, may not apply
> > anymore. Devising a plan for it's removal will not be an easy task. I
> > see 3 options:
> > 
> > 1) take it out of macros, 1 patch
> 
> I sent that patch already.
> 
> > 2) transfer it to all makefiles and then removing it gradually, that's
> > 2*240 +1 patches
> 
> I don't think that's wise.  If anything, you should just put it in the ones where it was prior to XORG_CWARNFLAGS (the 9 mentioned above).
> 
> That being said, I also enabled the warning which should mention when it discovers code sensitive to the -fstrict-aliasing optimization, and none of the libs in the list above spewed such a warning.
> 
> > 3) override in 'n' makefiles until proven safe. Then take it out macros.
> > That's 2*n +1 patches.
> 
> We could do that for the 9 modules above.  I'm fairly confident that the libs don't need it, but I haven't rebuilt all of the server to be confident it doesn't spew any warnings about strict-aliasing.



Oh, just 9. It thought these were just examples and that there were many more. I noticed the patch later, sorry. I had a quick look in xserver and I saw some warnings, as expected.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.x.org/archives/xorg-devel/attachments/20100202/fc2009ce/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.x.org/archives/xorg-devel/attachments/20100202/fc2009ce/attachment.pgp 


More information about the xorg-devel mailing list