This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Where does the C standard describe overflow of signed integers?
- From: Avi Kivity <avi at argo dot co dot il>
- To: Paul Schlie <schlie at comcast dot net>
- Cc: Paul Koning <pkoning at equallogic dot com>, dewar at adacore dot com, mattheww at chiark dot greenend dot org dot uk, gcc at gcc dot gnu dot org
- Date: Fri, 15 Jul 2005 10:02:26 +0300
- Subject: Re: Where does the C standard describe overflow of signed integers?
- References: <BEFC5856.AD2E%schlie@comcast.net>
Paul Schlie wrote:
In that case you may want to stick with -O0. There are *lots* of
things GCC does that alter undefined cases. How about the undefined
behavior when aliasing rules are violated? Would you want to make
-fno-strict-aliasing be the only supported setting?
- Isn't the purpose of "restrict" to explicitly enable the compiler to
more aggressively optimize references which it may be not have been
able to identify it as being strictly safe? (As opposed to it feeling
compelled presume potentially disastrously otherwise, without explicit
permission to do so?)
"restrict" allows the compiler to make further assumptions than
-fstrict-aliasing. with strict aliasing, the compiler assumes that an
int pointer and a long pointer cannot refer to the same object, whereas
"restrict" allows you to specify that two int pointers do not refer to
the same object.
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.