* [wwwdocs] Update Fortran secrion in 4.8/changes.html
@ 2012-08-14 14:01 Tobias Burnus
2012-08-20 11:05 ` Gerald Pfeifer
0 siblings, 1 reply; 8+ messages in thread
From: Tobias Burnus @ 2012-08-14 14:01 UTC (permalink / raw)
To: gcc patches, gfortran, Gerald Pfeifer
[-- Attachment #1: Type: text/plain, Size: 401 bytes --]
Attached is the first 4.8 merge of the Fortran related changes from
wiki/Gfortran#news into the 4.8 release notes.
I have committed the patch as obvious, however, I am happy for any comments.
Possibly easier to read: http://gcc.gnu.org/gcc-4.8/changes.html (all in
the "Fortran" section)
Tobias
PS: Still to do: Update the manual's status section and interop section
for TYPE(*)/DIMENSION(..).
[-- Attachment #2: 4.8-changes.diff --]
[-- Type: text/x-patch, Size: 3742 bytes --]
Index: changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.8/changes.html,v
retrieving revision 1.10
diff -u -p -r1.10 changes.html
--- changes.html 10 Aug 2012 16:25:46 -0000 1.10
+++ changes.html 14 Aug 2012 13:52:34 -0000
@@ -43,9 +43,7 @@ by this change.</p>
</ul>
-<!--
<h2>New Languages and Language specific improvements</h2>
--->
<!--
<h3>Ada</h3>
@@ -66,9 +64,62 @@ by this change.</p>
<h3>C++</h3>
-->
-<!--
<h3 id="fortran">Fortran</h3>
--->
+ <ul>
+ <li>The <code><a
+ href="http://gcc.gnu.org/onlinedocs/gfortran/Error-and-Warning-Options.html">
+ -Wc-binding-type</a></code> warning flag has been added (by default
+ disabled), which warns if the a variable might not be C interoperable. In
+ particular, if the variable has been declared using an intrinsic type with
+ default kind instead of using a kind parameter defined for C
+ interoperability in the intrinsic <code>ISO_C_Binding</code> module. Before,
+ the warning was always printed.</li>
+
+ <li>The <a
+ href="http://gcc.gnu.org/onlinedocs/gfortran/Error-and-Warning-Options.html">
+ <code>-Wrealloc-lhs</code></a> and <code>-Wrealloc-lhs-all</code> warning
+ flags have been added, which diagnose when code to is inserted for automatic
+ (re)allocation of a variable during assignment. The flag can be used to
+ decide whether it is safe to use <code><a
+ href="http://gcc.gnu.org/onlinedocs/gfortran/Code-Gen-Options.html">
+ -fno-realloc-lhs</a></code>. Additionally, it can be used to find automatic
+ (re)allocation in hot loops. (For arrays, replacing <q><code>var=</code></q>
+ by <q><code>var(:)=</code></q> disables the automatic reallocation.)<li>
+
+ <li>Reading floating point numbers which use <q><code>q</code></q> for the
+ exponential (such as <code>4.0q0</code>) is now supported as vendor
+ extension for better compatibility with old data files. It is strongly
+ recommended to use for I/O the equivalent but standard conforming
+ <q><code>e</code></q> (such as <code>4.0e0</code>). [For the Fortran
+ source code, consider replacing the <q><code>q</code></q> in
+ floating-point literals by a kind parameter (e.g. <code>4.0e0_qp</code>
+ with a suitable <code>qp</code>). Note that – in the Fortran
+ source code – replacing <q><code>q</code></q> by a simple
+ <q><code>e</code></q> is <em>not</em> equivalent.]</li>
+
+ <li>The <code>GFORTRAN_TMPDIR</code> environment variable, for specifying
+ a non-default directory for files opened with <code>STATUS="SCRATCH"</code>,
+ is not used anymore. Instead gfortran checks the POSIX/GNU standard
+ <code>TMPDIR</code> environment variable. If <code>TMPDIR</code> is not
+ defined, gfortran falls back to other methods to determine the directory
+ for temporary files as documented in the
+ <a href="http://gcc.gnu.org/onlinedocs/gfortran/TMPDIR.html">user
+ manual</a>.</li>
+
+ <li><a href="http://gcc.gnu.org/wiki/TS29113Status">TS 29113</a>:
+ <ul>
+ <li>Assumed types (<code>TYPE(*)</code>) are now supported.</li>
+
+ <li>Experimental support for assumed-rank arrays
+ (<code>dimension(..)</code>) has been added. Note that currently
+ gfortran's own array descriptor is used, which is different from the
+ one defined in TS29113, see <a
+ href="http://gcc.gnu.org/viewcvs/trunk/libgfortran/libgfortran.h?content-type=text%2Fplain&view=co">
+ gfortran's header file</a> or use the <a
+ href="http://chasm-interop.sourceforge.net/">Chasm Language
+ Interoperability Tools</a>.</li>
+ </ul></li>
+ </ul>
<!--
<h3>Java (GCJ)</h3>
[-- Attachment #3: 4.8-changes-fixes.diff --]
[-- Type: text/x-patch, Size: 1482 bytes --]
Index: changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.8/changes.html,v
retrieving revision 1.11
diff -u -p -r1.11 changes.html
--- changes.html 14 Aug 2012 13:57:59 -0000 1.11
+++ changes.html 14 Aug 2012 13:59:46 -0000
@@ -84,7 +84,7 @@ by this change.</p>
href="http://gcc.gnu.org/onlinedocs/gfortran/Code-Gen-Options.html">
-fno-realloc-lhs</a></code>. Additionally, it can be used to find automatic
(re)allocation in hot loops. (For arrays, replacing <q><code>var=</code></q>
- by <q><code>var(:)=</code></q> disables the automatic reallocation.)<li>
+ by <q><code>var(:)=</code></q> disables the automatic reallocation.)</li>
<li>Reading floating point numbers which use <q><code>q</code></q> for the
exponential (such as <code>4.0q0</code>) is now supported as vendor
@@ -114,7 +114,7 @@ by this change.</p>
(<code>dimension(..)</code>) has been added. Note that currently
gfortran's own array descriptor is used, which is different from the
one defined in TS29113, see <a
- href="http://gcc.gnu.org/viewcvs/trunk/libgfortran/libgfortran.h?content-type=text%2Fplain&view=co">
+ href="http://gcc.gnu.org/viewcvs/trunk/libgfortran/libgfortran.h?content-type=text%2Fplain&view=co">
gfortran's header file</a> or use the <a
href="http://chasm-interop.sourceforge.net/">Chasm Language
Interoperability Tools</a>.</li>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [wwwdocs] Update Fortran secrion in 4.8/changes.html
2012-08-14 14:01 [wwwdocs] Update Fortran secrion in 4.8/changes.html Tobias Burnus
@ 2012-08-20 11:05 ` Gerald Pfeifer
2012-08-21 6:59 ` Tobias Burnus
0 siblings, 1 reply; 8+ messages in thread
From: Gerald Pfeifer @ 2012-08-20 11:05 UTC (permalink / raw)
To: Tobias Burnus, gcc-patches; +Cc: fortran
On Tue, 14 Aug 2012, Tobias Burnus wrote:
> I have committed the patch as obvious, however, I am happy for any
> comments.
I went ahead and made some smaller changes, patch below.
I noticed you are using <q>...</q>, as in <q><code>e</code></q>,
which we usually don't. Why that?
Gerald
Index: changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.8/changes.html,v
retrieving revision 1.15
diff -u -3 -p -r1.15 changes.html
--- changes.html 19 Aug 2012 19:48:02 -0000 1.15
+++ changes.html 20 Aug 2012 10:32:20 -0000
@@ -92,18 +92,20 @@ by this change.</p>
(re)allocation in hot loops. (For arrays, replacing <q><code>var=</code></q>
by <q><code>var(:)=</code></q> disables the automatic reallocation.)</li>
- <li>Reading floating point numbers which use <q><code>q</code></q> for the
- exponential (such as <code>4.0q0</code>) is now supported as vendor
+ <li><p>Reading floating point numbers which use <q><code>q</code></q> for
+ the exponential (such as <code>4.0q0</code>) is now supported as vendor
extension for better compatibility with old data files. It is strongly
recommended to use for I/O the equivalent but standard conforming
- <q><code>e</code></q> (such as <code>4.0e0</code>). [For the Fortran
+ <q><code>e</code></q> (such as <code>4.0e0</code>).</p>
+
+ <p>(For Fortran
source code, consider replacing the <q><code>q</code></q> in
floating-point literals by a kind parameter (e.g. <code>4.0e0_qp</code>
- with a suitable <code>qp</code>). Note that – in the Fortran
+ with a suitable <code>qp</code>). Note that – in Fortran
source code – replacing <q><code>q</code></q> by a simple
- <q><code>e</code></q> is <em>not</em> equivalent.]</li>
+ <q><code>e</code></q> is <em>not</em> equivalent.)</p></li>
- <li>The <code>GFORTRAN_TMPDIR</code> environment variable, for specifying
+ <li>The <code>GFORTRAN_TMPDIR</code> environment variable for specifying
a non-default directory for files opened with <code>STATUS="SCRATCH"</code>,
is not used anymore. Instead gfortran checks the POSIX/GNU standard
<code>TMPDIR</code> environment variable. If <code>TMPDIR</code> is not
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [wwwdocs] Update Fortran secrion in 4.8/changes.html
2012-08-20 11:05 ` Gerald Pfeifer
@ 2012-08-21 6:59 ` Tobias Burnus
2012-11-12 15:20 ` Gerald Pfeifer
0 siblings, 1 reply; 8+ messages in thread
From: Tobias Burnus @ 2012-08-21 6:59 UTC (permalink / raw)
To: Gerald Pfeifer; +Cc: gcc-patches, fortran
[-- Attachment #1: Type: text/plain, Size: 607 bytes --]
Gerald Pfeifer wrote:
> I went ahead and made some smaller changes, patch below.
Thanks.
> I noticed you are using <q>...</q>, as in <q><code>e</code></q>,
> which we usually don't. Why that?
My impression was that a one-letter <code> didn't stand out enough and
looked rather odd; if you think it improves consistency or readability,
feel free to change it.
* * *
I intent to commit the attached patch to document two new warning flags,
which were recently added. (Suggested in ISO/IEC Technical Report 24772
"Guidance for Avoiding Vulnerabilities through Language Selection and Use".)
Tobias
[-- Attachment #2: changes.diff --]
[-- Type: text/x-patch, Size: 1490 bytes --]
Index: changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.8/changes.html,v
retrieving revision 1.17
diff -u -r1.17 changes.html
--- changes.html 20 Aug 2012 12:23:39 -0000 1.17
+++ changes.html 21 Aug 2012 06:56:55 -0000
@@ -92,6 +92,21 @@
(re)allocation in hot loops. (For arrays, replacing <q><code>var=</code></q>
by <q><code>var(:)=</code></q> disables the automatic reallocation.)</li>
+ <li>The <a
+ href="http://gcc.gnu.org/onlinedocs/gfortran/Error-and-Warning-Options.html">
+ <code>-Wcompare-reals</code></a> flag has been added. When this flag is set,
+ warnings are issued when comparing <code>REAL</code> or
+ <code>COMPLEX</code> types for equality and inequality; consider replacing
+ <code>a == b</code> by <code>abs(a−b) < eps</code> with a suitable
+ <code>eps</code>. The -Wcompare-reals flag is enabled by
+ <code>-Wall</code>.</li>
+
+ <li>The <a
+ href="http://gcc.gnu.org/onlinedocs/gfortran/Error-and-Warning-Options.html">
+ <code>-Wtarget-lifetime</code></a> flag has been added (enabled with
+ <code>-Wall</code>), which warns if the pointer in a pointer assignment
+ might outlive its target.</li>
+
<li><p>Reading floating point numbers which use <q><code>q</code></q> for
the exponential (such as <code>4.0q0</code>) is now supported as vendor
extension for better compatibility with old data files. It is strongly
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [wwwdocs] Update Fortran secrion in 4.8/changes.html
2012-08-21 6:59 ` Tobias Burnus
@ 2012-11-12 15:20 ` Gerald Pfeifer
2012-11-12 15:28 ` Tobias Burnus
0 siblings, 1 reply; 8+ messages in thread
From: Gerald Pfeifer @ 2012-11-12 15:20 UTC (permalink / raw)
To: Tobias Burnus; +Cc: gcc-patches, fortran
On Tue, 21 Aug 2012, Tobias Burnus wrote:
>> I noticed you are using <q>...</q>, as in <q><code>e</code></q>,
>> which we usually don't. Why that?
> My impression was that a one-letter <code> didn't stand out enough and
> looked rather odd; if you think it improves consistency or readability,
> feel free to change it.
That's actually a good point and a clever idea to use <q>.
> I intent to commit the attached patch to document two new warning flags,
> which were recently added. (Suggested in ISO/IEC Technical Report 24772
> "Guidance for Avoiding Vulnerabilities through Language Selection and
> Use".)
I committed a small follow up patch to this (below).
One question: in general we are using the term "command-line option".
You are introducing two uses of "flag", and the two existing uses of
that are also in the Fortran section. Is this Fortran terminology or
would it be fine to make this more consistent?
Gerald
Index: changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.8/changes.html,v
retrieving revision 1.55
diff -u -3 -p -r1.55 changes.html
--- changes.html 11 Nov 2012 09:22:18 -0000 1.55
+++ changes.html 12 Nov 2012 15:17:53 -0000
@@ -194,7 +194,7 @@ B b(42); // OK
warnings are issued when comparing <code>REAL</code> or
<code>COMPLEX</code> types for equality and inequality; consider replacing
<code>a == b</code> by <code>abs(a−b) < eps</code> with a suitable
- <code>eps</code>. The <code>-Wcompare-reals</code> flag is enabled by
+ <code>eps</code>. <code>-Wcompare-reals</code> is enabled by
<code>-Wextra</code>.</li>
<li>The <a
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [wwwdocs] Update Fortran secrion in 4.8/changes.html
2012-11-12 15:20 ` Gerald Pfeifer
@ 2012-11-12 15:28 ` Tobias Burnus
2012-11-19 15:41 ` Gerald Pfeifer
0 siblings, 1 reply; 8+ messages in thread
From: Tobias Burnus @ 2012-11-12 15:28 UTC (permalink / raw)
To: Gerald Pfeifer; +Cc: gcc-patches, fortran
Gerald Pfeifer wrote:
> One question: in general we are using the term "command-line option".
> You are introducing two uses of "flag", and the two existing uses of
> that are also in the Fortran section. Is this Fortran terminology or
> would it be fine to make this more consistent?
Well, "flag" is GCC teminology (see "man gcc"), though it seems to be
only used for the -f* options while I (mis)used it here for -W*. I think
it is better to use the more common term "command-line option".
Tobias
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [wwwdocs] Update Fortran secrion in 4.8/changes.html
2012-11-12 15:28 ` Tobias Burnus
@ 2012-11-19 15:41 ` Gerald Pfeifer
2012-11-19 16:22 ` Tobias Burnus
0 siblings, 1 reply; 8+ messages in thread
From: Gerald Pfeifer @ 2012-11-19 15:41 UTC (permalink / raw)
To: Tobias Burnus; +Cc: gcc-patches, fortran
On Mon, 12 Nov 2012, Tobias Burnus wrote:
> Well, "flag" is GCC teminology (see "man gcc"), though it seems to be
> only used for the -f* options while I (mis)used it here for -W*. I
> think it is better to use the more common term "command-line option".
Okay, so I went ahead and applied the patch below.
There is one sentence (preceding my patch) which I don't quite
understand (specifically around the "to"):
"...which diagnose when code to is inserted for automatic
(re)allocation of a variable during assignment."
Gerald
Index: changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.8/changes.html,v
retrieving revision 1.56
diff -u -3 -p -r1.56 changes.html
--- changes.html 12 Nov 2012 15:19:33 -0000 1.56
+++ changes.html 19 Nov 2012 15:19:03 -0000
@@ -169,20 +169,20 @@ B b(42); // OK
<ul>
<li>The <code><a
href="http://gcc.gnu.org/onlinedocs/gfortran/Error-and-Warning-Options.html">
- -Wc-binding-type</a></code> warning flag has been added (by default
- disabled), which warns if the a variable might not be C interoperable. In
+ -Wc-binding-type</a></code> warning option has been added (disabled
+ by default), which warns if the a variable might not be C interoperable. In
particular, if the variable has been declared using an intrinsic type with
default kind instead of using a kind parameter defined for C
interoperability in the intrinsic <code>ISO_C_Binding</code> module. Before,
- the warning was always printed. The <code>-Wc-binding-type</code> flag
+ the warning was always printed. The <code>-Wc-binding-type</code> option
is enabled by <code>-Wall</code>.</li>
<li>The <a
href="http://gcc.gnu.org/onlinedocs/gfortran/Error-and-Warning-Options.html">
<code>-Wrealloc-lhs</code></a> and <code>-Wrealloc-lhs-all</code> warning
- flags have been added, which diagnose when code to is inserted for automatic
- (re)allocation of a variable during assignment. The flag can be used to
- decide whether it is safe to use <code><a
+ command-line options have been added, which diagnose when code to is
+ inserted for automatic (re)allocation of a variable during assignment.
+ This option can be used to decide whether it is safe to use <code><a
href="http://gcc.gnu.org/onlinedocs/gfortran/Code-Gen-Options.html">
-fno-realloc-lhs</a></code>. Additionally, it can be used to find automatic
(re)allocation in hot loops. (For arrays, replacing <q><code>var=</code></q>
@@ -190,8 +190,8 @@ B b(42); // OK
<li>The <a
href="http://gcc.gnu.org/onlinedocs/gfortran/Error-and-Warning-Options.html">
- <code>-Wcompare-reals</code></a> flag has been added. When this flag is set,
- warnings are issued when comparing <code>REAL</code> or
+ <code>-Wcompare-reals</code></a> command-line option has been added. When
+ this is set, warnings are issued when comparing <code>REAL</code> or
<code>COMPLEX</code> types for equality and inequality; consider replacing
<code>a == b</code> by <code>abs(a−b) < eps</code> with a suitable
<code>eps</code>. <code>-Wcompare-reals</code> is enabled by
@@ -199,9 +199,9 @@ B b(42); // OK
<li>The <a
href="http://gcc.gnu.org/onlinedocs/gfortran/Error-and-Warning-Options.html">
- <code>-Wtarget-lifetime</code></a> flag has been added (enabled with
- <code>-Wall</code>), which warns if the pointer in a pointer assignment
- might outlive its target.</li>
+ <code>-Wtarget-lifetime</code></a> command-line option has been added
+ (enabled with <code>-Wall</code>), which warns if the pointer in a
+ pointer assignment might outlive its target.</li>
<li><p>Reading floating point numbers which use <q><code>q</code></q> for
the exponential (such as <code>4.0q0</code>) is now supported as vendor
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [wwwdocs] Update Fortran secrion in 4.8/changes.html
2012-11-19 15:41 ` Gerald Pfeifer
@ 2012-11-19 16:22 ` Tobias Burnus
2015-04-20 8:26 ` Gerald Pfeifer
0 siblings, 1 reply; 8+ messages in thread
From: Tobias Burnus @ 2012-11-19 16:22 UTC (permalink / raw)
To: Gerald Pfeifer; +Cc: gcc-patches, fortran
Gerald Pfeifer wrote:
> There is one sentence (preceding my patch) which I don't quite
> understand (specifically around the "to"):
>
> "...which diagnose when code to is inserted for automatic
> (re)allocation of a variable during assignment."
Let me try to explain what the warning does and what "automatic
(re)allocation" is; either the meaning becomes clear – or you might get
an idea how to improve the wording.
But I concur that the current version is odd; it should either be "when
code is [or: "will be"] inserted" or, maybe, "when code is to be inserted".
* * *
Fortran has allocatable variables, e.g.
real, allocatable :: array(:)
If one now has the assignment
array = [ 1, 2, 3, 4 ]
the "array" gets automatically allocated for an array size of 4 before
the assignment. If one now has
array = [ 5,6,7,8 ]
there is only the assignment as "array" is already allocated while for
array = [ 1, 2 ]
"array" is reallocated to have an array size of 2 (and then the array
"[1,2]" is assigned).
In order to do this, the compiler has to add a check whether the LHS is
allocated and whether the type parameters (e.g. the [allocatable] string
length) and array shape are the same. Thus, the compiler adds internally
a lot of code.
While this (re)allocate-on-assignment feature is very convenient, it can
cause some severe slow down if it occurs in a hot loop. If users knows
that the variable is allocated and of the correct shape (should be true
for all code before Fortran 2003), they can either disable the feature
(-std=f95, -fno-realloc-lhs) or they can prevent the reallocation by
using a (whole) array section, e.g. "array(:) = [5,6,7,8]". And to avoid
guessing where reallocation on assignment might happen, the warning
shows where. Thus, the warning helps with performance tuning.
Tobias
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [wwwdocs] Update Fortran secrion in 4.8/changes.html
2012-11-19 16:22 ` Tobias Burnus
@ 2015-04-20 8:26 ` Gerald Pfeifer
0 siblings, 0 replies; 8+ messages in thread
From: Gerald Pfeifer @ 2015-04-20 8:26 UTC (permalink / raw)
To: Tobias Burnus; +Cc: gcc-patches, fortran
[-- Attachment #1: Type: text/plain, Size: 1656 bytes --]
On Mon, 19 Nov 2012, Tobias Burnus wrote:
>> There is one sentence (preceding my patch) which I don't quite
>> understand (specifically around the "to"):
>>
>> "...which diagnose when code to is inserted for automatic
>> (re)allocation of a variable during assignment."
> Let me try to explain what the warning does and what "automatic
> (re)allocation" is; either the meaning becomes clear – or you might get an
> idea how to improve the wording.
>
> But I concur that the current version is odd; it should either be "when code
> is [or: "will be"] inserted" or, maybe, "when code is to be inserted".
Thanks for the explanation, Tobias. That was very helpful.
Now that I understand things better, I went ahead and applied the
following minimal patch (per your suggestion).
Gerald
Index: changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.8/changes.html,v
retrieving revision 1.132
diff -u -r1.132 changes.html
--- changes.html 8 Apr 2015 10:33:06 -0000 1.132
+++ changes.html 20 Apr 2015 08:24:33 -0000
@@ -372,7 +372,7 @@
<li>The <a
href="https://gcc.gnu.org/onlinedocs/gfortran/Error-and-Warning-Options.html">
<code>-Wrealloc-lhs</code></a> and <code>-Wrealloc-lhs-all</code> warning
- command-line options have been added, which diagnose when code to is
+ command-line options have been added, which diagnose when code is
inserted for automatic (re)allocation of a variable during assignment.
This option can be used to decide whether it is safe to use <code><a
href="https://gcc.gnu.org/onlinedocs/gfortran/Code-Gen-Options.html">
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-04-20 8:26 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-14 14:01 [wwwdocs] Update Fortran secrion in 4.8/changes.html Tobias Burnus
2012-08-20 11:05 ` Gerald Pfeifer
2012-08-21 6:59 ` Tobias Burnus
2012-11-12 15:20 ` Gerald Pfeifer
2012-11-12 15:28 ` Tobias Burnus
2012-11-19 15:41 ` Gerald Pfeifer
2012-11-19 16:22 ` Tobias Burnus
2015-04-20 8:26 ` Gerald Pfeifer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).