diff options
author | Brooks Moses <bmoses@stanford.edu> | 2006-10-01 00:51:21 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2006-10-01 00:51:21 +0000 |
commit | da1e2517fa43519a38a32be959acccafd7f67f02 (patch) | |
tree | 94929706483e2339daf4f1c17b2cd54be73abfb9 /gcc | |
parent | 04652d6c8d35b508002e2faad2ab0b5eebd4c8ff (diff) | |
download | gcc-da1e2517fa43519a38a32be959acccafd7f67f02.zip gcc-da1e2517fa43519a38a32be959acccafd7f67f02.tar.gz gcc-da1e2517fa43519a38a32be959acccafd7f67f02.tar.bz2 |
invoke.texi: Add mention of BOZ constants and integer overflow to -fno-range-check.
2006-09-30 Brooks Moses <bmoses@stanford.edu>
* invoke.texi: Add mention of BOZ constants and integer
overflow to -fno-range-check.
* fortran.texi: Add mention of -fno-range-check to
section on BOZ contants.
From-SVN: r117342
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/gfortran.texi | 29 | ||||
-rw-r--r-- | gcc/fortran/invoke.texi | 5 |
3 files changed, 31 insertions, 10 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index e1d8420..a37b857 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2006-09-30 Brooks Moses <bmoses@stanford.edu> + + * invoke.texi: Add mention of BOZ constants and integer + overflow to -fno-range-check. + * gfortran.texi: Add mention of -fno-range-check to + section on BOZ contants. + 2006-09-30 Bernhard Fischer <aldot@gcc.gnu.org> * resolve.c: Fix commentary typo. Fix whitespace. diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi index a20ef76..cd281e1 100644 --- a/gcc/fortran/gfortran.texi +++ b/gcc/fortran/gfortran.texi @@ -933,12 +933,19 @@ the @code{DATA} statement, and it is expected to be assigned to an @code{INTEGER} variable. @command{gfortran} permits a BOZ to appear in any initialization expression as well as assignment statements. -The use of a BOZ literal constant to initialize a @code{REAL} variable will -lead to confusion. A BOZ literal constant is converted to an -@code{INTEGER} with the kind type with the largest decimal representation -before a conversion to a @code{REAL} variable. That is, one should not -expect a bitwise copy of the BOZ literal constant to be assigned to the -@code{REAL}. +Attempts to use a BOZ literal constant to do a bitwise initialization of a +variable can lead to confusion. A BOZ literal constant is converted to an +@code{INTEGER} value with the kind type with the largest decimal representation, +and this value is then converted numerically to the type and kind of the +variable in question. Thus, one should not expect a bitwise copy of the BOZ +literal constant to be assigned to a @code{REAL} variable. + +Similarly, initializing an @code{INTEGER} variable with a statement such as +@code{DATA i/Z'FFFFFFFF'/} will produce an integer overflow rather than the +desired result of @math{-1} when @code{i} is a 32-bit integer on a system that +supports 64-bit integers. The @samp{-fno-range-check} option can be used as +a workaround for legacy code that initializes integers in this manner. + @node Real array indices @section Real array indices @@ -1370,7 +1377,8 @@ available. @itemize @item Intrinsics @code{command_argument_count}, @code{get_command}, -@code{get_command_argument}, and @code{get_environment_variable}. +@code{get_command_argument}, @code{get_environment_variable}, and +@code{move_alloc}. @item @cindex Array constructors @@ -1397,14 +1405,17 @@ Support for the declaration of enumeration constants via the @item @cindex TR 15581 -The following parts of TR 15581: +TR 15581: @itemize @item @cindex @code{ALLOCATABLE} dummy arguments -The @code{ALLOCATABLE} attribute for dummy arguments. +@code{ALLOCATABLE} dummy arguments. @item @cindex @code{ALLOCATABLE} function results @code{ALLOCATABLE} function results +@item +@cindex @code{ALLOCATABLE} components of derived types +@code{ALLOCATABLE} components of derived types @end itemize @item diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi index 7b8036c..e0a0c47 100644 --- a/gcc/fortran/invoke.texi +++ b/gcc/fortran/invoke.texi @@ -315,7 +315,10 @@ Enable range checking on results of simplification of constant expressions during compilation. For example, by default, @command{gfortran} will give an overflow error at compile time when simplifying @code{a = EXP(1000)}. With @samp{-fno-range-check}, no error will be given and the variable @code{a} -will be assigned the value @code{+Infinity}. +will be assigned the value @code{+Infinity}. Similarly, +@code{DATA i/Z'FFFFFFFF'/} will result in an integer overflow on most systems, +but with @samp{-fno-range-check} the value will ``wrap around'' and @code{i} +will be initialized to @math{-1} instead. @cindex -std=@var{std} option @cindex option, -std=@var{std} |