public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/43091]  New: ICE with gfortran when compiling the following source file
@ 2010-02-16 10:15 francois dot jacq at irsn dot fr
  2010-02-16 11:15 ` [Bug fortran/43091] " burnus at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: francois dot jacq at irsn dot fr @ 2010-02-16 10:15 UTC (permalink / raw)
  To: gcc-bugs

MODULE test
  USE iso_c_binding
  TYPE, BIND(c) :: odig
    INTEGER(c_int) :: value
  END TYPE
  TYPE, BIND(c) :: odig_type
    INTEGER(c_int64_t) :: name
    INTEGER(c_int)     :: value
  END TYPE
  INTEGER(c_int),PARAMETER :: od_ig=11
  INTERFACE
    SUBROUTINE odessa_segment_all(iseg,ityp,itype,isize,n,n1,p)
BIND(C,NAME="odessa_segment_all")
      USE iso_c_binding
      INTEGER(c_int),INTENT(in),VALUE :: iseg,ityp
      INTEGER(c_int),INTENT(out) :: itype,isize,n,n1
      TYPE(C_PTR)   ,INTENT(out) :: p
    END SUBROUTINE
  END INTERFACE
  CONTAINS
  SUBROUTINE odgetptrigval(vector,value)
    TYPE(odig)            ,INTENT(in)  :: vector
    INTEGER(c_int),POINTER,INTENT(out) :: value(:)
    TYPE(odig_type),POINTER :: d(:)
    TYPE(C_PTR) :: p
    INTEGER :: itype,n,n1,isize
    CALL odessa_segment_all(vector%value,od_ig,itype,isize,n,n1,p)
    CALL C_F_POINTER(p,d,(/n/))
    value => d(:)%value
  END SUBROUTINE
END MODULE

$ gfortran -c test.f90
test.f90: In function 'odgetptrigval':
test.f90:27:0: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ gfortran --version
GNU Fortran (GCC) 4.5.0 20100214 (experimental) [trunk revision 156762]
Copyright (C) 2010 Free Software Foundation, Inc.


-- 
           Summary: ICE with gfortran when compiling the following source
                    file
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: francois dot jacq at irsn dot fr
  GCC host triplet: linux i686


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


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

* [Bug fortran/43091] ICE with gfortran when compiling the following source file
  2010-02-16 10:15 [Bug fortran/43091] New: ICE with gfortran when compiling the following source file francois dot jacq at irsn dot fr
@ 2010-02-16 11:15 ` burnus at gcc dot gnu dot org
  2010-02-16 14:07 ` francois dot jacq at irsn dot fr
  2010-04-27 19:48 ` dfranke at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-02-16 11:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2010-02-16 11:14 -------
Confirm. (Compiles with NAG, ifort, g95; fails with gfortran 4.3/4.4/4.5.)

Though, I think this is a duplicate of PR 42851, based on the location.

Valgrind shows:

 Invalid read of size 8
    at 0x55FAF5: gfc_trans_pointer_assignment (trans-expr.c:4775)
    by 0x540975: trans_code (trans.c:1099)
    by 0x55A16E: gfc_generate_function_code (trans-decl.c:4373)

The issue occurs for:
          if (expr1->symtree->n.sym->attr.subref_array_pointer)
[...]
              gfc_add_modify (&lse.post, GFC_DECL_SPAN(decl), tmp);


Note: The BIND(...) line needs to moved back to the SUBROUTINE line - otherwise
the code is invalid.

Note 2: If one does not move the line back, one gets also an ICE - first there
are a bunch of ERROR messages, followed by
  f951: internal compiler error: Segmentation fault
The output (compiler under valgrind) is:

test.f90:27.66:

    CALL odessa_segment_all(vector%value,od_ig,itype,isize,n,n1,p)
                                                                  1
==18265== Invalid read of size 8
==18265==    at 0x4C8CB6: show_locus (error.c:271)
==18265==    by 0x4C8B8E: error_print (error.c:626)
==18265==    by 0x4C94C6: gfc_error (error.c:881)
==18265==    by 0x511767: resolve_global_procedure (resolve.c:1790)


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |42851
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   GCC host triplet|linux i686                  |
           Keywords|                            |error-recovery, ice-on-
                   |                            |invalid-code, ice-on-valid-
                   |                            |code
      Known to fail|                            |4.4.2 4.5.0 4.3.4
   Last reconfirmed|0000-00-00 00:00:00         |2010-02-16 11:14:49
               date|                            |


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


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

* [Bug fortran/43091] ICE with gfortran when compiling the following source file
  2010-02-16 10:15 [Bug fortran/43091] New: ICE with gfortran when compiling the following source file francois dot jacq at irsn dot fr
  2010-02-16 11:15 ` [Bug fortran/43091] " burnus at gcc dot gnu dot org
@ 2010-02-16 14:07 ` francois dot jacq at irsn dot fr
  2010-04-27 19:48 ` dfranke at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: francois dot jacq at irsn dot fr @ 2010-02-16 14:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from francois dot jacq at irsn dot fr  2010-02-16 14:07 -------
Sorry,

this is a duplication of 34640 I found 2 years ago ... It has nothing to do
with BIND(C) but only with "value => d(:)%..." when value is a dummy !

I thought that this bug was already corrected and I did not check that it was
not ...

Sorry again


-- 


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


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

* [Bug fortran/43091] ICE with gfortran when compiling the following source file
  2010-02-16 10:15 [Bug fortran/43091] New: ICE with gfortran when compiling the following source file francois dot jacq at irsn dot fr
  2010-02-16 11:15 ` [Bug fortran/43091] " burnus at gcc dot gnu dot org
  2010-02-16 14:07 ` francois dot jacq at irsn dot fr
@ 2010-04-27 19:48 ` dfranke at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-04-27 19:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dfranke at gcc dot gnu dot org  2010-04-27 19:48 -------


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


-- 

dfranke at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2010-04-27 19:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-16 10:15 [Bug fortran/43091] New: ICE with gfortran when compiling the following source file francois dot jacq at irsn dot fr
2010-02-16 11:15 ` [Bug fortran/43091] " burnus at gcc dot gnu dot org
2010-02-16 14:07 ` francois dot jacq at irsn dot fr
2010-04-27 19:48 ` dfranke 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).