Re: Cleanup for cryptographic algorithms vs. compiler optimizations
- From: Dag-Erling Smørgrav <des@xxxxxx>
- Date: Sat, 12 Jun 2010 19:35:26 +0200
Bernd Walter <ticso@xxxxxxxxxxxxxxxxx> writes:
I'm not sure when removing a memset is allowed.
Always, if the compiler can determine that the data will not be used
later.
In more general terms, the compiler is allowed to make any changes it
likes to the program as long as the end result behaves exactly like it
would if it hadn't been changed. This is called the "as if" rule. For
instance, if you call printf() or fprintf() with a format string that
does not contain any conversion specifiers, gcc will call gets() or
fgets() instead.
Maybe passing volatile pointers might be enough.
You can't pass a volatile pointer to memset.
DES
--
Dag-Erling Smørgrav - des@xxxxxx
_______________________________________________
freebsd-current@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: Cleanup for cryptographic algorithms vs. compiler optimizations
- From: Bernd Walter
- Re: Cleanup for cryptographic algorithms vs. compiler optimizations
- References:
- Cleanup for cryptographic algorithms vs. compiler optimizations
- From: Ulrich Spörlein
- Re: Cleanup for cryptographic algorithms vs. compiler optimizations
- From: Dag-Erling Smørgrav
- Re: Cleanup for cryptographic algorithms vs. compiler optimizations
- From: Ulrich Spörlein
- Re: Cleanup for cryptographic algorithms vs. compiler optimizations
- From: Bernd Walter
- Cleanup for cryptographic algorithms vs. compiler optimizations
- Prev by Date: Re: RFC: etcupdate tool in base?
- Next by Date: [head tinderbox] failure on ia64/ia64
- Previous by thread: Re: Cleanup for cryptographic algorithms vs. compiler optimizations
- Next by thread: Re: Cleanup for cryptographic algorithms vs. compiler optimizations
- Index(es):
Relevant Pages
|