public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/45304] Functions/subroutines without arguments always treated like varargs
       [not found] <bug-45304-4@http.gcc.gnu.org/bugzilla/>
@ 2011-03-19 23:38 ` burnus at gcc dot gnu.org
  2011-03-25 18:05 ` burnus at gcc dot gnu.org
  2011-03-25 18:19 ` burnus at gcc dot gnu.org
  2 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-03-19 23:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-03-19 23:31:33 UTC ---
Related (duplicate): PR 48174 (see patch there).


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

* [Bug fortran/45304] Functions/subroutines without arguments always treated like varargs
       [not found] <bug-45304-4@http.gcc.gnu.org/bugzilla/>
  2011-03-19 23:38 ` [Bug fortran/45304] Functions/subroutines without arguments always treated like varargs burnus at gcc dot gnu.org
@ 2011-03-25 18:05 ` burnus at gcc dot gnu.org
  2011-03-25 18:19 ` burnus at gcc dot gnu.org
  2 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-03-25 18:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-03-25 17:53:41 UTC ---
Author: burnus
Date: Fri Mar 25 17:53:35 2011
New Revision: 171519

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171519
Log:
2011-03-25  Tobias Burnus  <burnus@net-b.de>

        PR fortran/48174
        PR fortran/45304
        * trans-types.c (gfc_get_function_type): Don't use varargs if
        * the
        procedure is known to have no arguments.

2011-03-25  Tobias Burnus  <burnus@net-b.de>

        PR fortran/48174
        PR fortran/45304
        * gfortran.dg/ishft_4.f90: Adapt scan-tree-dump-times.
        * gfortran.dg/leadz_trailz_3.f90: Ditto


Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-types.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/ishft_4.f90
    trunk/gcc/testsuite/gfortran.dg/leadz_trailz_3.f90


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

* [Bug fortran/45304] Functions/subroutines without arguments always treated like varargs
       [not found] <bug-45304-4@http.gcc.gnu.org/bugzilla/>
  2011-03-19 23:38 ` [Bug fortran/45304] Functions/subroutines without arguments always treated like varargs burnus at gcc dot gnu.org
  2011-03-25 18:05 ` burnus at gcc dot gnu.org
@ 2011-03-25 18:19 ` burnus at gcc dot gnu.org
  2 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-03-25 18:19 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED

--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-03-25 18:14:58 UTC ---
Should be FIXED.


(Remains to be done: For call to external (other translation unit) procedures
without explicit interface, the interface for the decl should be deduced by the
usage. See e.g. PR 40976, PR 33097, PR 44471.)


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

* [Bug fortran/45304] Functions/subroutines without arguments always treated like varargs
  2010-08-17  8:58 [Bug fortran/45304] New: " jakub at gcc dot gnu dot org
  2010-08-17  8:59 ` [Bug fortran/45304] " jakub at gcc dot gnu dot org
  2010-08-17  9:35 ` burnus at gcc dot gnu dot org
@ 2010-08-17 18:06 ` jakub at gcc dot gnu dot org
  2 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-08-17 18:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2010-08-17 18:06 -------
Subject: Bug 45304

Author: jakub
Date: Tue Aug 17 18:06:18 2010
New Revision: 163311

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=163311
Log:
        PR fortran/45304
        * trans-decl.c (build_library_function_decl_1): Chain on
        void_list_node instead of creating a new TREE_LIST.
        * trans-intrinsic.c (gfc_get_intrinsic_lib_fndecl): Likewise.
        * trans-types.c (gfc_get_function_type): Likewise.  Set
        typelist to void_list_node for the main program.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-decl.c
    trunk/gcc/fortran/trans-intrinsic.c
    trunk/gcc/fortran/trans-types.c


-- 


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


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

* [Bug fortran/45304] Functions/subroutines without arguments always treated like varargs
  2010-08-17  8:58 [Bug fortran/45304] New: " jakub at gcc dot gnu dot org
  2010-08-17  8:59 ` [Bug fortran/45304] " jakub at gcc dot gnu dot org
@ 2010-08-17  9:35 ` burnus at gcc dot gnu dot org
  2010-08-17 18:06 ` jakub at gcc dot gnu dot org
  2 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-08-17  9:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from burnus at gcc dot gnu dot org  2010-08-17 09:34 -------
(In reply to comment #0)
> shouldn't:
>  call bar (i)
>  call bar (f)
> warn not just about the argument mismatch to foo, but also about bar?

Yes. One should construct the function interface from the argument usage - and
then warn if does not match. Cf. PR 44471.

> Is there any way to differentiate between the two cases (when we know the
> subroutine/function has no arguments and is defined in the current TU, or
> when it is unknown)?

Well, if the interface is known, one can check attr.ifsrc != IFSRC_UNKNOWN -
but I think that's not what you are looking for.

For the TU, one can try to find the global symbol via
  if (gfc_option.flag_whole_file)
    {
      gfc_gsymbol *gsym;
      gsym =  gfc_find_gsymbol (gfc_gsym_root, sym->name);
      if (gsym) { .... }
Though one needs to be careful if the symbol is an ENTRY and not a real
subroutine, cf. gfc_get_extern_function_decl


-- 


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


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

* [Bug fortran/45304] Functions/subroutines without arguments always treated like varargs
  2010-08-17  8:58 [Bug fortran/45304] New: " jakub at gcc dot gnu dot org
@ 2010-08-17  8:59 ` jakub at gcc dot gnu dot org
  2010-08-17  9:35 ` burnus at gcc dot gnu dot org
  2010-08-17 18:06 ` jakub at gcc dot gnu dot org
  2 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-08-17  8:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jakub at gcc dot gnu dot org  2010-08-17 08:59 -------
Created an attachment (id=21500)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21500&action=view)
gcc46-pr45304-partial.patch

The partial patch.


-- 


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


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

end of thread, other threads:[~2011-03-25 18:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-45304-4@http.gcc.gnu.org/bugzilla/>
2011-03-19 23:38 ` [Bug fortran/45304] Functions/subroutines without arguments always treated like varargs burnus at gcc dot gnu.org
2011-03-25 18:05 ` burnus at gcc dot gnu.org
2011-03-25 18:19 ` burnus at gcc dot gnu.org
2010-08-17  8:58 [Bug fortran/45304] New: " jakub at gcc dot gnu dot org
2010-08-17  8:59 ` [Bug fortran/45304] " jakub at gcc dot gnu dot org
2010-08-17  9:35 ` burnus at gcc dot gnu dot org
2010-08-17 18:06 ` jakub 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).