public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/30888] New: %VAL construct fails with argument procedures
@ 2007-02-20 17:40 p dot w dot draper at durham dot ac dot uk
2007-02-20 19:54 ` [Bug fortran/30888] " burnus at gcc dot gnu dot org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: p dot w dot draper at durham dot ac dot uk @ 2007-02-20 17:40 UTC (permalink / raw)
To: gcc-bugs
When calling procedures which are passed as arguments to
a subroutine the %VAL construct has inconsistent behaviour.
Consider the following code:
SUBROUTINE VALTEST( DOIT )
EXTERNAL DOIT
INTEGER P
INTEGER I
I = 0
P = 0
CALL DOIT( %VAL( P ) )
CALL DOIT( I )
CALL DOIT( %VAL( P ) )
END
> gfortran -c valtest.f
valtest.f:9.22:
CALL DOIT( %VAL( P ) )
1
Error: By-value argument at (1) is not allowed in this context
which is an error caused by the second identical call to DOIT(%VAL(P)).
--
Summary: %VAL construct fails with argument procedures
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: p dot w dot draper at durham dot ac dot uk
GCC host triplet: x86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30888
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/30888] %VAL construct fails with argument procedures
2007-02-20 17:40 [Bug fortran/30888] New: %VAL construct fails with argument procedures p dot w dot draper at durham dot ac dot uk
@ 2007-02-20 19:54 ` burnus at gcc dot gnu dot org
2007-02-23 16:19 ` burnus at gcc dot gnu dot org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-02-20 19:54 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from burnus at gcc dot gnu dot org 2007-02-20 19:54 -------
Confirmed.
It fails in resolve.c's resolve_actual_arglist
/* Intrinsics are still PROC_UNKNOWN here. However,
since same file external procedures are not resolvable
in gfortran, it is a good deal easier to leave them to
intrinsic.c. */
if (ptype != PROC_UNKNOWN && ptype != PROC_EXTERNAL)
{
gfc_error ("By-value argument at %L is not allowed "
"in this context", &e->where);
return FAILURE;
}
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |rejects-valid
Last reconfirmed|0000-00-00 00:00:00 |2007-02-20 19:54:34
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30888
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/30888] %VAL construct fails with argument procedures
2007-02-20 17:40 [Bug fortran/30888] New: %VAL construct fails with argument procedures p dot w dot draper at durham dot ac dot uk
2007-02-20 19:54 ` [Bug fortran/30888] " burnus at gcc dot gnu dot org
@ 2007-02-23 16:19 ` burnus at gcc dot gnu dot org
2007-02-28 18:18 ` burnus at gcc dot gnu dot org
2007-02-28 18:27 ` burnus at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-02-23 16:19 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from burnus at gcc dot gnu dot org 2007-02-23 16:18 -------
As the :ADDPATCH: mechanism didn't work:
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/2007-02/msg01839.html
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |burnus at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2007-02-20 19:54:34 |2007-02-23 16:18:51
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30888
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/30888] %VAL construct fails with argument procedures
2007-02-20 17:40 [Bug fortran/30888] New: %VAL construct fails with argument procedures p dot w dot draper at durham dot ac dot uk
2007-02-20 19:54 ` [Bug fortran/30888] " burnus at gcc dot gnu dot org
2007-02-23 16:19 ` burnus at gcc dot gnu dot org
@ 2007-02-28 18:18 ` burnus at gcc dot gnu dot org
2007-02-28 18:27 ` burnus at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-02-28 18:18 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from burnus at gcc dot gnu dot org 2007-02-28 18:17 -------
Subject: Bug 30888
Author: burnus
Date: Wed Feb 28 18:17:34 2007
New Revision: 122409
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122409
Log:
2007-02-28 Tobias Burnus <burnus@net-b.de>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/30888
PR fortran/30887
* resolve.c (resolve_actual_arglist): Allow by-value
arguments and non-default-kind for %VAL().
* trans-expr.c (conv_arglist_function): Allow
non-default-kind for %VAL().
testsuite/
2007-02-28 Tobias Burnus <burnus@net-b.de>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/30888
PR fortran/30887
* c_by_val_1.f: Test %VAL() with non-default kind.
* c_by_val.c: Ditto.
* c_by_val_4.f: New test.
Added:
trunk/gcc/testsuite/gfortran.dg/c_by_val_4.f
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/resolve.c
trunk/gcc/fortran/trans-expr.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/c_by_val.c
trunk/gcc/testsuite/gfortran.dg/c_by_val_1.f
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30888
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/30888] %VAL construct fails with argument procedures
2007-02-20 17:40 [Bug fortran/30888] New: %VAL construct fails with argument procedures p dot w dot draper at durham dot ac dot uk
` (2 preceding siblings ...)
2007-02-28 18:18 ` burnus at gcc dot gnu dot org
@ 2007-02-28 18:27 ` burnus at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-02-28 18:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from burnus at gcc dot gnu dot org 2007-02-28 18:26 -------
Fixed in GCC 4.3, not part of 4.2 => close PR.
Thanks for having reported this bug.
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30888
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-02-28 18:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-20 17:40 [Bug fortran/30888] New: %VAL construct fails with argument procedures p dot w dot draper at durham dot ac dot uk
2007-02-20 19:54 ` [Bug fortran/30888] " burnus at gcc dot gnu dot org
2007-02-23 16:19 ` burnus at gcc dot gnu dot org
2007-02-28 18:18 ` burnus at gcc dot gnu dot org
2007-02-28 18:27 ` burnus 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).