public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug c/29511] New: 0x80000000/-1 causes FPE on Intel/AMD @ 2006-10-19 8:02 Eric dot Deplagne at nerim dot net 2006-10-19 8:39 ` [Bug c/29511] " schwab at suse dot de 2006-10-19 8:58 ` Eric dot Deplagne at nerim dot net 0 siblings, 2 replies; 4+ messages in thread From: Eric dot Deplagne at nerim dot net @ 2006-10-19 8:02 UTC (permalink / raw) To: gcc-bugs The division of 0x80000000 by -1 gives FPE on both Intel and AMD Processors... I have checked that with the following simple program on both Fedora core 3's GCC 3.4.4 and debian sarge's gcc-3.3.5... I also had someone check it with gcc 4.1.2 and FreeBSD too... int divide(int a,int b) { return a/b; } int main(void) { return divide(0x80000000,-1); } and what I get is: ./test Floating point exception And GDB says "Program received signal SIGFPE, Arithmetic exception." -- Summary: 0x80000000/-1 causes FPE on Intel/AMD Product: gcc Version: 3.4.4 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: Eric dot Deplagne at nerim dot net http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29511 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/29511] 0x80000000/-1 causes FPE on Intel/AMD 2006-10-19 8:02 [Bug c/29511] New: 0x80000000/-1 causes FPE on Intel/AMD Eric dot Deplagne at nerim dot net @ 2006-10-19 8:39 ` schwab at suse dot de 2006-10-19 8:58 ` Eric dot Deplagne at nerim dot net 1 sibling, 0 replies; 4+ messages in thread From: schwab at suse dot de @ 2006-10-19 8:39 UTC (permalink / raw) To: gcc-bugs ------- Comment #1 from schwab at suse dot de 2006-10-19 08:39 ------- That's not a bug, the result of -2147483648/-1 is overflowing the range of int, thus invokes undefined behaviour. -- schwab at suse dot de changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29511 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/29511] 0x80000000/-1 causes FPE on Intel/AMD 2006-10-19 8:02 [Bug c/29511] New: 0x80000000/-1 causes FPE on Intel/AMD Eric dot Deplagne at nerim dot net 2006-10-19 8:39 ` [Bug c/29511] " schwab at suse dot de @ 2006-10-19 8:58 ` Eric dot Deplagne at nerim dot net 1 sibling, 0 replies; 4+ messages in thread From: Eric dot Deplagne at nerim dot net @ 2006-10-19 8:58 UTC (permalink / raw) To: gcc-bugs ------- Comment #2 from Eric dot Deplagne at nerim dot net 2006-10-19 08:58 ------- Should I assume that 4000000000+4000000000 can FPE my ass too, then ? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29511 ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <bug-29511-4@http.gcc.gnu.org/bugzilla/>]
* [Bug c/29511] 0x80000000/-1 causes FPE on Intel/AMD [not found] <bug-29511-4@http.gcc.gnu.org/bugzilla/> @ 2021-08-22 21:56 ` pinskia at gcc dot gnu.org 0 siblings, 0 replies; 4+ messages in thread From: pinskia at gcc dot gnu.org @ 2021-08-22 21:56 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=29511 Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|INVALID |DUPLICATE --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Dup of bug 55885. *** This bug has been marked as a duplicate of bug 55885 *** ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-08-22 21:56 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2006-10-19 8:02 [Bug c/29511] New: 0x80000000/-1 causes FPE on Intel/AMD Eric dot Deplagne at nerim dot net 2006-10-19 8:39 ` [Bug c/29511] " schwab at suse dot de 2006-10-19 8:58 ` Eric dot Deplagne at nerim dot net [not found] <bug-29511-4@http.gcc.gnu.org/bugzilla/> 2021-08-22 21:56 ` pinskia at gcc dot gnu.org
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).