Divide by zero works on ia64!!!

From: Khalid Aziz <khalid_aziz_at_hp.com>
Date: 2005-05-10 01:23:07
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

-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Mon May 9 11:26:39 2005

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:38 EST