public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Khalid Aziz <khalid_aziz@hp.com>
To: linux-ia64@vger.kernel.org
Subject: Divide by zero works on ia64!!!
Date: Mon, 09 May 2005 15:23:07 +0000	[thread overview]
Message-ID: <1115652187.28663.4.camel@lyra.fc.hp.com> (raw)

Following program causes floating point exception on x86 (compiled with
gcc 3.3.5 (Debian 1:3.3.5-8)) as expected, but runs fine on ia64 when
compiled with gcc (GCC) 3.3.5 (Debian 1:3.3.5-8).

main()
{
        int a, b;

        a = b = 0;
        printf("a = %d, b = %d, a/b = %d\n", a, b, a/b);
        a = 1;
        b = 0;
        printf("a = %d, b = %d, a/b = %d\n", a, b, a/b);
}

Here is what I get on a machine running 2.6.10 kernel:

# ./tst
a = 0, b = 0, a/b = 0
a = 1, b = 0, a/b = 0

Someone else tried Intel compiler and it generated code that caused
floating point exception as it should.

Something is busted in gcc.

-- 
Khalid

==================================
Khalid Aziz                       Open Source and Linux Organization
(970)898-9214                                        Hewlett-Packard
khalid.aziz@hp.com                                  Fort Collins, CO

"The Linux kernel is subject to relentless development" 
                                - Alessandro Rubini


             reply	other threads:[~2005-05-09 15:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-09 15:23 Khalid Aziz [this message]
2005-05-09 15:56 ` Divide by zero works on ia64!!! Andreas Schwab
2005-05-09 20:37 ` Gerald Pfeifer
2005-05-09 21:25 ` Khalid Aziz
2005-05-09 21:54 ` Gerald Pfeifer
2005-05-11 18:36 ` James E Wilson

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=1115652187.28663.4.camel@lyra.fc.hp.com \
    --to=khalid_aziz@hp.com \
    --cc=linux-ia64@vger.kernel.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: link
Be 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