Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

GCC's "-fno-strict-aliasing"? (Developers)

posted by marcov, 18.09.2008, 10:30

> 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:

Back to the forum
Board view  Mix view
22747 Postings in 2119 Threads, 402 registered users, 136 users online (0 registered, 136 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum