OSDN Git Service

PR preprocessor/20348
[pf3gnuchains/gcc-fork.git] / gcc / real.c
index bed2fb0..2d26185 100644 (file)
@@ -18,8 +18,8 @@
 
    You should have received a copy of the GNU General Public License
    along with GCC; see the file COPYING.  If not, write to the Free
-   Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.  */
+   Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.  */
 
 #include "config.h"
 #include "system.h"
@@ -1789,6 +1789,10 @@ real_from_string (REAL_VALUE_TYPE *r, const char *str)
                |= (unsigned long) d << (pos % HOST_BITS_PER_LONG);
              pos -= 4;
            }
+         else if (d)
+           /* Ensure correct rounding by setting last bit if there is
+              a subsequent nonzero digit.  */
+           r->sig[0] |= 1;
          exp += 4;
          str++;
        }
@@ -1811,6 +1815,10 @@ real_from_string (REAL_VALUE_TYPE *r, const char *str)
                    |= (unsigned long) d << (pos % HOST_BITS_PER_LONG);
                  pos -= 4;
                }
+             else if (d)
+               /* Ensure correct rounding by setting last bit if there is
+                  a subsequent nonzero digit.  */
+               r->sig[0] |= 1;
              str++;
            }
        }
@@ -4414,7 +4422,7 @@ const struct real_format c4x_single_format =
     24,
     -126,
     128,
-    -1,
+    23,
     -1,
     false,
     false,
@@ -4433,7 +4441,7 @@ const struct real_format c4x_extended_format =
     32,
     -126,
     128,
-    -1,
+    31,
     -1,
     false,
     false,