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 rr Homepage E-mail, Berlin, Germany, 18.09.2008, 11:37

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

That's also in the docs. ;-)

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

But why is, e.g., Zlib faster then, if -fno-strict-aliasing turns off that optimization?

> So it turns off a valid optimization. It is afaik a typical optimization
> that is turned globally off if "strange" things happen.

I see. ;-)

---
Forum admin

 

Complete thread:

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