public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/25818]  New: Problem with handling optional and entry master arguments
@ 2006-01-17 14:35 jakub at gcc dot gnu dot org
  2006-01-17 16:04 ` [Bug fortran/25818] " pinskia at gcc dot gnu dot org
                   ` (23 more replies)
  0 siblings, 24 replies; 25+ messages in thread
From: jakub at gcc dot gnu dot org @ 2006-01-17 14:35 UTC (permalink / raw)
  To: gcc-bugs

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


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

end of thread, other threads:[~2007-01-10 19:06 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-17 14:35 [Bug fortran/25818] New: Problem with handling optional and entry master arguments jakub at gcc dot gnu dot org
2006-01-17 16:04 ` [Bug fortran/25818] " pinskia at gcc dot gnu dot org
2006-07-27 22:38 ` taschna at uni-muenster dot de
2006-07-30 22:47 ` kargl at gcc dot gnu dot org
2006-07-31  6:32 ` taschna at uni-muenster dot de
2006-07-31  7:49 ` taschna at uni-muenster dot de
2006-08-21 13:36 ` pault at gcc dot gnu dot org
2006-09-18 15:33 ` paul dot richard dot thomas at cea dot fr
2006-09-29  0:30 ` kargl at gcc dot gnu dot org
2006-10-12 12:31 ` pault at gcc dot gnu dot org
2006-10-12 12:46 ` jakub at gcc dot gnu dot org
2006-11-30 11:58 ` pinskia at gcc dot gnu dot org
2006-11-30 14:25 ` pault at gcc dot gnu dot org
2006-11-30 15:52 ` pault at gcc dot gnu dot org
2006-11-30 15:53 ` pault at gcc dot gnu dot org
2006-12-01 20:24 ` elizabeth dot l dot yip at boeing dot com
2006-12-02 17:56 ` paulthomas2 at wanadoo dot fr
2006-12-07  1:37 ` elizabeth dot l dot yip at boeing dot com
2006-12-07 17:34 ` paulthomas2 at wanadoo dot fr
2006-12-09 21:42 ` pault at gcc dot gnu dot org
2006-12-22  2:20 ` patchapp at dberlin dot org
2006-12-22 20:49 ` pault at gcc dot gnu dot org
2007-01-03 21:27 ` [Bug fortran/25818] [4.2 and 4.1 only] " pault at gcc dot gnu dot org
2007-01-03 21:30 ` [Bug fortran/25818] [4.1 " pault at gcc dot gnu dot org
2007-01-10 19:06 ` pinskia 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).