public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/46982] New: SIZE(TRANSFER()) as specification expression
@ 2010-12-16 20:50 burnus at gcc dot gnu.org
  2010-12-17  3:27 ` [Bug fortran/46982] " kargl at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2010-12-16 20:50 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46982

           Summary: SIZE(TRANSFER()) as specification expression
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


Found at
https://www.jiscmail.ac.uk/cgi-bin/webadmin?A1=ind1012&L=COMP-FORTRAN-90#2

Related: (C_)SIZEOF PR 46641

It seems as if the following might be valid - though none of my compiler
supports it. Steve Lionel wrote: "My reading of F2003 suggests that this
qualifies as a legal specification expression."


Example:

module something_mod
  integer, parameter :: dp = selected_real_kind(12)
  type something_type
      real(dp) :: a = 0.0_dp
      real(dp) :: b = 0.0_dp
      real(dp) :: c = 0.0_dp
  end type something_type
  type(something_type),save :: something
end module something_mod

  use something_mod
  integer :: something_array(size(transfer(something,(/0/))))
end


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

* [Bug fortran/46982] SIZE(TRANSFER()) as specification expression
  2010-12-16 20:50 [Bug fortran/46982] New: SIZE(TRANSFER()) as specification expression burnus at gcc dot gnu.org
@ 2010-12-17  3:27 ` kargl at gcc dot gnu.org
  2013-06-23 14:26 ` dominiq at lps dot ens.fr
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: kargl at gcc dot gnu.org @ 2010-12-17  3:27 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46982

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #1 from kargl at gcc dot gnu.org 2010-12-17 03:27:11 UTC ---
(In reply to comment #0)
> Found at
> https://www.jiscmail.ac.uk/cgi-bin/webadmin?A1=ind1012&L=COMP-FORTRAN-90#2
> 
> Related: (C_)SIZEOF PR 46641
> 
> It seems as if the following might be valid - though none of my compiler
> supports it. Steve Lionel wrote: "My reading of F2003 suggests that this
> qualifies as a legal specification expression."
> 

I believe James van Buskirk may disagree with Steve Lionel.

See
http://groups.google.com/group/comp.lang.fortran/browse_frm/thread/b36676064392854e#

I haven't looked at the issue farther than noticing James'
clf post.


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

* [Bug fortran/46982] SIZE(TRANSFER()) as specification expression
  2010-12-16 20:50 [Bug fortran/46982] New: SIZE(TRANSFER()) as specification expression burnus at gcc dot gnu.org
  2010-12-17  3:27 ` [Bug fortran/46982] " kargl at gcc dot gnu.org
@ 2013-06-23 14:26 ` dominiq at lps dot ens.fr
  2013-06-23 22:08 ` anlauf at gmx dot de
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-06-23 14:26 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46982

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-06-23
     Ever confirmed|0                           |1

--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Still present at revision 200321. Is the test in comment #0 valid or not?


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

* [Bug fortran/46982] SIZE(TRANSFER()) as specification expression
  2010-12-16 20:50 [Bug fortran/46982] New: SIZE(TRANSFER()) as specification expression burnus at gcc dot gnu.org
  2010-12-17  3:27 ` [Bug fortran/46982] " kargl at gcc dot gnu.org
  2013-06-23 14:26 ` dominiq at lps dot ens.fr
@ 2013-06-23 22:08 ` anlauf at gmx dot de
  2013-06-23 22:19 ` dominiq at lps dot ens.fr
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: anlauf at gmx dot de @ 2013-06-23 22:08 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46982

Harald Anlauf <anlauf at gmx dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anlauf at gmx dot de

--- Comment #3 from Harald Anlauf <anlauf at gmx dot de> ---
(In reply to Dominique d'Humieres from comment #2)
> Still present at revision 200321. Is the test in comment #0 valid or not?

Probably a case where the standard is not intuitive:

  size(transfer(something_type(),(/0/)))

is a constant expression, but

  size(transfer(something,(/0/)))

apparently is not, simply because "something" is not constant.
IMO it also appears not to qualify as a specification expression.

Replacing

  type(something_type),save :: something

by

  type(something_type),parameter :: something = something_type()

would change something into a constant and make the code compile.

So I think that the code in comment #0 is not legal.


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

* [Bug fortran/46982] SIZE(TRANSFER()) as specification expression
  2010-12-16 20:50 [Bug fortran/46982] New: SIZE(TRANSFER()) as specification expression burnus at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2013-06-23 22:08 ` anlauf at gmx dot de
@ 2013-06-23 22:19 ` dominiq at lps dot ens.fr
  2013-06-24 18:42 ` anlauf at gmx dot de
  2013-06-24 18:50 ` dominiq at lps dot ens.fr
  5 siblings, 0 replies; 7+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-06-23 22:19 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46982

--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> ... So I think that the code in comment #0 is not legal.

Then, should not this PR closed as INVALID?


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

* [Bug fortran/46982] SIZE(TRANSFER()) as specification expression
  2010-12-16 20:50 [Bug fortran/46982] New: SIZE(TRANSFER()) as specification expression burnus at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2013-06-23 22:19 ` dominiq at lps dot ens.fr
@ 2013-06-24 18:42 ` anlauf at gmx dot de
  2013-06-24 18:50 ` dominiq at lps dot ens.fr
  5 siblings, 0 replies; 7+ messages in thread
From: anlauf at gmx dot de @ 2013-06-24 18:42 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46982

--- Comment #5 from Harald Anlauf <anlauf at gmx dot de> ---
(In reply to Dominique d'Humieres from comment #4)
> > ... So I think that the code in comment #0 is not legal.
> 
> Then, should not this PR closed as INVALID?

Yes, close as INVALID.

----------------------

For the record: NAG Fortran Compiler Release 5.3.1(928) says

SOMETHING is not permitted in an initialisation expression


and xlf 14.01.0000.0003 complains:

Variable something_array was declared as array of type ADJUSTABLE.  This type
of array is not permitted in a main program.


Only pgi 13.4-0 accepts it, but I believe that it shouldn't.


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

* [Bug fortran/46982] SIZE(TRANSFER()) as specification expression
  2010-12-16 20:50 [Bug fortran/46982] New: SIZE(TRANSFER()) as specification expression burnus at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2013-06-24 18:42 ` anlauf at gmx dot de
@ 2013-06-24 18:50 ` dominiq at lps dot ens.fr
  5 siblings, 0 replies; 7+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-06-24 18:50 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46982

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #6 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> Yes, close as INVALID.

Hence closed.


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

end of thread, other threads:[~2013-06-24 18:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-16 20:50 [Bug fortran/46982] New: SIZE(TRANSFER()) as specification expression burnus at gcc dot gnu.org
2010-12-17  3:27 ` [Bug fortran/46982] " kargl at gcc dot gnu.org
2013-06-23 14:26 ` dominiq at lps dot ens.fr
2013-06-23 22:08 ` anlauf at gmx dot de
2013-06-23 22:19 ` dominiq at lps dot ens.fr
2013-06-24 18:42 ` anlauf at gmx dot de
2013-06-24 18:50 ` dominiq at lps dot ens.fr

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