public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/96220] New: -fc-prototypes forgets types for doubles
@ 2020-07-16 14:35 tkoenig at gcc dot gnu.org
  2020-07-16 15:01 ` [Bug fortran/96220] " tkoenig at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2020-07-16 14:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96220

            Bug ID: 96220
           Summary: -fc-prototypes forgets types for doubles
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tkoenig at gcc dot gnu.org
  Target Milestone: ---

$ cat foo.f90 
module f_global_vars_m
use, intrinsic :: iso_c_binding, sp => c_float, dp => c_double
implicit none
real(dp), bind(c) :: one= 1.0_dp, four= 4.0_dp ! Error in gfortran v.10.1
end module f_global_vars_m
$ gfortran -fc-prototypes -c foo.f90 
#include <stddef.h>
#ifdef __cplusplus
#include <complex>
#define __GFORTRAN_FLOAT_COMPLEX std::complex<float>
#define __GFORTRAN_DOUBLE_COMPLEX std::complex<double>
#define __GFORTRAN_LONG_DOUBLE_COMPLEX std::complex<long double>
extern "C" {
#else
#define __GFORTRAN_FLOAT_COMPLEX float _Complex
#define __GFORTRAN_DOUBLE_COMPLEX double _Complex
#define __GFORTRAN_LONG_DOUBLE_COMPLEX long double _Complex
#endif

extern  four;
extern  one;

#ifdef __cplusplus
}
#endif

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

* [Bug fortran/96220] -fc-prototypes forgets types for doubles
  2020-07-16 14:35 [Bug fortran/96220] New: -fc-prototypes forgets types for doubles tkoenig at gcc dot gnu.org
@ 2020-07-16 15:01 ` tkoenig at gcc dot gnu.org
  2020-07-19 15:31 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2020-07-16 15:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96220

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-07-16
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |tkoenig at gcc dot gnu.org
     Ever confirmed|0                           |1

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

* [Bug fortran/96220] -fc-prototypes forgets types for doubles
  2020-07-16 14:35 [Bug fortran/96220] New: -fc-prototypes forgets types for doubles tkoenig at gcc dot gnu.org
  2020-07-16 15:01 ` [Bug fortran/96220] " tkoenig at gcc dot gnu.org
@ 2020-07-19 15:31 ` cvs-commit at gcc dot gnu.org
  2020-07-23 16:10 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-07-19 15:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96220

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Thomas Kथà¤nig <tkoenig@gcc.gnu.org>:

https://gcc.gnu.org/g:2e1b25350aa96b3f5678a056d0b55bb323c452d9

commit r11-2217-g2e1b25350aa96b3f5678a056d0b55bb323c452d9
Author: Thomas Koenig <tkoenig@gcc.gnu.org>
Date:   Sun Jul 19 17:27:45 2020 +0200

    Always use name from c_interop_kinds_table for -fc-prototypes.

    When a user specified a KIND that was a parameter taking the value
    of an iso_c_binding KIND, the code used the name of that parameter
    to look up the type name.  Corrected by always looking it up in
    the table of C interop kinds (which was previously done for
    non-C-interop types, anyway).

    gcc/fortran/ChangeLog:

            PR fortran/96220
            * dump-parse-tree.c (get_c_type_name): Always use the entries from
            c_interop_kinds_table to find the correct C type.

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

* [Bug fortran/96220] -fc-prototypes forgets types for doubles
  2020-07-16 14:35 [Bug fortran/96220] New: -fc-prototypes forgets types for doubles tkoenig at gcc dot gnu.org
  2020-07-16 15:01 ` [Bug fortran/96220] " tkoenig at gcc dot gnu.org
  2020-07-19 15:31 ` cvs-commit at gcc dot gnu.org
@ 2020-07-23 16:10 ` cvs-commit at gcc dot gnu.org
  2020-07-23 17:35 ` cvs-commit at gcc dot gnu.org
  2020-07-23 18:03 ` tkoenig at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-07-23 16:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96220

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Thomas Kथà¤nig
<tkoenig@gcc.gnu.org>:

https://gcc.gnu.org/g:5b9f6489081520b7cb10d3ddfae6f010e0986314

commit r10-8521-g5b9f6489081520b7cb10d3ddfae6f010e0986314
Author: Thomas Koenig <tkoenig@gcc.gnu.org>
Date:   Sun Jul 19 17:27:45 2020 +0200

    Always use name from c_interop_kinds_table for -fc-prototypes.

    When a user specified a KIND that was a parameter taking the value
    of an iso_c_binding KIND, the code used the name of that parameter
    to look up the type name.  Corrected by always looking it up in
    the table of C interop kinds (which was previously done for
    non-C-interop types, anyway).

    gcc/fortran/ChangeLog:

            PR fortran/96220
            * dump-parse-tree.c (get_c_type_name): Always use the entries from
            c_interop_kinds_table to find the correct C type.

    (cherry picked from commit 2e1b25350aa96b3f5678a056d0b55bb323c452d9)

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

* [Bug fortran/96220] -fc-prototypes forgets types for doubles
  2020-07-16 14:35 [Bug fortran/96220] New: -fc-prototypes forgets types for doubles tkoenig at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-07-23 16:10 ` cvs-commit at gcc dot gnu.org
@ 2020-07-23 17:35 ` cvs-commit at gcc dot gnu.org
  2020-07-23 18:03 ` tkoenig at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-07-23 17:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96220

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Thomas Kथà¤nig
<tkoenig@gcc.gnu.org>:

https://gcc.gnu.org/g:159c7ca3c3ce34e401b9e57734ecca8b37d8a0ec

commit r9-8760-g159c7ca3c3ce34e401b9e57734ecca8b37d8a0ec
Author: Thomas Koenig <tkoenig@gcc.gnu.org>
Date:   Sun Jul 19 17:27:45 2020 +0200

    Always use name from c_interop_kinds_table for -fc-prototypes.

    When a user specified a KIND that was a parameter taking the value
    of an iso_c_binding KIND, the code used the name of that parameter
    to look up the type name.  Corrected by always looking it up in
    the table of C interop kinds (which was previously done for
    non-C-interop types, anyway).

    gcc/fortran/ChangeLog:

            PR fortran/96220
            * dump-parse-tree.c (get_c_type_name): Always use the entries from
            c_interop_kinds_table to find the correct C type.

    (cherry picked from commit 2e1b25350aa96b3f5678a056d0b55bb323c452d9)

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

* [Bug fortran/96220] -fc-prototypes forgets types for doubles
  2020-07-16 14:35 [Bug fortran/96220] New: -fc-prototypes forgets types for doubles tkoenig at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-07-23 17:35 ` cvs-commit at gcc dot gnu.org
@ 2020-07-23 18:03 ` tkoenig at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2020-07-23 18:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96220

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

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

--- Comment #4 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
A backport to gcc 8 would require hand intervention, which I do not
think is worth it.

Hence, closing.

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

end of thread, other threads:[~2020-07-23 18:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-16 14:35 [Bug fortran/96220] New: -fc-prototypes forgets types for doubles tkoenig at gcc dot gnu.org
2020-07-16 15:01 ` [Bug fortran/96220] " tkoenig at gcc dot gnu.org
2020-07-19 15:31 ` cvs-commit at gcc dot gnu.org
2020-07-23 16:10 ` cvs-commit at gcc dot gnu.org
2020-07-23 17:35 ` cvs-commit at gcc dot gnu.org
2020-07-23 18:03 ` tkoenig at gcc dot gnu.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).