public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: "Al Grant" <AlGrant@myrealbox.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: Re: Re: c/7284: incorrectly simplifies leftshift followed by signed power-of-2 division Date: Fri, 12 Jul 2002 10:16:00 -0000 [thread overview] Message-ID: <20020712171601.12533.qmail@sources.redhat.com> (raw) The following reply was made to PR c/7284; it has been noted by GNATS. From: "Al Grant" <AlGrant@myrealbox.com> To: nathan@compsci.bristol.ac.uk Cc: falk.hueffner@student.uni-tuebingen.de, nathan@gcc.gnu.org, algrant@acm.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: Re: c/7284: incorrectly simplifies leftshift followed by signed power-of-2 division Date: Fri, 12 Jul 2002 17:06:44 +0000 >you need to read more carefully. >KnR 2 A7.8 says the same as C99, You need to read more carefully. K&R2 says something quite different from = C99. It says that in the absence of overflow, the operation is equivalen= t to a multiplication. It does _not_ say that if the multiplication overflows the= result of the shift is undefined, let alone that program behavior is und= efined. >C++ says [5]/5 that if the result is not in the range >of representable va= lues, >the behaviour is undefined. But left-shift is an operation on the representation, i.e. the bit pattern.= For signed left-shift (in C89 and C++) it is not defined any other way.= How is it meaningful to talk about the representability of operations o= n the representation, and say that the result of such an operation might = be unrepresentable? Representability is a property of the integers as numbers. It might be meaningful to think about the result of such an operation havin= g a representation that did not correspond to any value (e.g. was a trap = representation) but a non-valued representation is a totally different c= oncept from a non-representable value. Besides, there are no such intege= r representations on the platform for which I reported the bug.
next reply other threads:[~2002-07-12 17:16 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-07-12 10:16 Al Grant [this message] -- strict thread matches above, loose matches on Subject: below -- 2002-07-15 5:06 Al Grant 2002-07-12 9:56 Al Grant 2002-07-12 9:16 Al Grant
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20020712171601.12533.qmail@sources.redhat.com \ --to=algrant@myrealbox.com \ --cc=gcc-prs@gcc.gnu.org \ --cc=nobody@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).