public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/29962] New: Initialization expressions checking in gfc_intrinsic_func_interface
@ 2006-11-23 20:35 burnus at gcc dot gnu dot org
2006-11-23 21:10 ` [Bug fortran/29962] " burnus at gcc dot gnu dot org
` (20 more replies)
0 siblings, 21 replies; 22+ messages in thread
From: burnus at gcc dot gnu dot org @ 2006-11-23 20:35 UTC (permalink / raw)
To: gcc-bugs
We should only allow
a) elemental functions
b) we currently check gfc_init_expr_extensions():
/* FIXME: This should be moved into the intrinsic definitions. */
static const char * const init_expr_extensions[] = {
"digits", "epsilon", "huge", "kind", "maxexponent", "minexponent",
"precision", "present", "radix", "range", "selected_real_kind",
"tiny", NULL
};
I'm neither sure whether this is correct nor whether this is complete.
See: "7.1.7 Initialization expression" in Fortran 2003 and
"7.1.6.1 Constant expression" in Fortran 95.
There is at least the following difference between the standards:
F2003: [Allowed is] "A reference to an elemental standard intrinsic function,
where each argument is an initialization expression"
F95:
"An initialization expression is a constant expression in which the
exponentiation operation is
permitted only with an integer power, and each primary is
[...]
(4) An elemental intrinsic function reference of type integer or character
where each argument is an initialization expression of type integer or
character"
--
Summary: Initialization expressions checking in
gfc_intrinsic_func_interface
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29962
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Bug fortran/29962] Initialization expressions checking in gfc_intrinsic_func_interface
2006-11-23 20:35 [Bug fortran/29962] New: Initialization expressions checking in gfc_intrinsic_func_interface burnus at gcc dot gnu dot org
@ 2006-11-23 21:10 ` burnus at gcc dot gnu dot org
2006-11-23 21:59 ` burnus at gcc dot gnu dot org
` (19 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: burnus at gcc dot gnu dot org @ 2006-11-23 21:10 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from burnus at gcc dot gnu dot org 2006-11-23 21:10 -------
I just realized I was too brief:
There are three types of initialization expressions (IE):
- Valid in F95
- Added as valid F2003
- Only valid as GNU extensions
We need to check:
- Is there a non-elemental function in the IE
- Is the list in gfc_init_expr_extensions() correct:
/* FIXME: This should be moved into the intrinsic definitions. */
static const char * const init_expr_extensions[] = {
"digits", "epsilon", "huge", "kind", "maxexponent", "minexponent",
"precision", "present", "radix", "range", "selected_real_kind",
"tiny", NULL
It is currently used in gfc_intrinsic_func_interface as:
if (gfc_init_expr && flag && gfc_init_expr_extensions (specific))
- Do we miss some other restriction?
- Do we miss another change between F95 and F2003 except that
noninteger/noncharacter arguments to elemental intrinsics are allowed?
- Is it possible to reach the "gfc_notify_std (GFC_STD_GNU," block, if one
checks for "if (expr->ts.type != BT_INTEGER && expr->ts.type != BT_CHARACTER)"
and does one allows things in F2003 which should not be allowed?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29962
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Bug fortran/29962] Initialization expressions checking in gfc_intrinsic_func_interface
2006-11-23 20:35 [Bug fortran/29962] New: Initialization expressions checking in gfc_intrinsic_func_interface 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
` (18 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: burnus at gcc dot gnu dot org @ 2006-11-23 21:59 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from burnus at gcc dot gnu dot org 2006-11-23 21:58 -------
One other thing we need to change:
real, parameter :: d = 2.0**0.5
1
Error: Exponent at (1) must be INTEGER for an initialization expression
This is now also allowed in F2003.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29962
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Bug fortran/29962] Initialization expressions checking in gfc_intrinsic_func_interface
2006-11-23 20:35 [Bug fortran/29962] New: Initialization expressions checking in gfc_intrinsic_func_interface 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
2006-11-24 7:20 ` burnus at gcc dot gnu dot org
` (17 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: burnus at gcc dot gnu dot org @ 2006-11-23 23:52 UTC (permalink / raw)
To: gcc-bugs
------- 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
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Bug fortran/29962] Initialization expressions checking in gfc_intrinsic_func_interface
2006-11-23 20:35 [Bug fortran/29962] New: Initialization expressions checking in gfc_intrinsic_func_interface burnus at gcc dot gnu dot org
` (2 preceding siblings ...)
2006-11-23 23:52 ` burnus at gcc dot gnu dot org
@ 2006-11-24 7:20 ` burnus at gcc dot gnu dot org
2006-11-27 10:15 ` patchapp at dberlin dot org
` (16 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: burnus at gcc dot gnu dot org @ 2006-11-24 7:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from burnus at gcc dot gnu dot org 2006-11-24 07:19 -------
Some more points (thanks to Richard Main for pointing out):
Not all inquiry functions are allowed but only "specification inquiry" listed
in 7.1.6:
- Array inquiry (14.5.7; lbound, ubound, shape, size)
- bit_size
- len
- kind
- new_line
- numeric inquiry (13.5.8, digits, epsilon, huge, maxexponent, minexponent,
precision, radix, range, tiny)
- type parameter inquiry (6.1.3): designator % type-parm-name (examples:
a%kind, a%len, b(10)%kind, p%len)
- IEEE inquiry function (14.9.1: IEEE_support_flag, IEEE_support_flag;
IEEE_support_datatype, IEEE_support_denormal, IEEE_support_divide,
IEEE_support_inf, IEEE_support_io, IEEE_support_nan, IEEE_support_rounding,
IEEE_support_sqrt, IEEE_support_standard, IEEE_support_underflow_control
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29962
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Bug fortran/29962] Initialization expressions checking in gfc_intrinsic_func_interface
2006-11-23 20:35 [Bug fortran/29962] New: Initialization expressions checking in gfc_intrinsic_func_interface burnus at gcc dot gnu dot org
` (3 preceding siblings ...)
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
` (15 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: patchapp at dberlin dot org @ 2006-11-27 10:15 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from patchapp at dberlin dot org 2006-11-27 10:15 -------
Subject: Bug number PR29962
A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2006-11/msg01799.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29962
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Bug fortran/29962] Initialization expressions checking in gfc_intrinsic_func_interface
2006-11-23 20:35 [Bug fortran/29962] New: Initialization expressions checking in gfc_intrinsic_func_interface burnus at gcc dot gnu dot org
` (4 preceding siblings ...)
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
` (14 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: burnus at gcc dot gnu dot org @ 2006-12-04 20:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from burnus at gcc dot gnu dot org 2006-12-04 20:03 -------
Subject: Bug 29962
Author: burnus
Date: Mon Dec 4 20:02:43 2006
New Revision: 119505
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119505
Log:
fortran/
2006-12-04 Tobias Burnus <burnus@net-b.de>
PR fortran/29962
* expr.c (check_intrinsic_op): Allow noninteger exponents for F2003.
testsuite/
2006-12-04 Tobias Burnus <burnus@net-b.de>
PR fortran/29962
* initialization_4.f90: Test noninteger exponents (-std=f95).
* initialization_5.f90: New test for noninteger exponents with
-std=f2003
Added:
trunk/gcc/testsuite/gfortran.dg/initialization_5.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/expr.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/initialization_4.f90
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29962
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Bug fortran/29962] Initialization expressions checking in gfc_intrinsic_func_interface
2006-11-23 20:35 [Bug fortran/29962] New: Initialization expressions checking in gfc_intrinsic_func_interface burnus at gcc dot gnu dot org
` (5 preceding siblings ...)
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
` (13 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-03-06 7:57 UTC (permalink / raw)
To: gcc-bugs
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fxcoudert at gcc dot gnu dot
| |org
Severity|enhancement |normal
Keywords| |accepts-invalid
Last reconfirmed|2006-11-23 23:51:55 |2007-03-06 07:57:16
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29962
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Bug fortran/29962] Initialization expressions checking in gfc_intrinsic_func_interface
2006-11-23 20:35 [Bug fortran/29962] New: Initialization expressions checking in gfc_intrinsic_func_interface burnus at gcc dot gnu dot org
` (6 preceding siblings ...)
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
` (12 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-06-23 16:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from burnus at gcc dot gnu dot org 2007-06-23 16:13 -------
TRANSFER is rejected at initialization expression (w/ -std=f95 & f2003) but it
is allowed per 7.1.6.1 Constant expression / initialization expression (F95
standard):
"(5) A reference to one of the transformational functions REPEAT, RESHAPE,
SELECTED_INT_KIND, SELECTED_REAL_KIND, TRANSFER, or TRIM, where each
argument is an initialization expression,"
gfortran -std=f95 rejects it with:
Evaluation of nonstandard initialization expression
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29962
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Bug fortran/29962] Initialization expressions checking in gfc_intrinsic_func_interface
2006-11-23 20:35 [Bug fortran/29962] New: Initialization expressions checking in gfc_intrinsic_func_interface burnus at gcc dot gnu dot org
` (7 preceding siblings ...)
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
` (11 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-07-22 16:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from dfranke at gcc dot gnu dot org 2007-07-22 16:31 -------
Subject: Bug 29962
Author: dfranke
Date: Sun Jul 22 16:31:11 2007
New Revision: 126826
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126826
Log:
gcc/fortran:
2007-07-22 Daniel Franke <franke.daniel@gmail.com>
PR fortran/29962
PR fortran/31253
PR fortran/31265
PR fortran/31639
* gfortran.h (gfc_intrinsic_sym): Changed members elemental, pure,
generic, specific, actual_ok, noreturn into bits of a bitfield,
added bits for inquiry, transformational, conversion.
* check.c (non_init_transformational): Removed, removed all callers.
* intrinsic.c (enum class): New.
(add_sym*): Replaced argument elemetal by enum class. Changed all
callers.
(add_functions): Assign appropriate classes to intrinsic functions.
(add_subroutines): Assign appropriate classes to intrinsic subroutines.
(add_conv): Set conversion attribute.
(gfc_init_expr_extensions): Removed, removed all callers.
(gfc_intrinsic_func_interface): Reimplemented check for non-standard
initializatione expressions.
* expr.c (check_specification_function): New.
(gfc_is_constant_expr): Added check for specification functions.
(check_init_expr_arguments): New.
(check_inquiry): Changed return value to MATCH, added checks for
inquiry functions defined by F2003.
(check_transformational): New.
(check_null): New.
(check_elemental): New.
(check_conversion): New.
(check_init_expr): Call new check functions, add more specific error
messages.
gcc/testsuite:
2007-07-22 Daniel Franke <franke.daniel@gmail.com>
PR fortran/29962
* gfortran.dg/array_initializer_1.f90: Removed warning.
* gfortran.dg/initialization_1.f90: Adjusted messages.
* gfortran.dg/nested_modules_6.f90: Removed warning.
PR fortran/31253
* gfortran.dg/initialization_7.f90: New test.
PR fortran/31639
* gfortran.dg/initialization_8.f90: New test.
Added:
trunk/gcc/testsuite/gfortran.dg/initialization_7.f90
trunk/gcc/testsuite/gfortran.dg/initialization_8.f90
Modified:
trunk/gcc/fortran/check.c
trunk/gcc/fortran/expr.c
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/intrinsic.c
trunk/gcc/testsuite/gfortran.dg/array_initializer_1.f90
trunk/gcc/testsuite/gfortran.dg/initialization_1.f90
trunk/gcc/testsuite/gfortran.dg/nested_modules_6.f90
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29962
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Bug fortran/29962] Initialization expressions checking in gfc_intrinsic_func_interface
2006-11-23 20:35 [Bug fortran/29962] New: Initialization expressions checking in gfc_intrinsic_func_interface burnus at gcc dot gnu dot org
` (8 preceding siblings ...)
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
` (10 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-07-24 13:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from burnus at gcc dot gnu dot org 2007-07-24 13:31 -------
Daniel, could you update the bug status; e.g. mark it as fixed or write what
still needs to be done.
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dfranke at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29962
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Bug fortran/29962] Initialization expressions
2006-11-23 20:35 [Bug fortran/29962] New: Initialization expressions checking in gfc_intrinsic_func_interface burnus at gcc dot gnu dot org
` (9 preceding siblings ...)
2007-07-24 13:32 ` burnus at gcc dot gnu dot org
@ 2007-07-24 18:41 ` dfranke at gcc dot gnu dot org
2007-10-05 19:52 ` tobi at gcc dot gnu dot org
` (9 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-07-24 18:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from dfranke at gcc dot gnu dot org 2007-07-24 18:41 -------
Changed the title as init expressions are not restricted to the previously
named function.
The following is a list of items I am aware of that need to be done before init
expressions are complete:
TODO for F95, 7.1.6.1:
* nothing?!
TODO for F2003, 7.1.6, Specification Inquiry:
* "(7)a type parameter inquiry (6.1.3)"
TODO for F2003, 7.1.7:
* simplifiers for transformational intrinsics other than those listed by F95
* anything related to IEEE (see also PR29383)
* "(9) A kind type parameter of the derived type being defined"
Please add to this list whatever I may have missed :)
--
dfranke at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|Initialization expressions |Initialization expressions
|checking in |
|gfc_intrinsic_func_interface|
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29962
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Bug fortran/29962] Initialization expressions
2006-11-23 20:35 [Bug fortran/29962] New: Initialization expressions checking in gfc_intrinsic_func_interface burnus at gcc dot gnu dot org
` (10 preceding siblings ...)
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
` (8 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: tobi at gcc dot gnu dot org @ 2007-10-05 19:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from tobi at gcc dot gnu dot org 2007-10-05 19:51 -------
Wonderful, I just had a look at this bug. Implementing transformational
functions in the compiler will be a lot of joy. See gfc_simplify_reshape for
the delights this brings.
--
tobi at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2007-03-06 07:57:16 |2007-10-05 19:51:56
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29962
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Bug fortran/29962] Initialization expressions
2006-11-23 20:35 [Bug fortran/29962] New: Initialization expressions checking in gfc_intrinsic_func_interface burnus at gcc dot gnu dot org
` (11 preceding siblings ...)
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
` (7 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2009-03-23 19:57 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from dfranke at gcc dot gnu dot org 2009-03-23 19:56 -------
*** Bug 38205 has been marked as a duplicate of this bug. ***
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29962
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Bug fortran/29962] Initialization expressions
2006-11-23 20:35 [Bug fortran/29962] New: Initialization expressions checking in gfc_intrinsic_func_interface burnus at gcc dot gnu dot org
` (12 preceding siblings ...)
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
` (6 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2009-03-23 20:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from dfranke at gcc dot gnu dot org 2009-03-23 20:03 -------
Transformational intrinsics, one down: PACK (PR32890).
Left:
* all, any, count
* maxloc, minloc
* maxval, minval (generic case)
* product, sum
* dot_product, matmul, transpose
* unpack, spread
* cshift, eoshift
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29962
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Bug fortran/29962] Initialization expressions
2006-11-23 20:35 [Bug fortran/29962] New: Initialization expressions checking in gfc_intrinsic_func_interface burnus at gcc dot gnu dot org
` (13 preceding siblings ...)
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
` (5 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2009-03-31 20:02 UTC (permalink / raw)
To: gcc-bugs
------- Comment #14 from dfranke at gcc dot gnu dot org 2009-03-31 20:02 -------
Subject: Bug 29962
Author: dfranke
Date: Tue Mar 31 20:01:51 2009
New Revision: 145369
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145369
Log:
gcc/fortran/:
2009-03-31 Daniel Franke <franke.daniel@gmail.com>
PR fortran/25104
PR fortran/29962
* intrinsic.h (gfc_simplify_dot_product): New prototype.
(gfc_simplify_matmul): Likewise.
(gfc_simplify_transpose): Likewise.
* intrinsic.c (add_functions): Added new simplifier callbacks.
* simplify.c (init_result_expr): New.
(compute_dot_product): New.
(gfc_simplify_dot_product): New.
(gfc_simplify_matmul): New.
(gfc_simplify_transpose): New.
* expr.c (check_transformational): Allow transformational intrinsics
with simplifier in initialization expression.
gcc/testsuite/:
2009-03-31 Daniel Franke <franke.daniel@gmail.com>
PR fortran/25104
PR fortran/29962
* gfortran.dg/dot_product_1.f03: New.
* gfortran.dg/matmul_8.f03: New.
* gfortran.dg/transpose_3.f03: New.
Added:
branches/fortran-dev/gcc/testsuite/gfortran.dg/dot_product_1.f03
branches/fortran-dev/gcc/testsuite/gfortran.dg/matmul_8.f03
branches/fortran-dev/gcc/testsuite/gfortran.dg/transpose_3.f03
Modified:
branches/fortran-dev/gcc/fortran/ChangeLog.dev
branches/fortran-dev/gcc/fortran/expr.c
branches/fortran-dev/gcc/fortran/intrinsic.c
branches/fortran-dev/gcc/fortran/intrinsic.h
branches/fortran-dev/gcc/fortran/simplify.c
branches/fortran-dev/gcc/testsuite/ChangeLog.fortran-dev
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29962
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Bug fortran/29962] Initialization expressions
2006-11-23 20:35 [Bug fortran/29962] New: Initialization expressions checking in gfc_intrinsic_func_interface burnus at gcc dot gnu dot org
` (14 preceding siblings ...)
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
` (4 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2009-04-05 20:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #15 from dfranke at gcc dot gnu dot org 2009-04-05 20:40 -------
Subject: Bug 29962
Author: dfranke
Date: Sun Apr 5 20:40:13 2009
New Revision: 145573
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145573
Log:
gcc/fortran/:
2009-04-05 Daniel Franke <franke.daniel@gmail.com>
PR fortran/25104
PR fortran/29962
* check.c (gfc_check_all_any): Check rank of DIM.
(gfc_check_count): Likewise.
* intrinsic.h (gfc_simplify_all): New prototype.
(gfc_simplify_any): Likewise.
(gfc_simplify_count): Likewise.
(gfc_simplify_sum): Likewise.
(gfc_simplify_product): Likewise.
* intrinsic.c (add_functions): Added new simplifier callbacks.
* simplify.c (transformational_result): New.
(simplify_transformation_to_scalar): New.
(simplify_transformation_to_array): New.
(gfc_count): New.
(gfc_simplify_all): New.
(gfc_simplify_any): New.
(gfc_simplify_count): New.
(gfc_simplify_sum): New.
(gfc_simplify_product): New.
* expr.c (check_transformational): Allow additional transformational
intrinsics in initialization expression.
gcc/testsuite/:
2009-04-05 Daniel Franke <franke.daniel@gmail.com>
PR fortran/25104
PR fortran/29962
* gfortran.dg/count_init_expr.f03
* gfortran.dg/product_init_expr.f03
* gfortran.dg/sum_init_expr.f03
Added:
branches/fortran-dev/gcc/testsuite/gfortran.dg/count_init_expr.f03
branches/fortran-dev/gcc/testsuite/gfortran.dg/product_init_expr.f03
branches/fortran-dev/gcc/testsuite/gfortran.dg/sum_init_expr.f03
Modified:
branches/fortran-dev/gcc/fortran/ChangeLog.dev
branches/fortran-dev/gcc/fortran/check.c
branches/fortran-dev/gcc/fortran/expr.c
branches/fortran-dev/gcc/fortran/intrinsic.c
branches/fortran-dev/gcc/fortran/intrinsic.h
branches/fortran-dev/gcc/fortran/simplify.c
branches/fortran-dev/gcc/testsuite/ChangeLog.fortran-dev
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29962
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Bug fortran/29962] Initialization expressions
2006-11-23 20:35 [Bug fortran/29962] New: Initialization expressions checking in gfc_intrinsic_func_interface burnus at gcc dot gnu dot org
` (15 preceding siblings ...)
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
` (3 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2009-04-10 14:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #16 from dfranke at gcc dot gnu dot org 2009-04-10 14:04 -------
Subject: Bug 29962
Author: dfranke
Date: Fri Apr 10 14:04:16 2009
New Revision: 145907
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145907
Log:
gcc/fortran/:
2009-04-10 Daniel Franke <franke.daniel@gmail.com>
PR fortran/25104
PR fortran/29962
* array.c (gfc_append_constructor): Added NULL-check.
* check.c (gfc_check_spread): Check DIM.
(gfc_check_unpack): Check that the ARRAY arguments provides enough
values for MASK.
* intrinsic.h (gfc_simplify_spread): New prototype.
(gfc_simplify_unpack): Likewise.
* intrinsic.c (add_functions): Added new simplifier callbacks.
* simplify.c (gfc_simplify_spread): New.
(gfc_simplify_unpack): New.
* expr.c (check_transformational): Allow additional transformational
intrinsics in initialization expression.
gcc/testsuite/:
2009-04-10 Daniel Franke <franke.daniel@gmail.com>
PR fortran/25104
PR fortran/29962
* gfortran.dg/spread_init_expr.f03: New.
* gfortran.dg/unpack_init_expr.f03: New.
* gfortran.dg/intrinsic_argument_conformance_2.f90: Adjusted
error message.
Added:
branches/fortran-dev/gcc/testsuite/gfortran.dg/spread_init_expr.f03
branches/fortran-dev/gcc/testsuite/gfortran.dg/unpack_init_expr.f03
Modified:
branches/fortran-dev/gcc/fortran/ChangeLog.dev
branches/fortran-dev/gcc/fortran/array.c
branches/fortran-dev/gcc/fortran/check.c
branches/fortran-dev/gcc/fortran/expr.c
branches/fortran-dev/gcc/fortran/intrinsic.c
branches/fortran-dev/gcc/fortran/intrinsic.h
branches/fortran-dev/gcc/fortran/simplify.c
branches/fortran-dev/gcc/testsuite/ChangeLog.fortran-dev
branches/fortran-dev/gcc/testsuite/gfortran.dg/intrinsic_argument_conformance_2.f90
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29962
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Bug fortran/29962] Initialization expressions
2006-11-23 20:35 [Bug fortran/29962] New: Initialization expressions checking in gfc_intrinsic_func_interface burnus at gcc dot gnu dot org
` (16 preceding siblings ...)
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
` (2 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-06-07 11:53 UTC (permalink / raw)
To: gcc-bugs
------- Comment #17 from burnus at gcc dot gnu dot org 2009-06-07 11:53 -------
Subject: Bug 29962
Author: burnus
Date: Sun Jun 7 11:53:21 2009
New Revision: 148243
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=148243
Log:
2009-06-07 Daniel Franke <franke.daniel@gmail.com>
PR fortran/25104
PR fortran/29962
* intrinsic.h (gfc_simplify_dot_product): New prototype.
(gfc_simplify_matmul): Likewise.
(gfc_simplify_transpose): Likewise.
* intrinsic.c (add_functions): Added new simplifier callbacks.
* simplify.c (init_result_expr): New.
(compute_dot_product): New.
(gfc_simplify_dot_product): New.
(gfc_simplify_matmul): New.
(gfc_simplify_transpose): New.
* expr.c (check_transformational): Allow transformational
* intrinsics
with simplifier in initialization expression.
2009-06-07 Daniel Franke <franke.daniel@gmail.com>
PR fortran/25104
PR fortran/29962
* gfortran.dg/dot_product_1.f03: New.
* gfortran.dg/matmul_8.f03: New.
* gfortran.dg/transpose_3.f03: New.
Added:
trunk/gcc/testsuite/gfortran.dg/dot_product_1.f03
trunk/gcc/testsuite/gfortran.dg/matmul_8.f03
trunk/gcc/testsuite/gfortran.dg/transpose_3.f03
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/expr.c
trunk/gcc/fortran/intrinsic.c
trunk/gcc/fortran/intrinsic.h
trunk/gcc/fortran/simplify.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29962
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Bug fortran/29962] Initialization expressions
2006-11-23 20:35 [Bug fortran/29962] New: Initialization expressions checking in gfc_intrinsic_func_interface burnus at gcc dot gnu dot org
` (17 preceding siblings ...)
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
20 siblings, 0 replies; 22+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-06-07 16:35 UTC (permalink / raw)
To: gcc-bugs
------- Comment #18 from burnus at gcc dot gnu dot org 2009-06-07 16:35 -------
Subject: Bug 29962
Author: burnus
Date: Sun Jun 7 16:35:06 2009
New Revision: 148249
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=148249
Log:
2009-06-07 Daniel Franke <franke.daniel@gmail.com>
PR fortran/25104
PR fortran/29962
* check.c (gfc_check_all_any): Check rank of DIM.
(gfc_check_count): Likewise.
* intrinsic.h (gfc_simplify_all): New prototype.
(gfc_simplify_any): Likewise.
(gfc_simplify_count): Likewise.
(gfc_simplify_sum): Likewise.
(gfc_simplify_product): Likewise.
* intrinsic.c (add_functions): Added new simplifier callbacks.
* simplify.c (transformational_result): New.
(simplify_transformation_to_scalar): New.
(simplify_transformation_to_array): New.
(gfc_count): New.
(gfc_simplify_all): New.
(gfc_simplify_any): New.
(gfc_simplify_count): New.
(gfc_simplify_sum): New.
(gfc_simplify_product): New.
* expr.c (check_transformational): Allow additional
* transformational
intrinsics in initialization expression.
2009-06-07 Daniel Franke <franke.daniel@gmail.com>
PR fortran/25104
PR fortran/29962
* gfortran.dg/count_init_expr.f03
* gfortran.dg/product_init_expr.f03
* gfortran.dg/sum_init_expr.f03
Added:
trunk/gcc/testsuite/gfortran.dg/count_init_expr.f03
trunk/gcc/testsuite/gfortran.dg/product_init_expr.f03
trunk/gcc/testsuite/gfortran.dg/sum_init_expr.f03
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/check.c
trunk/gcc/fortran/expr.c
trunk/gcc/fortran/intrinsic.c
trunk/gcc/fortran/intrinsic.h
trunk/gcc/fortran/simplify.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29962
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Bug fortran/29962] Initialization expressions
2006-11-23 20:35 [Bug fortran/29962] New: Initialization expressions checking in gfc_intrinsic_func_interface burnus at gcc dot gnu dot org
` (18 preceding siblings ...)
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
20 siblings, 0 replies; 22+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-06-07 17:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #19 from burnus at gcc dot gnu dot org 2009-06-07 17:33 -------
Subject: Bug 29962
Author: burnus
Date: Sun Jun 7 17:33:34 2009
New Revision: 148250
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=148250
Log:
2009-06-07 Daniel Franke <franke.daniel@gmail.com>
PR fortran/25104
PR fortran/29962
* array.c (gfc_append_constructor): Added NULL-check.
* check.c (gfc_check_spread): Check DIM.
(gfc_check_unpack): Check that the ARRAY arguments provides
enough values for MASK.
* intrinsic.h (gfc_simplify_spread): New prototype.
(gfc_simplify_unpack): Likewise.
* intrinsic.c (add_functions): Added new simplifier callbacks.
* simplify.c (gfc_simplify_spread): New.
(gfc_simplify_unpack): New.
* expr.c (check_transformational): Allow additional
* transformational
intrinsics in initialization expression.
2009-06-07 Daniel Franke <franke.daniel@gmail.com>
PR fortran/25104
PR fortran/29962
* gfortran.dg/spread_init_expr.f03: New.
* gfortran.dg/unpack_init_expr.f03: New.
* gfortran.dg/intrinsic_argument_conformance_2.f90: Adjusted
error message.
Added:
trunk/gcc/testsuite/gfortran.dg/spread_init_expr.f03
trunk/gcc/testsuite/gfortran.dg/unpack_init_expr.f03
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/array.c
trunk/gcc/fortran/check.c
trunk/gcc/fortran/expr.c
trunk/gcc/fortran/intrinsic.c
trunk/gcc/fortran/intrinsic.h
trunk/gcc/fortran/simplify.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/intrinsic_argument_conformance_2.f90
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29962
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Bug fortran/29962] Initialization expressions
2006-11-23 20:35 [Bug fortran/29962] New: Initialization expressions checking in gfc_intrinsic_func_interface burnus at gcc dot gnu dot org
` (19 preceding siblings ...)
2009-06-07 17:34 ` burnus at gcc dot gnu dot org
@ 2009-12-04 22:07 ` dfranke at gcc dot gnu dot org
20 siblings, 0 replies; 22+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2009-12-04 22:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #20 from dfranke at gcc dot gnu dot org 2009-12-04 22:07 -------
Transformational intrinsics, done are:
* all, any, count
* product, sum
* dot_product, matmul, transpose
* pack, unpack, spread
Left:
* maxloc, minloc
* maxval, minval (generic case)
* cshift, eoshift
While at it, see also PR29600 (kind arguments) and PR36313 (character type).
Earlier this year, I was working on the cshift/eoshift, but I strongly believe
that the linear list that builds the constructor must be replaced with splay
trees before this can be implemented somewhat efficiently.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29962
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2009-12-04 22:07 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-23 20:35 [Bug fortran/29962] New: Initialization expressions checking in gfc_intrinsic_func_interface 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
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
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).