Closed
Bug 413253
Opened 17 years ago
Closed 17 years ago
build with -fno-strict-aliasing on GCC platforms
Categories
(Firefox Build System :: General, defect, P1)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: sayrer, Assigned: sayrer)
References
Details
Attachments
(1 file)
(deleted),
patch
|
ted
:
review+
|
Details | Diff | Splinter Review |
msvc has this off by default. We get way too many warnings to ship with this turned on.
Assignee | ||
Updated•17 years ago
|
Flags: blocking1.9?
Comment 1•17 years ago
|
||
This should solve bug 403783 and bug 409881
Comment 3•17 years ago
|
||
If -fno-strict-aliasing works on all versions of GCC, then probably here: http://mxr.mozilla.org/mozilla/source/configure.in#1235
CFLAGS="$CFLAGS -fno-strict-aliasing"
and below in the equivalent C++ block.
If we need to do a configure check, then you'll have to put it below, something like this: http://mxr.mozilla.org/mozilla/source/configure.in#2663
Comment 4•17 years ago
|
||
Strict aliasing was a perf win on older GCCs when turned on, IIRC. I remember in JS we did some work to use unions and GCC extensions. Anyone remember or have a bug with data to cite?
Would like to get stricter, cross-platform, for Mozilla 2. Thoughts on how to get there?
/be
Comment 5•17 years ago
|
||
-fno-strict-aliasing is available on all the versions of GCC we use.
From the manual's description of -fstrict-aliasing: "Allows the compiler to assume the strictest aliasing rules applicable to the language being compiled. For C (and C++), this activates optimizations based on the type of expressions. In particular, an object of one type is assumed never to reside at the same address as an object of a different type, unless the types are almost the same. For example, an unsigned int can alias an int, but not a void* or a double."
So with -fno-strict-aliasing, the compiler is being more conservative, and possibly losing some optimization opportunities. The right thing for best performance longterm is to clear out all the warnings, so this flag is no longer needed.
Updated•17 years ago
|
Flags: blocking1.9? → blocking1.9+
Priority: -- → P1
Comment 6•17 years ago
|
||
If we do change this, we should grep an existing log for this error and attach it to a followup so it can be fixed in the future. (Maybe via automated rewrite?)
Comment 7•17 years ago
|
||
Does "all the versions of GCC we use" include 3.4? We need to keep working with GCC 3.4 for a while yet because elsa doesn't work on newer versions.
Comment 8•17 years ago
|
||
Yes, the flag goes back to version 2 at least, maybe even version 1.
Comment 9•17 years ago
|
||
Ping on this since b3 freeze comin up!
Comment 10•17 years ago
|
||
How about adding the -fno-strict-aliasing flag by default, and providing a configure option to disable adding that for anyone who wants to take a stab at fixing some of them?
Comment 11•17 years ago
|
||
Does -fno-strict-aliasing disable the warnings? We could explicitly re-enable them with -Wstrict-aliasing
Comment 12•17 years ago
|
||
-fno-strict-aliasing disables the warnings, and makes -Wstrict-aliasing a no-op.
Assignee | ||
Comment 13•17 years ago
|
||
Doesn't -fstrict-aliasing turn it back on?
Comment 14•17 years ago
|
||
Sure, I thought what bsmedberg was trying to accomplish was allowing the warnings to be there for people who want to fix them, but still turning off optimizations based on strict aliasing rules, which isn't possible.
Comment 15•17 years ago
|
||
Who owns this?
Assignee | ||
Comment 17•17 years ago
|
||
Attachment #300084 -
Flags: review?(ted.mielczarek)
Comment 18•17 years ago
|
||
Comment on attachment 300084 [details] [diff] [review]
add to default gcc flags
Should have an XXX comment with a followup bug, but r=me.
Attachment #300084 -
Flags: review?(ted.mielczarek) → review+
Assignee | ||
Updated•17 years ago
|
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Comment 19•17 years ago
|
||
So, if you'd put the -fno-strict-aliasing first, wouldn't that have allowed people to override it in their mozconfigs if they wanted to?
Updated•7 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•