diff options
author | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-04-20 04:18:25 +0000 |
---|---|---|
committer | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-04-20 04:18:25 +0000 |
commit | 8fed28426abf383e6288487e3b9ab7e79722f7b2 (patch) | |
tree | 55c3d82aab4d8b0b766221097f191e427c637aa1 /libgfortran | |
parent | d826e13109822b8430676ef5f9de85fdbfe89ba8 (diff) | |
download | gcc-8fed28426abf383e6288487e3b9ab7e79722f7b2.tar.gz |
2011-04-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/48602
* io/write_float.def (output_float_FMT_G): Fix reversal in conditional.
Use asm volatile to mark temp variable, avoiding optimization errors.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172753 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 6 | ||||
-rw-r--r-- | libgfortran/io/write_float.def | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index f4b19f8b863..205243e8181 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2011-04-19 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libgfortran/48602 + * io/write_float.def (output_float_FMT_G): Fix reversal in conditional. + Use asm volatile to mark temp variable, avoiding optimization errors. + 2011-04-17 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/48602 diff --git a/libgfortran/io/write_float.def b/libgfortran/io/write_float.def index 9e90d809450..2bced6ffec4 100644 --- a/libgfortran/io/write_float.def +++ b/libgfortran/io/write_float.def @@ -805,7 +805,8 @@ CALCULATE_EXP(16) notes: for Gw.d , n' ' means 4 blanks for Gw.dEe, n' ' means e+2 blanks - for rounding modes adjustment, r, See Fortran F2008 10.7.5.2.2 */ + for rounding modes adjustment, r, See Fortran F2008 10.7.5.2.2 + the asm volatile is required for 32-bit x86 platforms. */ #define OUTPUT_FLOAT_FMT_G(x) \ static void \ @@ -830,7 +831,7 @@ output_float_FMT_G_ ## x (st_parameter_dt *dtp, const fnode *f, \ switch (dtp->u.p.current_unit->round_status)\ {\ case ROUND_ZERO:\ - r = sign_bit ? 0.0 : 1.0;\ + r = sign_bit ? 1.0 : 0.0;\ break;\ case ROUND_UP:\ r = 1.0;\ @@ -867,6 +868,7 @@ output_float_FMT_G_ ## x (st_parameter_dt *dtp, const fnode *f, \ mid = (low + high) / 2;\ \ temp = (calculate_exp_ ## x (mid - 1) * (1 - r * rexp_d));\ + asm volatile ("" : "+m" (temp));\ \ if (m < temp)\ { \ |