public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/29962] Initialization expressions checking in gfc_intrinsic_func_interface
Date: Thu, 23 Nov 2006 23:52:00 -0000	[thread overview]
Message-ID: <20061123235155.12263.qmail@sourceware.org> (raw)
In-Reply-To: <bug-29962-13404@http.gcc.gnu.org/bugzilla/>



------- Comment #3 from burnus at gcc dot gnu dot org  2006-11-23 23:51 -------
Non-elemental intrinsic functions in Section 13.7 of Fortran 2003:

ALL(T), ALLOCATED(I), ANY(T), ASSOCIATED(I), BIT_SIZE(I),
COMMAND_ARGUMENT_COUNT(I), COUNT(T), CSHIFT(T), DIGITS(I), DOT_PRODUCT(T),
EOSHIFT(T), EPSILON(I), EXTENDS_TYPE_OF(I), HUGE(I), KIND(I), LBOUND(I),
LEN(I), MATMUL(T), MAXLOC(T), MAXVAL(T), MINLOC(T), MINVAL(T), NEW_LINE(I),
NULL(T), PACK(T), PRECISION(I), PRESENT(I),  PRODUCT(T), RADIX(I), RANGE(I),
REPEAT(T), RESHAPE(T), SAME_TYPE_AS(I), SELECTED_CHAR_KIND(T),
SELECTED_INT_KIND(T), SELECTED_REAL_KIND(T), SHAPE(I), SIZE(I), SPREAD(T),
SUM(T),  TINY(I), TRANSFER(T), TRANPOSE(T), TRIM(T), UBOUND(I), UNPACK(T), 

(I) = Inquiry functiony
(T) = Transformational function

Allowed in Fortran 2003:
- elemental standard intrinsic functions (with argument = initialization
expression)
- transformational standard intrinsic functions (constrain: dito), not NULL()
- NULL() without non-initialization expression type parameters
- Inquiry function where argument is either an initialization expression - or
when not needed - properties are not deferred/assumed or noninit. expr.
>From modules:
- IEEE_SELECTED_REAL_KIND

(Remark: This seems to allow command_line_argument(), but this is technically
not possible! -- well, if it is not supported, "0" can be returned)


Fortran 95:

- elemental functions: Only with initi.expr. of integer/character type
- Transformational functions: Only REPEAT, RESHAPE, SELECTED_INT_KIND,
SELECTED_REAL_KIND, TRANSFER, TRIM: w/ init.expr.-
- NULL
- Array inquiry function but not ALLOCATED [i.e.:  lbound, ubound, shape, size,
]
- BIT_SIZE, LEN, KIND
- Numeric inquiry function: digits, epsilon,huge,maxexponent, minexponent,
precision, radix,range,tiny

I don't think GFC_STD_GNU allows more than Fortran 2003 (and extra intrinsics
of -std=gnu are filtered out earlier).

Current problems:
---------------------------
 real :: p
 real, parameter :: x = TRANSFER('a',p)
end
Error:
Parameter 'p' at (1) has not been declared or is a variable, which does not
reduce to a constant expression
Works with g95, fails with ifort, f95, sunf95.
I believe this is valid in Fortran 95 (and Fortran 2003)
---------------------------
 real, parameter :: x = dot_product( (/1/), (/2/))
                      1
Error: transformational intrinsic 'dot_product' at (1) is not permitted in an
initialization expression
- Should be valid in Fortran 2003
- fails also in g95, f95, ifort
Presumably analogously: matmul, ...
---------------------------


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-11-23 23:51:55
               date|                            |


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


  parent reply	other threads:[~2006-11-23 23:52 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-23 20:35 [Bug fortran/29962] New: " burnus at gcc dot gnu dot org
2006-11-23 21:10 ` [Bug fortran/29962] " burnus at gcc dot gnu dot org
2006-11-23 21:59 ` burnus at gcc dot gnu dot org
2006-11-23 23:52 ` burnus at gcc dot gnu dot org [this message]
2006-11-24  7:20 ` burnus at gcc dot gnu dot org
2006-11-27 10:15 ` patchapp at dberlin dot org
2006-12-04 20:03 ` burnus at gcc dot gnu dot org
2007-03-06  7:57 ` fxcoudert at gcc dot gnu dot org
2007-06-23 16:13 ` burnus at gcc dot gnu dot org
2007-07-22 16:32 ` dfranke at gcc dot gnu dot org
2007-07-24 13:32 ` burnus at gcc dot gnu dot org
2007-07-24 18:41 ` [Bug fortran/29962] Initialization expressions dfranke at gcc dot gnu dot org
2007-10-05 19:52 ` tobi at gcc dot gnu dot org
2009-03-23 19:57 ` dfranke at gcc dot gnu dot org
2009-03-23 20:04 ` dfranke at gcc dot gnu dot org
2009-03-31 20:02 ` dfranke at gcc dot gnu dot org
2009-04-05 20:40 ` dfranke at gcc dot gnu dot org
2009-04-10 14:04 ` dfranke at gcc dot gnu dot org
2009-06-07 11:53 ` burnus at gcc dot gnu dot org
2009-06-07 16:35 ` burnus at gcc dot gnu dot org
2009-06-07 17:34 ` burnus at gcc dot gnu dot org
2009-12-04 22:07 ` dfranke at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061123235155.12263.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).