This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/7284] incorrectly simplifies leftshift followed by signed power-of-2 division
- From: "rearnsha at arm dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jul 2003 09:52:29 -0000
- Subject: [Bug c/7284] incorrectly simplifies leftshift followed by signed power-of-2 division
- References: <20020712042600.7284.algrant@acm.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7284
------- Additional Comments From rearnsha at arm dot com 2003-07-16 09:52 -------
Subject: Re: incorrectly simplifies leftshift followed by
signed power-of-2 division
> > if the result is *implementation-defined*, it probably
> > shouldn't vary depending on optimization level
>
> "Implementation" includes the specific set of command-line
> options. See C99 3.10.
>
Even if I bought that idea (and I don't particularly in this case):
1) We are talking about C90 specified behaviour
2) An implementation still has to document what the behaviour is for each
option (that's the "defined" bit :-)
What we have at present is -O gives undefined behaviour...
R.