Bug 15425 - 128-bit division do not work
Summary: 128-bit division do not work
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.3.3
: P2 normal
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ABI, wrong-code
Depends on:
Blocks:
 
Reported: 2004-05-13 19:55 UTC by hebisch
Modified: 2005-07-23 22:49 UTC (History)
2 users (show)

See Also:
Host:
Target: x86_64-unknown-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hebisch 2004-05-13 19:55:10 UTC
The follwing program compiled by:
 ../gcc/xgcc -B../gcc tess_div.c
gives me:
$ ./a.out
6341068292483973050
the program:
#include <stdio.h>

int main(void)
{
        typedef int myi128 __attribute__ ((mode(TI)));
        myi128 x=0;
        myi128 y=32;
        long z=x/y;
        printf("%ld\n", z);
        return 0;
}

AFAIKS the arguments to `__divti3' function are passed incorrectly.
The problem affects GNU Pascal. Namely, gpc uses `bitsizetype' to
do adress calculation for packed arrays. On 64-bit targets 
`bitsizetype' is done with 128-bit precision. Since on x86_64
such arithmetic does not work (with 3.3.3 backend) it makes
packed arrays unusable ont that target.
Comment 1 Andrew Pinski 2005-06-19 22:58:42 UTC
Does this worh with 3.4.x or 4.0.x?
Comment 2 hebisch 2005-06-19 23:39:10 UTC
Works fine with gcc-3.4.4 or gcc-4.0.0. IIRC gcc-3.4.0 also
worked. gcc-3.3.6 still fails.
Comment 3 Andrew Pinski 2005-06-19 23:42:13 UTC
Closing as fixed for 3.4.0 as 3.3.x branch is no longer maintained.