Cleanup for cryptographic algorithms vs. compiler optimizations
Dag-Erling Smørgrav
des at des.no
Sun Jun 13 16:16:23 UTC 2010
Bernd Walter <ticso at cicely7.cicely.de> writes:
> Dag-Erling Smørgrav <des at des.no> writes:
> > Bernd Walter <ticso at cicely7.cicely.de> writes:
> > > Amazing - this is one of the things which can get nasty if you try
> > > some kind of microtuning.
> > Only if you break the rules. Bad code is always bad, even if it
> > sometimes works by accident.
> To expect that function calls are replaced with other functions isn't a
> very obvious rule.
You don't need to know that gcc replaces printf() with puts(). That's
the whole point of the as-if rule: the compiler can only modify the
program in ways that do not change observable behavior.
The only way you can tell that gcc did it is if you break the rules,
such as by defining your own version of printf() or puts().
DES
--
Dag-Erling Smørgrav - des at des.no
More information about the freebsd-current
mailing list