This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/25818] New: Problem with handling optional and entry master arguments
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jan 2006 14:35:10 -0000
- Subject: [Bug fortran/25818] New: Problem with handling optional and entry master arguments
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PROGRAM TSBVSL
CALL NRANIN(54321.)
END
SUBROUTINE NRAN(VECTOR,N)
DIMENSION VECTOR(N)
DO I=1,N
VECTOR(I) = RNDM(I)
END DO
RETURN
ENTRY NRANIN (V)
CALL RDMIN(V)
RETURN
END
SUBROUTINE RDMIN(V)
END
REAL FUNCTION RNDM(I)
RNDM=I
END
is miscompiled on x86_64-linux at -O and higher.
The problem is that gfc_trans_deferred_vars emits some code e.g. to compute
array argument's ubound and this happens before the entry master switch,
so the the N argument pointer might be NULL.
I think we should:
a) in gfc_sym_type try harder for
!sym->attr.optional && sym->ns->proc_name->attr.entry_master
to see whether build_reference_type (type) could be used
by walking all entries and see if the argument is present in all the entries
and not optional, then it can be reference_type
b) probably use some flag set for all code emitted before the entry master
switch
which would cause all parameters to expand to p != NULL ? *p : 0 rather than
just *p if p is POINTER_TYPE.
--
Summary: Problem with handling optional and entry master
arguments
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jakub at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25818