From: Steve Ellcey Date: Thu, 4 Mar 2004 21:21:36 +0000 (+0000) Subject: ia64.md (divdf3_internal_thr): Fix algorithm. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=aa42f99db9e8d53813493550e4237db403cbedd2;p=gcc.git ia64.md (divdf3_internal_thr): Fix algorithm. * config/ia64/ia64.md (divdf3_internal_thr): Fix algorithm. * testsuite/gcc.dg/20040303-1.c: New test. From-SVN: r78934 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 85b7c0eba31..16fa29c669b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-03-04 Steve Ellcey + + * config/ia64/ia64.md (divdf3_internal_thr): Fix algorithm. + * testsuite/gcc.dg/20040303-1.c: New test. + 2004-03-04 Steven Bosscher * ppro.md: Rewrite as a DFA pipeline description. diff --git a/gcc/config/ia64/ia64.md b/gcc/config/ia64/ia64.md index 39694b1baed..1c0cc1230e5 100644 --- a/gcc/config/ia64/ia64.md +++ b/gcc/config/ia64/ia64.md @@ -3177,7 +3177,7 @@ (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 9) (float_truncate:DF - (mult:XF (match_dup 7) (match_dup 3)))) + (mult:XF (match_dup 7) (match_dup 6)))) (use (const_int 1))])) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 4) diff --git a/gcc/testsuite/gcc.dg/20040303-1.c b/gcc/testsuite/gcc.dg/20040303-1.c new file mode 100644 index 00000000000..325853860b6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/20040303-1.c @@ -0,0 +1,20 @@ +/* Test floating point division on ia64. There was a bug in the + max-throughput version of the inline division code. Expecting an + exact value from a floating point expression is unwise but GCC + depends on it in allocno_compare. */ + +/* { dg-do run { target ia64-*-* } } */ +/* { dg-options "-minline-float-divide-max-throughput" { target ia64-*-* } } */ + +extern void abort (void); + +volatile int i = 24; +volatile int j = 30; +volatile int k = 1; + +int main() +{ + int pri2 = (((double) i / j) * (10000 / 1000) * k); + if (pri2 != 8) abort(); + return 0; +}