public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/45125]  New: ICE with -fwhole-file
@ 2010-07-29  9:46 burnus at gcc dot gnu dot org
  2010-07-29 10:26 ` [Bug fortran/45125] " mikael at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-07-29  9:46 UTC (permalink / raw)
  To: gcc-bugs

As reported by Dominique, the patch for PR 45087,
http://gcc.gnu.org/ml/fortran/2010-07/msg00430.html, causes an ICE for
attachment 20927 (= PR 43945 comment 19 and PR 44936 comment 1).

 pr44936_1.f90: In function 'd_coo_err':
 pr44936_1.f90:198:0: internal compiler error: in gfc_get_symbol_decl, at
fortran/trans-decl.c:1048


-- 
           Summary: ICE with -fwhole-file
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


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

* [Bug fortran/45125] ICE with -fwhole-file
  2010-07-29  9:46 [Bug fortran/45125] New: ICE with -fwhole-file burnus at gcc dot gnu dot org
@ 2010-07-29 10:26 ` mikael at gcc dot gnu dot org
  2010-07-29 12:19 ` dominiq at lps dot ens dot fr
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mikael at gcc dot gnu dot org @ 2010-07-29 10:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from mikael at gcc dot gnu dot org  2010-07-29 10:25 -------
Confirmed. 

Workaround:

trans-decl.c b/trans-decl.c
index d5be2e4..14e78a4 100644
--- a/trans-decl.c
+++ b/trans-decl.c
@@ -1457,7 +1457,10 @@ gfc_get_extern_function_decl (gfc_symbol * sym)
          /* Avoid problems of double deallocation of the backend declaration
             later in gfc_trans_use_stmts; cf. PR 45087.  */
          if (sym->attr.if_source != IFSRC_DECL && sym->attr.use_assoc)
-           sym->attr.use_assoc = 0;
+           {
+             sym->attr.use_assoc = 0;
+             sym->attr.referenced = 1;
+           }

          return sym->backend_decl;
        }


PS: no need to open a PR as long as the patch is not committed ;-)


-- 

mikael at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-07-29 10:25:54
               date|                            |


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


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

* [Bug fortran/45125] ICE with -fwhole-file
  2010-07-29  9:46 [Bug fortran/45125] New: ICE with -fwhole-file burnus at gcc dot gnu dot org
  2010-07-29 10:26 ` [Bug fortran/45125] " mikael at gcc dot gnu dot org
@ 2010-07-29 12:19 ` dominiq at lps dot ens dot fr
  2010-07-29 14:40 ` burnus at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dominiq at lps dot ens dot fr @ 2010-07-29 12:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from dominiq at lps dot ens dot fr  2010-07-29 12:19 -------
The patch in comment #1 fixes the ICE, but AFAICT (due to other patches in my
tree) make an error message to disappear in pr44348, pr44614, and pr44616:


[macbook] f90/bug% cat pr44614.f90
module factory_pattern
implicit none

type, abstract :: Connection
    contains
    procedure(generic_desc), deferred :: description
end type Connection

abstract interface
    subroutine generic_desc(self)
!        import
        class(Connection) :: self
    end subroutine generic_desc
end interface
end module factory_pattern
end
[macbook] f90/bug% gfc pr44614.f90
pr44614.f90:12.33:

        class(Connection) :: self
                                 1
Error: the type of 'self' at (1) has not been declared within the interface
[macbook] f90/bug% gfcp pr44614.f90
pr44614.f90:12.33:

        class(Connection) :: self
                                 1
Error: the type of 'self' at (1) has not been declared within the interface
pr44614.f90:6.27:

    procedure(generic_desc), deferred :: description
                           1
Error: Non-polymorphic passed-object dummy argument of 'generic_desc' at (1)

gfc patched r162674, gfcp r162490.


-- 


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


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

* [Bug fortran/45125] ICE with -fwhole-file
  2010-07-29  9:46 [Bug fortran/45125] New: ICE with -fwhole-file burnus at gcc dot gnu dot org
  2010-07-29 10:26 ` [Bug fortran/45125] " mikael at gcc dot gnu dot org
  2010-07-29 12:19 ` dominiq at lps dot ens dot fr
@ 2010-07-29 14:40 ` burnus at gcc dot gnu dot org
  2010-07-29 14:42 ` [Bug fortran/45125] ICE with -fwhole-file for subref_array_pointer burnus at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-07-29 14:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from burnus at gcc dot gnu dot org  2010-07-29 14:40 -------
The segfault occurs for:

l.4768             gfc_add_modify (&lse.post, GFC_DECL_SPAN(decl), tmp);

It seems as if GFC_DECL_SPAN(decl) access a NULL pointer. That's
  decl->decl_common.lang_specific->span
where lang_specific == NULL.

While the dump has:

tf_ad_splitting_driver_plane ()
{
  extern integer(kind=8) span.0 = 0;
  [...]
    span.0 = 4;

the "span" variable does not really exist globally but is only created when
needed, cf.
http://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/fortran/trans-decl.c;hb=HEAD#l1243

gfc_get_symbol_decl:

1243   else if (sym->attr.subref_array_pointer)
1245       /* We need the span for these beasts.  */
1246       gfc_allocate_lang_decl (decl);

1249   if (sym->attr.subref_array_pointer)
1261       GFC_DECL_SPAN (decl) = span;

If one now recycles the definition for the array descriptor "desc" this
information is not present. I think the real solution is the new array
descriptor. I do not know how to fix this otherwise - except by always
generating a span variable.

Paul - any progress from the array-descriptor front?


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pault at gcc dot gnu dot org


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


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

* [Bug fortran/45125] ICE with -fwhole-file for subref_array_pointer
  2010-07-29  9:46 [Bug fortran/45125] New: ICE with -fwhole-file burnus at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2010-07-29 14:40 ` burnus at gcc dot gnu dot org
@ 2010-07-29 14:42 ` burnus at gcc dot gnu dot org
  2010-07-29 21:08 ` [Bug fortran/45125] ICE with -fwhole-file burnus at gcc dot gnu dot org
  2010-07-29 21:09 ` burnus at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-07-29 14:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from burnus at gcc dot gnu dot org  2010-07-29 14:42 -------
Sorry that comment 3 and the change was supposed to go to PR 45128.

I think the PR here is relatively easily fixable.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|pault at gcc dot gnu dot org|


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


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

* [Bug fortran/45125] ICE with -fwhole-file
  2010-07-29  9:46 [Bug fortran/45125] New: ICE with -fwhole-file burnus at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2010-07-29 14:42 ` [Bug fortran/45125] ICE with -fwhole-file for subref_array_pointer burnus at gcc dot gnu dot org
@ 2010-07-29 21:08 ` burnus at gcc dot gnu dot org
  2010-07-29 21:09 ` burnus at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-07-29 21:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from burnus at gcc dot gnu dot org  2010-07-29 21:07 -------
Subject: Bug 45125

Author: burnus
Date: Thu Jul 29 21:07:34 2010
New Revision: 162696

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162696
Log:
2010-07-29  Tobias Burnus  <burnus@net-b.de>

        PR fortran/45087
        PR fortran/45125
        * trans-decl.c (gfc_get_extern_function_decl): Correctly handle
        external procedure declarations in modules.
        (gfc_get_symbol_decl): Modify assert.

2010-07-29  Tobias Burnus  <burnus@net-b.de>

        PR fortran/45087
        PR fortran/45125
        * gfortran.dg/whole_file_25.f90: New.
        * gfortran.dg/whole_file_26.f90: New.
        * gfortran.dg/whole_file_27.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/whole_file_25.f90
    trunk/gcc/testsuite/gfortran.dg/whole_file_26.f90
    trunk/gcc/testsuite/gfortran.dg/whole_file_27.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-decl.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/45125] ICE with -fwhole-file
  2010-07-29  9:46 [Bug fortran/45125] New: ICE with -fwhole-file burnus at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2010-07-29 21:08 ` [Bug fortran/45125] ICE with -fwhole-file burnus at gcc dot gnu dot org
@ 2010-07-29 21:09 ` burnus at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-07-29 21:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from burnus at gcc dot gnu dot org  2010-07-29 21:08 -------
FIXED on the trunk (4.6).


-- 

burnus at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2010-07-29 21:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-29  9:46 [Bug fortran/45125] New: ICE with -fwhole-file burnus at gcc dot gnu dot org
2010-07-29 10:26 ` [Bug fortran/45125] " mikael at gcc dot gnu dot org
2010-07-29 12:19 ` dominiq at lps dot ens dot fr
2010-07-29 14:40 ` burnus at gcc dot gnu dot org
2010-07-29 14:42 ` [Bug fortran/45125] ICE with -fwhole-file for subref_array_pointer burnus at gcc dot gnu dot org
2010-07-29 21:08 ` [Bug fortran/45125] ICE with -fwhole-file burnus at gcc dot gnu dot org
2010-07-29 21:09 ` burnus 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).