[Bug fortran/52413] Incorrect behavior of FRACTION when applied to a constant

2013-06-24 Thread burnus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52413 Tobias Burnus changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

[Bug fortran/52413] Incorrect behavior of FRACTION when applied to a constant

2013-06-24 Thread burnus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52413 Tobias Burnus changed: What|Removed |Added CC||burnus at gcc dot gnu.org --- Comment #14

[Bug fortran/52413] Incorrect behavior of FRACTION when applied to a constant

2013-06-23 Thread dominiq at lps dot ens.fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52413 --- Comment #13 from Dominique d'Humieres --- > Why involve I/O in your test, and not just test the value like that: > > if (fraction(-2.0) /= -0.5) call abort() > > and, slightly more complicated to handle negative zero, checking both > value

[Bug fortran/52413] Incorrect behavior of FRACTION when applied to a constant

2013-06-23 Thread fxcoudert at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52413 --- Comment #12 from Francois-Xavier Coudert --- (In reply to Dominique d'Humieres from comment #10) > + y=fraction (-2.0) > + write (buf, *) y > + if (buf(1:10) /= " -0.50") call abort () Why involve I/O in your test, and not just test t

[Bug fortran/52413] Incorrect behavior of FRACTION when applied to a constant

2013-06-23 Thread dominiq at lps dot ens.fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52413 --- Comment #11 from Dominique d'Humieres --- Last question: should I include some tests for the other available kinds?

[Bug fortran/52413] Incorrect behavior of FRACTION when applied to a constant

2013-06-23 Thread dominiq at lps dot ens.fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52413 --- Comment #10 from Dominique d'Humieres --- Here is the patch I plan to package and submit: --- ../_clean/gcc/fortran/simplify.c2013-06-08 21:50:33.0 +0200 +++ gcc/fortran/simplify.c2013-06-23 17:19:55.0 +0200 @@ -2342,1

[Bug fortran/52413] Incorrect behavior of FRACTION when applied to a constant

2013-06-23 Thread fxcoudert at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52413 --- Comment #9 from Francois-Xavier Coudert --- > Before going to the machinery in comment #6, the following patch (i.e., > without any mpfr_copysign) Yep, you're right, no need for mpfr_copysign. Your patch looks good, if we don't want to introd

[Bug fortran/52413] Incorrect behavior of FRACTION when applied to a constant

2013-06-23 Thread dominiq at lps dot ens.fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52413 --- Comment #8 from Dominique d'Humieres --- Before going to the machinery in comment #6, the following patch (i.e., without any mpfr_copysign) --- ../_clean/gcc/fortran/simplify.c2013-06-08 21:50:33.0 +0200 +++ gcc/fortran/simplify.c

[Bug fortran/52413] Incorrect behavior of FRACTION when applied to a constant

2013-06-23 Thread fxcoudert at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52413 --- Comment #7 from Francois-Xavier Coudert --- I forgot in the last comment to say: handling of sign for non-zero cases, in old MPFR versions, is done by this line which was missing in the existing code: + mpfr_copysign (result->value.real, re

[Bug fortran/52413] Incorrect behavior of FRACTION when applied to a constant

2013-06-23 Thread fxcoudert at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52413 --- Comment #6 from Francois-Xavier Coudert --- The current patch is also lacking handling of the sign if signed zero is used. This should do the trick: if (mpfr_sgn (x->value.real) == 0) { - mpfr_set_ui (result->value.real, 0, GFC_

[Bug fortran/52413] Incorrect behavior of FRACTION when applied to a constant

2013-06-23 Thread dominiq at lps dot ens.fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52413 Dominique d'Humieres changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comme

[Bug fortran/52413] Incorrect behavior of FRACTION when applied to a constant

2013-06-22 Thread sgk at troutmask dot apl.washington.edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52413 --- Comment #4 from Steve Kargl --- On Sat, Jun 22, 2013 at 12:57:56PM +, dominiq at lps dot ens.fr wrote: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52413 > > --- Comment #3 from Dominique d'Humieres --- > > Tentative patch. Not regressi

[Bug fortran/52413] Incorrect behavior of FRACTION when applied to a constant

2013-06-22 Thread dominiq at lps dot ens.fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52413 --- Comment #3 from Dominique d'Humieres --- > Tentative patch. Not regression tested, yet. I have applied the patch in comment #1 on top of revision 200321. I have regtested without regression and tested thet this PR is fixed for all the availab