public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "kwieder at polytechnic dot edu.na" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/55885] Modulo operator crashes for int and long variables if they have minimal value Date: Sun, 06 Jan 2013 12:45:00 -0000 [thread overview] Message-ID: <bug-55885-4-9n24ioRtYH@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-55885-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55885 --- Comment #4 from kwieder at polytechnic dot edu.na 2013-01-06 12:44:42 UTC --- Hi Jonathan, According to the the standard C++ implementation (a % -b) <==> (a % b), therefore (INT_MIN % -1) <==> (INT_MIN %1) == 0 Neither INT_MIN % -1 nor INT_MIN %1 require a division, therefore there should be no undefined behaviour in the first place. Regards, Klaus On Jan 6, 2013, at 2:26 PM, redi at gcc dot gnu.org wrote: --- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-01-06 12:26:13 UTC --- Are you asking why undefined behaviour doesn't have consistent results?
next prev parent reply other threads:[~2013-01-06 12:45 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-01-06 10:50 [Bug c++/55885] New: " klaus.wieder at endolandia dot de 2013-01-06 11:01 ` [Bug c++/55885] " schwab@linux-m68k.org 2013-01-06 12:14 ` kwieder at polytechnic dot edu.na 2013-01-06 12:26 ` redi at gcc dot gnu.org 2013-01-06 12:45 ` kwieder at polytechnic dot edu.na [this message] 2013-01-07 15:34 ` joseph at codesourcery dot com 2021-08-22 21:52 ` pinskia at gcc dot gnu.org 2021-08-22 21:53 ` pinskia at gcc dot gnu.org 2021-08-22 21:56 ` pinskia at gcc dot gnu.org
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=bug-55885-4-9n24ioRtYH@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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).