Re: Cleanup for cryptographic algorithms vs. compiler optimizations

From: Dag-Erling Smørgrav <des_at_des.no>
Date: Sun, 13 Jun 2010 18:14:11 +0200
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
Received on Sun Jun 13 2010 - 14:16:23 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:04 UTC