public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/60057] New: bind(C): multi-dimensional arrays have incompatible types
@ 2014-02-04 11:04 rguenth at gcc dot gnu.org
  2014-02-04 11:39 ` [Bug fortran/60057] " dominiq at lps dot ens.fr
  0 siblings, 1 reply; 2+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-02-04 11:04 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60057
           Summary: bind(C): multi-dimensional arrays have incompatible
                    types
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: diagnostic, lto
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org

As can be seen with

make check-gfortran RUNTESTFLAGS="--target_board=unix/-flto
dg.exp=bind_c_vars.f90"

FAIL: gfortran.dg/bind_c_vars.f90  -O0  (test for excess errors)
...

which is because LTO warns that

/space/rguenther/src/svn/trunk/gcc/testsuite/gfortran.dg/bind_c_vars_driver.c:12:5:
warning: type of 'myF90Array2D' does not match original declaration [enabled by
default]
/space/rguenther/src/svn/trunk/gcc/testsuite/gfortran.dg/bind_c_vars.f90:16:0:
note: previously declared here
/space/rguenther/src/svn/trunk/gcc/testsuite/gfortran.dg/bind_c_vars_driver.c:11:5:
warning: type of 'myF90Array3D' does not match original declaration [enabled by
default]
/space/rguenther/src/svn/trunk/gcc/testsuite/gfortran.dg/bind_c_vars.f90:15:0:
note: previously declared here

which effectively means that assignments in GIMPLE between those arrays
would be invalid (not array members but whole arrays).  Not sure if we
can create a testcase that will eventually ICE though.  Usually the above
also means that the arrays use different alias sets but that's safe here
because the alias set of an array is that of its element (and those are
compatible here).

The issue is that in C a[2][3] is ARRAY_TYPE <ARRAY_TYPE <...> > but
GFortran represents a(2)(3) as 1D ARRAY_TYPE <...> and thus both types
are not structurally equivalent (which is why LTO warns).

Not sure if this case is motivation enough to treat arrays structurally
the same if their overall size is the same.


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

* [Bug fortran/60057] bind(C): multi-dimensional arrays have incompatible types
  2014-02-04 11:04 [Bug fortran/60057] New: bind(C): multi-dimensional arrays have incompatible types rguenth at gcc dot gnu.org
@ 2014-02-04 11:39 ` dominiq at lps dot ens.fr
  0 siblings, 0 replies; 2+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-02-04 11:39 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

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

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Duplicate of pr54852.

*** This bug has been marked as a duplicate of bug 54852 ***


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

end of thread, other threads:[~2014-02-04 11:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-04 11:04 [Bug fortran/60057] New: bind(C): multi-dimensional arrays have incompatible types rguenth at gcc dot gnu.org
2014-02-04 11:39 ` [Bug fortran/60057] " dominiq at lps dot ens.fr

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).