GCC's "-fno-strict-aliasing"? (Developers)
> Can anyone explain GCC's -fno-strict-aliasing to me? It's used
> by QEMU. I've read the docs, but still don't have clue, when what it's for
> and it's save to use. Explanations in German preferred. 
As far as I know does the C standard has a few rules about aliassing. An alias is e.g. if you have two pointers of different types, then C assumes that they can't point to the same memory. (IOW one can't be an alias of the other)
A compiler can use that to optimize and reorder statements and assignments.
-fno-strict-aliasing turns of that optimization, IOW their code is dirty and not ANSI C compatible.
So it turns off a valid optimization. It is afaik a typical optimization that is turned globally off if "strange" things happen.
Complete thread:
- GCC's "-fno-strict-aliasing"? - rr, 17.09.2008, 18:01 (Developers)
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- GCC's "-fno-strict-aliasing"? - marcov, 18.09.2008, 10:30
- GCC's "-fno-strict-aliasing"? - rr, 18.09.2008, 11:37
- GCC's "-fno-strict-aliasing"? - marcov, 18.09.2008, 13:20
- GCC's "-fno-strict-aliasing"? - RayeR, 18.09.2008, 14:10
- GCC's "-fno-strict-aliasing"? - rr, 18.09.2008, 11:37
- GCC's "-fno-strict-aliasing"? - rr, 25.09.2008, 16:38
- GCC's "-fno-strict-aliasing"? - RayeR, 29.09.2008, 17:09
- GCC's "-fno-strict-aliasing"? - marcov, 18.09.2008, 10:30
Mix view