public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [wwwdata] Update Fortran section of gcc-4.6/changes.html
@ 2010-08-19  8:21 Tobias Burnus
  2010-08-19  8:41 ` Daniel Kraft
  2010-12-15 22:34 ` Gerald Pfeifer
  0 siblings, 2 replies; 7+ messages in thread
From: Tobias Burnus @ 2010-08-19  8:21 UTC (permalink / raw)
  To: gcc patches, gfortran

[-- Attachment #1: Type: text/plain, Size: 170 bytes --]

  I have already committed the attached patch, but don't hesitate to 
suggest changes or other improvements.

Cf. http://gcc.gnu.org/gcc-4.6/changes.html#Fortran

Tobias

[-- Attachment #2: changes.diff --]
[-- Type: text/x-patch, Size: 1677 bytes --]

Index: changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.6/changes.html,v
retrieving revision 1.34
diff -u -r1.34 changes.html
--- changes.html	28 Jul 2010 18:04:00 -0000	1.34
+++ changes.html	19 Aug 2010 07:50:34 -0000
@@ -180,6 +180,19 @@
 	<li>Support for <code>ALLOCATE</code> with <code>MOLD</code>.</li>
 	<li>Support for the <code>STORAGE_SIZE</code> intrinsic inquiry
 	function.</li>
+	<li>Support for the <code>IMPURE</code> attribute for procedures,
+	which allows for <code>ELEMENTAL</code> procedures without the
+	restrictions of <code>PURE</code>.</li>
+	<li>Null pointers (including <code>NULL()</code>) and not
+	allocated variables can be used as actual argument to optional
+	non-pointer, non-allocatable dummy arguments, denoting an absent
+	argument.</li>
+	<li>Non-pointer variables with <code>TARGET</code> attribute can
+	be used as actual argument to <code>POINTER</code> dummies with
+	<code>INTENT(IN)</code></li>
+	<li>Pointers including procedure pointers and those in a derived
+	type (pointer components) can now be initialized by a target
+	instead of only by <code>NULL</code>.</li>
 	<li>Minor changes: obsolesce diagnostics for <code>ENTRY</code>
 	was added for <code>-std=f2008</code>;
 	a line may start with a semicolon;
@@ -189,7 +202,8 @@
 	<code>RADIX</code> argument; intrinsic types are supported for
 	<code>TYPE(<i>intrinsic-type-spec</i>)</code>; multiple type-bound
 	procedures can be declared in a single <code>PROCEDURE</code>
-	statement.</li>
+	statement; assumed-shape arrays are supported for named constants.
+	</li>
       </ul>
     </li>
   </ul>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [wwwdata] Update Fortran section of gcc-4.6/changes.html
  2010-08-19  8:21 [wwwdata] Update Fortran section of gcc-4.6/changes.html Tobias Burnus
@ 2010-08-19  8:41 ` Daniel Kraft
  2010-08-19 10:27   ` Tobias Burnus
  2010-12-15 22:34 ` Gerald Pfeifer
  1 sibling, 1 reply; 7+ messages in thread
From: Daniel Kraft @ 2010-08-19  8:41 UTC (permalink / raw)
  To: Tobias Burnus; +Cc: gcc patches, gfortran

Tobias Burnus wrote:
>  I have already committed the attached patch, but don't hesitate to 
> suggest changes or other improvements.

Looks good, but reminds me that implied-shape arrays are still missing 
from that list.

Yours,
Daniel

-- 
http://www.pro-vegan.info/
--
Done:  Arc-Bar-Cav-Ran-Rog-Sam-Tou-Val-Wiz
To go: Hea-Kni-Mon-Pri

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [wwwdata] Update Fortran section of gcc-4.6/changes.html
  2010-08-19  8:41 ` Daniel Kraft
@ 2010-08-19 10:27   ` Tobias Burnus
  0 siblings, 0 replies; 7+ messages in thread
From: Tobias Burnus @ 2010-08-19 10:27 UTC (permalink / raw)
  To: Daniel Kraft; +Cc: gcc patches, gfortran

  On 08/19/2010 10:26 AM, Daniel Kraft wrote:
> Tobias Burnus wrote:
>>  I have already committed the attached patch, but don't hesitate to 
>> suggest changes or other improvements.
> Looks good, but reminds me that implied-shape arrays are still missing 
> from that list.

No, they were not missing from the list but they were wrong in the list 
(at minor changes). Corrected with the patch below and in the wiki at 
GFortran news.

Thanks,

Tobias

--- changes.html        19 Aug 2010 07:54:14 -0000      1.35
+++ changes.html        19 Aug 2010 10:12:35 -0000
@@ -202,8 +202,8 @@
<code>RADIX</code> argument; intrinsic types are supported for
<code>TYPE(<i>intrinsic-type-spec</i>)</code>; multiple type-bound
         procedures can be declared in a single <code>PROCEDURE</code>
-       statement; assumed-shape arrays are supported for named constants.
- </li>
+       statement; implied-shape arrays are supported for named constants
+       (<code>PARAMETER</code>).</li>
</ul>
</li>
</ul>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [wwwdata] Update Fortran section of gcc-4.6/changes.html
  2010-08-19  8:21 [wwwdata] Update Fortran section of gcc-4.6/changes.html Tobias Burnus
  2010-08-19  8:41 ` Daniel Kraft
@ 2010-12-15 22:34 ` Gerald Pfeifer
  2010-12-15 23:09   ` Steve Kargl
  1 sibling, 1 reply; 7+ messages in thread
From: Gerald Pfeifer @ 2010-12-15 22:34 UTC (permalink / raw)
  To: Tobias Burnus; +Cc: gcc-patches, fortran

On Thu, 19 Aug 2010, Tobias Burnus wrote:
> I have already committed the attached patch, but don't hesitate to suggest
> changes or other improvements.
> 
> Cf. http://gcc.gnu.org/gcc-4.6/changes.html#Fortran

The following snippet sounds a bit confusing to me, though admittedly
I am not a Fortran hacker:

+       <li>Null pointers (including <code>NULL()</code>) and not
+       allocated variables can be used as actual argument to optional
+       non-pointer, non-allocatable dummy arguments, denoting an absent
+       argument.</li>

Is "actual argument" a standard term?  "as actual argument to ...
arguments, denoting an absent argument" sounds a bit tricky.

(Something may not be right with singular and plural here, too:
first is singular, the second one plural, the third one singular
again.)

+       <li>Non-pointer variables with <code>TARGET</code> attribute can

"with the <code>TARGET</code> attribute"?

Gerald

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [wwwdata] Update Fortran section of gcc-4.6/changes.html
  2010-12-15 22:34 ` Gerald Pfeifer
@ 2010-12-15 23:09   ` Steve Kargl
  2010-12-15 23:50     ` Daniel Franke
  0 siblings, 1 reply; 7+ messages in thread
From: Steve Kargl @ 2010-12-15 23:09 UTC (permalink / raw)
  To: Gerald Pfeifer; +Cc: Tobias Burnus, gcc-patches, fortran

On Thu, Dec 16, 2010 at 06:26:31AM +0800, Gerald Pfeifer wrote:
> On Thu, 19 Aug 2010, Tobias Burnus wrote:
> > I have already committed the attached patch, but don't hesitate to suggest
> > changes or other improvements.
> > 
> > Cf. http://gcc.gnu.org/gcc-4.6/changes.html#Fortran
> 
> The following snippet sounds a bit confusing to me, though admittedly
> I am not a Fortran hacker:
> 
> +       <li>Null pointers (including <code>NULL()</code>) and not
> +       allocated variables can be used as actual argument to optional
> +       non-pointer, non-allocatable dummy arguments, denoting an absent
> +       argument.</li>
> 
> Is "actual argument" a standard term?  "as actual argument to ...
> arguments, denoting an absent argument" sounds a bit tricky.

Yes, "actual argument" is a standard term. 

program test
   integer i
   call foo(i)    ! i is the actual argument.
end program test
subroutine foo(j) ! j is the dummy argument.
   integer j
   print *, j
end subroutine foo

In the standard, one finds passages of like "'i' is the
actual argument associated with the dummy argument 'j'".

I'll suggest a rewording of the form

    <li>Null pointers and unallocated allocatable variables can be used
        as actual arguments to optional non-pointer, non-allocatable
        dummy arguments to denote an absent argument.</li>

-- 
Steve

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [wwwdata] Update Fortran section of gcc-4.6/changes.html
  2010-12-15 23:09   ` Steve Kargl
@ 2010-12-15 23:50     ` Daniel Franke
  2010-12-16 10:22       ` Tobias Burnus
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Franke @ 2010-12-15 23:50 UTC (permalink / raw)
  To: fortran; +Cc: Steve Kargl, Gerald Pfeifer, Tobias Burnus, gcc-patches

On Wednesday 15 December 2010 23:38:53 Steve Kargl wrote:
> I'll suggest a rewording of the form
> 
>     <li>Null pointers and unallocated allocatable variables can be used
>         as actual arguments to optional non-pointer, non-allocatable
>         dummy arguments to denote an absent argument.</li>

Hi all,

since I missed the commit and this is news to me - maybe one could add a word 
why this _is_ news and actually noteworthy?

IIRC, there was something that absent dummy arguments where marked by 0L, 
hence one could not pass a NULL pointer as it would be seen as "absent" not as 
"present with value 0". If that's the one, mentioning it might certainly help 
an unaware reader.

Just a thought.

	Daniel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [wwwdata] Update Fortran section of gcc-4.6/changes.html
  2010-12-15 23:50     ` Daniel Franke
@ 2010-12-16 10:22       ` Tobias Burnus
  0 siblings, 0 replies; 7+ messages in thread
From: Tobias Burnus @ 2010-12-16 10:22 UTC (permalink / raw)
  To: Daniel Franke; +Cc: fortran, Steve Kargl, Gerald Pfeifer, gcc-patches

Gerald Pfeifer wrote:
> +<li>Null pointers (including<code>NULL()</code>) and not
> +       allocated variables can be used as actual argument to optional
> +       non-pointer, non-allocatable dummy arguments, denoting an absent
> +       argument.</li>

> +<li>Non-pointer variables with<code>TARGET</code>  attribute can

Quote from the introduction of the Fortran 2008 standard (cf. 
http://gcc.gnu.org/wiki/GFortranStandards):

"Fortran 2008 contains several extensions to Fortran 2003; some of these 
are listed below." [...]
"Programs and procedures: [...] An actual argument with the TARGET
attribute can correspond to a dummy pointer. A null pointer or 
unallocated allocatable can be used to
denote an absent nonallocatable nonpointer optional argument."

Regarding the latter:
a) Cf. Steve's email about the word "dummy" vs. "actual argument".

b) Fortran allows to have optional arguments. Internally, gfortran (and 
most other Fortran compilers) passes a NULL pointer if the (actual) 
argument is absent. However, doing so as user is only allowed since 
Fortran 2008. (For arrays also a code change was required.)

Daniel Franke wrote:
> since I missed the commit and this is news to me - maybe one could add a word
> why this_is_  news and actually noteworthy?

Regarding the noteworthiness: It is listed in the Fortran 2008 standard 
as being a new feature - thus listing it helps users knowing the F2008 
list  (while others are made aware of this feature); additionally, I 
think it is a quite useful feature as one now can pass, e.g., a 
not-allocated variable as absent argument. Before it only worked for 
scalar variables, relying on a particular implementation - now it also 
works for arrays.

However, one could also move it into the "Minor changes" item at 
http://gcc.gnu.org/gcc-4.6/changes.html#Fortran


> IIRC, there was something that absent dummy arguments where marked by 0L,
> hence one could not pass a NULL pointer as it would be seen as "absent" not as
> "present with value 0". If that's the one, mentioning it might certainly help
> an unaware reader.

No, that's a separate, still unfixed issue which only occurs if one 
mixes (pass by) VALUE with OPTIONAL arguments. (And a Fortran 2003 item 
as VALUE is allowed since 2003.)

(Side note: The upcoming technical report on further C interoperability 
will also allow C_NULL_PTR (C: "NULL") to denote an absent argument and, 
thus, allows "OPTIONAL" in BIND(C) procedure - but not together with VALUE.)

Tobias

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-12-16  8:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-19  8:21 [wwwdata] Update Fortran section of gcc-4.6/changes.html Tobias Burnus
2010-08-19  8:41 ` Daniel Kraft
2010-08-19 10:27   ` Tobias Burnus
2010-12-15 22:34 ` Gerald Pfeifer
2010-12-15 23:09   ` Steve Kargl
2010-12-15 23:50     ` Daniel Franke
2010-12-16 10:22       ` Tobias Burnus

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).