public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/56650] New: Odd error messages with C_SIZEOF
@ 2013-03-18  9:16 burnus at gcc dot gnu.org
  2013-03-18  9:23 ` [Bug fortran/56650] Odd error messages with C_SIZEOF for valid code burnus at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-03-18  9:16 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56650
           Summary: Odd error messages with C_SIZEOF
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


As PR 56649, this is another issue which causes compilation problems with MPICH
(for its MPI 3 implementation).


Compiling the program below gives:

  integer,parameter :: MPI_STATUS_SIZE = c_sizeof(MPI_Status_C_obj)
  1
Error: Unclassifiable statement at (1)



Or for the variant:

                    = c_sizeof(MPI_Status_C_obj)*8/bit_size(0)
                                                             1
Error: Invalid character in name at (1)



module m
  use iso_c_binding, only: c_sizeof, c_int
  implicit none

  integer(c_int), bind(C) :: MPI_Status_C_obj
  integer,parameter :: MPI_STATUS_SIZE = c_sizeof(MPI_Status_C_obj)
!  integer,parameter :: MPI_STATUS_SIZE2 &
!                    = c_sizeof(MPI_Status_C_obj)*8/bit_size(0)
end module m


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

* [Bug fortran/56650] Odd error messages with C_SIZEOF for valid code
  2013-03-18  9:16 [Bug fortran/56650] New: Odd error messages with C_SIZEOF burnus at gcc dot gnu.org
@ 2013-03-18  9:23 ` burnus at gcc dot gnu.org
  2013-03-26 11:23 ` burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-03-18  9:23 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
                 CC|                            |burnus at gcc dot gnu.org
            Summary|Odd error messages with     |Odd error messages with
                   |C_SIZEOF                    |C_SIZEOF for valid code

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2013-03-18 09:22:34 UTC ---
Note that the code is VALID. "c_sizeof" is a specification inquiry:

"A specification inquiry is a reference to [...] (4) the function C_SIZEOF from
the intrinsic module ISO C BINDING (15.2.3.7), or [...]"

(F2008, "7.1.11 Specification expression")


And those are allowed in constant expressions:

"(4) a specification inquiry where each designator or function argument is
     (a) a constant expression or
     (b) a variable whose properties inquired about are not
         (i) assumed,
         (ii) deferred, or
         (iii) defined by an expression that is not a constant expression,"

(F2008, "7.1.12 Constant expression")


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

* [Bug fortran/56650] Odd error messages with C_SIZEOF for valid code
  2013-03-18  9:16 [Bug fortran/56650] New: Odd error messages with C_SIZEOF burnus at gcc dot gnu.org
  2013-03-18  9:23 ` [Bug fortran/56650] Odd error messages with C_SIZEOF for valid code burnus at gcc dot gnu.org
@ 2013-03-26 11:23 ` burnus at gcc dot gnu.org
  2013-03-27 11:23 ` burnus at gcc dot gnu.org
  2013-03-27 11:24 ` burnus at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-03-26 11:23 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2013-03-26 11:22:54 UTC ---
Probably due to not simplifying c_sizeof(), cf. PR 36437. Related PR46641 and
PR45824


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

* [Bug fortran/56650] Odd error messages with C_SIZEOF for valid code
  2013-03-18  9:16 [Bug fortran/56650] New: Odd error messages with C_SIZEOF burnus at gcc dot gnu.org
  2013-03-18  9:23 ` [Bug fortran/56650] Odd error messages with C_SIZEOF for valid code burnus at gcc dot gnu.org
  2013-03-26 11:23 ` burnus at gcc dot gnu.org
@ 2013-03-27 11:23 ` burnus at gcc dot gnu.org
  2013-03-27 11:24 ` burnus at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-03-27 11:23 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2013-03-27 11:23:41 UTC ---
Author: burnus
Date: Wed Mar 27 10:45:58 2013
New Revision: 197159

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

        PR fortran/56650
        PR fortran/36437
        * check.c (gfc_check_sizeof, gfc_check_c_sizeof,
        gfc_check_storage_size): Update checks.
        * intrinsic.texi (SIZEOF): Correct class.
        * intrinsic.h (gfc_simplify_sizeof,
        gfc_simplify_storage_size): New prototypes.
        * intrinsic.c (add_functions): Use them.
        * simplify.c (gfc_simplify_sizeof,
        gfc_simplify_storage_size): New functions.

2013-03-27  Tobias Burnus  <burnus@net-b.de>

        PR fortran/56650
        PR fortran/36437
        * gfortran.dg/sizeof_2.f90: New.
        * gfortran.dg/sizeof_3.f90: New.
        * gfortran.dg/sizeof_proc.f90: Update dg-error.


Added:
    trunk/gcc/testsuite/gfortran.dg/sizeof_2.f90
    trunk/gcc/testsuite/gfortran.dg/sizeof_3.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/check.c
    trunk/gcc/fortran/intrinsic.c
    trunk/gcc/fortran/intrinsic.h
    trunk/gcc/fortran/intrinsic.texi
    trunk/gcc/fortran/simplify.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/sizeof_proc.f90


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

* [Bug fortran/56650] Odd error messages with C_SIZEOF for valid code
  2013-03-18  9:16 [Bug fortran/56650] New: Odd error messages with C_SIZEOF burnus at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2013-03-27 11:23 ` burnus at gcc dot gnu.org
@ 2013-03-27 11:24 ` burnus at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-03-27 11:24 UTC (permalink / raw)
  To: gcc-bugs


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

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

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

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2013-03-27 11:23:55 UTC ---
FIXED on the 4.9 trunk.


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

end of thread, other threads:[~2013-03-27 11:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-18  9:16 [Bug fortran/56650] New: Odd error messages with C_SIZEOF burnus at gcc dot gnu.org
2013-03-18  9:23 ` [Bug fortran/56650] Odd error messages with C_SIZEOF for valid code burnus at gcc dot gnu.org
2013-03-26 11:23 ` burnus at gcc dot gnu.org
2013-03-27 11:23 ` burnus at gcc dot gnu.org
2013-03-27 11:24 ` burnus 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).