http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55885



--- Comment #2 from kwieder at polytechnic dot edu.na 2013-01-06 12:14:16 UTC 
---

Thanks for the quick response.



Why is    



    INT_MIN  % -1 



ok



and why is 



    int b = -1;

    INT_MIN % b 



not ok.



I"m well aware of  INT_MIN /  -1 is overflowing. If your are using a division

for the % operator, which you probably do, then INT_MIN % -1 should also crash.



Regards,

Klaus 







On Jan 6, 2013, at 1:01 PM, sch...@linux-m68k.org wrote:



> if they have minimal value

> 

> Date: Sun, 06 Jan 2013 11:01:33 +0000

> 

> X-Bugzilla-Reason: Reporter

> 

> X-Bugzilla-Type: changed

> 

> X-Bugzilla-Watch-Reason: None

> 

> X-Bugzilla-Product: gcc

> 

> X-Bugzilla-Component: c++

> 

> X-Bugzilla-Keywords: 

> 

> X-Bugzilla-Severity: normal

> 

> X-Bugzilla-Who: sch...@linux-m68k.org

> 

> X-Bugzilla-Status: RESOLVED

> 

> X-Bugzilla-Priority: P3

> 

> X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org

> 

> X-Bugzilla-Target-Milestone: ---

> 

> X-Bugzilla-Changed-Fields: Status Resolution

> 

> Message-ID: <bug-55885-22726-gx0wfhk...@http.gcc.gnu.org/bugzilla/>

> 

> In-Reply-To: <bug-55885-22...@http.gcc.gnu.org/bugzilla/>

> 

> References: <bug-55885-22...@http.gcc.gnu.org/bugzilla/>

> 

> X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/

> 

> Auto-Submitted: auto-generated

> 

> Content-Type: text/plain; charset="UTF-8"

> 

> MIME-Version: 1.0

> 

> 

> 

> 

> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55885

> 

> 

> 

> Andreas Schwab <sch...@linux-m68k.org> changed:

> 

> 

> 

>           What    |Removed                     |Added

> 

> ----------------------------------------------------------------------------

> 

>             Status|UNCONFIRMED                 |RESOLVED

> 

>         Resolution|                            |INVALID

> 

> 

> 

> --- Comment #1 from Andreas Schwab <sch...@linux-m68k.org> 2013-01-06 
> 11:01:33 UTC ---

> 

> INT_MIN % -1 is undefined due to overflow.  -fwrapv has no effect on division

> 

> operations.

> 

> 

> 

> -- 

> 

> Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email

> 

> ------- You are receiving this mail because: -------

> 

> You reported the bug.

Reply via email to