summaryrefslogtreecommitdiffstats
path: root/gcc
diff options
context:
space:
mode:
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2007-11-30 04:10:47 +0000
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2007-11-30 04:10:47 +0000
commit24128aa2f473b6d1ca4a1d4826074f09dc1b9938 (patch)
tree6c111f01b6c4dfe3d648cedfaaf92c43e5a77f6e /gcc
parent42e22a82963556f2dabea7b41f7deff1814d6f22 (diff)
downloadppe42-gcc-24128aa2f473b6d1ca4a1d4826074f09dc1b9938.tar.gz
ppe42-gcc-24128aa2f473b6d1ca4a1d4826074f09dc1b9938.zip
2007-11-29 Steven G. Kargl <kargls@comcast.net>
PR fortran/34230 * fortran/arith.c (gfc_check_real_range): Set intermediate values to +-Inf and 0 when -fno-range-check is in effect. * fortran/invoke.texi: Improve -fno-range-check description. PR fortran/34203 * fortran/invoke.texi: Document the C escaped characters activated by -fbackslash. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130530 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog11
-rw-r--r--gcc/fortran/arith.c17
-rw-r--r--gcc/fortran/invoke.texi16
3 files changed, 38 insertions, 6 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 8f185f7c115..6aa5a35f779 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,14 @@
+2007-11-29 Steven G. Kargl <kargls@comcast.net>
+
+ PR fortran/34230
+ * fortran/arith.c (gfc_check_real_range): Set intermediate values
+ to +-Inf and 0 when -fno-range-check is in effect.
+ * fortran/invoke.texi: Improve -fno-range-check description.
+
+ PR fortran/34203
+ * fortran/invoke.texi: Document the C escaped characters activated
+ by -fbackslash.
+
2007-11-29 Tobias Burnus <burnus@net-b.de>
PR fortran/34248
diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c
index 97d093f31ea..cfcbdf0cb76 100644
--- a/gcc/fortran/arith.c
+++ b/gcc/fortran/arith.c
@@ -348,14 +348,27 @@ gfc_check_real_range (mpfr_t p, int kind)
else if (mpfr_cmp (q, gfc_real_kinds[i].huge) > 0)
{
if (gfc_option.flag_range_check == 0)
- retval = ARITH_OK;
+ {
+ mpfr_set_inf (p, mpfr_sgn (p));
+ retval = ARITH_OK;
+ }
else
retval = ARITH_OVERFLOW;
}
else if (mpfr_cmp (q, gfc_real_kinds[i].subnormal) < 0)
{
if (gfc_option.flag_range_check == 0)
- retval = ARITH_OK;
+ {
+ if (mpfr_sgn (p) < 0)
+ {
+ mpfr_set_ui (p, 0, GFC_RND_MODE);
+ mpfr_set_si (q, -1, GFC_RND_MODE);
+ mpfr_copysign (p, p, q, GFC_RND_MODE);
+ }
+ else
+ mpfr_set_ui (p, 0, GFC_RND_MODE);
+ retval = ARITH_OK;
+ }
else
retval = ARITH_UNDERFLOW;
}
diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index 2be5b5a18b9..22dd8983acd 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -239,6 +239,11 @@ Allow @samp{$} as a valid character in a symbol name.
@cindex escape characters
Change the interpretation of backslashes in string literals
from a single backslash character to ``C-style'' escape characters.
+The following combinations are expanded \a, \b, \f, \n, \r, \t,
+\v, \\, and \0 to the ASCII characters alert, backspace, form feed,
+newline, carriage return, horizontal tab, vertical tab, backslash,
+and NUL, respectively. All other combinations of a character preceded
+by \ are unexpanded.
@item -fmodule-private
@opindex @code{fmodule-private}
@@ -303,10 +308,13 @@ in. The option @option{-fopenmp} implies @option{-frecursive}.
@item -fno-range-check
@opindex @code{frange-check}
Disable range checking on results of simplification of constant
-expressions during compilation. For example, by default, GNU Fortran
-will give an overflow error at compile time when simplifying @code{a =
-EXP(1000)}. With @option{-fno-range-check}, no error will be given and
-the variable @code{a} will be assigned the value @code{+Infinity}.
+expressions during compilation. For example, GNU Fortran will give
+an error at compile time when simplifying @code{a = 1. / 0}.
+With this option, no error will be given and @code{a} will be assigned
+the value @code{+Infinity}. If an expression evaluates to a value
+outside of the relevant range of [@code{-HUGE()}:@code{HUGE()}],
+then the expression will be replaced by @code{-Inf} or @code{+Inf}
+as appropriate.
Similarly, @code{DATA i/Z'FFFFFFFF'/} will result in an integer overflow
on most systems, but with @option{-fno-range-check} the value will
``wrap around'' and @code{i} will be initialized to @math{-1} instead.
OpenPOWER on IntegriCloud