public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/38152]  New: ICE for procedure pointer assignment
@ 2008-11-16  9:28 domob at gcc dot gnu dot org
  2008-11-16  9:28 ` [Bug fortran/38152] " domob at gcc dot gnu dot org
                   ` (21 more replies)
  0 siblings, 22 replies; 23+ messages in thread
From: domob at gcc dot gnu dot org @ 2008-11-16  9:28 UTC (permalink / raw)
  To: gcc-bugs

The following (possibly invalid) program ICEs:

MODULE m
  IMPLICIT NONE

  PROCEDURE(test), POINTER :: procptr

CONTAINS

  SUBROUTINE test ()
    IMPLICIT NONE

    CALL bar (test)
    procptr => test
  END SUBROUTINE test

END MODULE m

The ICE is however not related to the missing RECURSIVE and can be reproduced
with valid code, see below.


-- 
           Summary: ICE for procedure pointer assignment
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: domob at gcc dot gnu dot org


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


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

* [Bug fortran/38152] ICE for procedure pointer assignment
  2008-11-16  9:28 [Bug fortran/38152] New: ICE for procedure pointer assignment domob at gcc dot gnu dot org
@ 2008-11-16  9:28 ` domob at gcc dot gnu dot org
  2008-11-16 19:01 ` janus at gcc dot gnu dot org
                   ` (20 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: domob at gcc dot gnu dot org @ 2008-11-16  9:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from domob at gcc dot gnu dot org  2008-11-16 09:27 -------
Daniel Kraft wrote:
> > I'm working out a test-case for PR 37779 and came across the following
> > program, which ICEs for today's trunk gfortran:
> >
> >   SUBROUTINE test ()
> >     IMPLICIT NONE
> >     procptr => test
If one moves the procedure-pointer declaration in the subroutine, it
works. The difference of the -fdump-tree-original/gimple is:

+   void (*<T62>) (void) procptr;

The failing assert in make_decl_rtl is:

  /* A weak alias has TREE_PUBLIC set but not the other bits.  */
  gcc_assert (TREE_CODE (decl) != VAR_DECL
              || TREE_STATIC (decl)
              || TREE_PUBLIC (decl)
              || DECL_EXTERNAL (decl)
              || DECL_REGISTER (decl));


> > Is this already a known bug?  Sorry that I don't have an overview... 
> > If not, I'll file a report.
Please do so, I think it is not known.


By the way, the following also fails:

module m
procedure(), pointer :: procptr
end module m

use m
external foo
procptr => foo
end

with Error: 'procptr' in the pointer assignment at (1) cannot be an
l-value since it is a procedure

I think the "proc_ptr" attribute is not properly saved in the .mod file.


Tobias


-- 


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


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

* [Bug fortran/38152] ICE for procedure pointer assignment
  2008-11-16  9:28 [Bug fortran/38152] New: ICE for procedure pointer assignment domob at gcc dot gnu dot org
  2008-11-16  9:28 ` [Bug fortran/38152] " domob at gcc dot gnu dot org
@ 2008-11-16 19:01 ` janus at gcc dot gnu dot org
  2008-11-17  0:02 ` burnus at gcc dot gnu dot org
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: janus at gcc dot gnu dot org @ 2008-11-16 19:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from janus at gcc dot gnu dot org  2008-11-16 18:59 -------
(In reply to comment #1)
> By the way, the following also fails:
> 
> module m
> procedure(), pointer :: procptr
> end module m
> 
> use m
> external foo
> procptr => foo
> end
> 
> with Error: 'procptr' in the pointer assignment at (1) cannot be an
> l-value since it is a procedure
> 
> I think the "proc_ptr" attribute is not properly saved in the .mod file.

Actually this is not the problem. All attributes are saved properly.
The error is fixed by the following trivial patch:

Index: gcc/fortran/expr.c
===================================================================
--- gcc/fortran/expr.c  (revision 141915)
+++ gcc/fortran/expr.c  (working copy)
@@ -3034,7 +3034,8 @@ gfc_check_pointer_assign (gfc_expr *lval
     }

   if (lvalue->symtree->n.sym->attr.flavor == FL_PROCEDURE
-      && lvalue->symtree->n.sym->attr.use_assoc)
+      && lvalue->symtree->n.sym->attr.use_assoc
+      && !lvalue->symtree->n.sym->attr.proc_pointer)
     {
       gfc_error ("'%s' in the pointer assignment at %L cannot be an "
                 "l-value since it is a procedure",


-- 

janus 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         |2008-11-16 18:59:41
               date|                            |


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


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

* [Bug fortran/38152] ICE for procedure pointer assignment
  2008-11-16  9:28 [Bug fortran/38152] New: ICE for procedure pointer assignment domob at gcc dot gnu dot org
  2008-11-16  9:28 ` [Bug fortran/38152] " domob at gcc dot gnu dot org
  2008-11-16 19:01 ` janus at gcc dot gnu dot org
@ 2008-11-17  0:02 ` burnus at gcc dot gnu dot org
  2008-11-18 19:55 ` dominiq at lps dot ens dot fr
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-11-17  0:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from burnus at gcc dot gnu dot org  2008-11-17 00:01 -------
(In reply to comment #2)
> > By the way, the following also fails:
> The error is fixed by the following trivial patch:

Janus, do you plan to submit it?

  * * *

Regarding the ICE, the following patch seems to work; one probably still needs
to take care of mangling of the name etc. Also there needs to be a check for
use-/host- association (cf. a few lines down and in gfc_finish_var_decl),
adding those flags unconditionally is surely wrong.

--- trans-decl.c        (revision 141928)
+++ trans-decl.c        (working copy)
@@ -1021,2 +1021,7 @@ gfc_get_symbol_decl (gfc_symbol * sym)
       decl = gfc_get_extern_function_decl (sym);
+      if (sym->attr.proc_pointer)
+       {
+         TREE_PUBLIC (decl) = 1;
+         TREE_STATIC (decl) = 1;
+        }
       return decl;


-- 

burnus at gcc dot gnu dot org changed:

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


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


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

* [Bug fortran/38152] ICE for procedure pointer assignment
  2008-11-16  9:28 [Bug fortran/38152] New: ICE for procedure pointer assignment domob at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-11-17  0:02 ` burnus at gcc dot gnu dot org
@ 2008-11-18 19:55 ` dominiq at lps dot ens dot fr
  2008-11-19 16:31 ` dominiq at lps dot ens dot fr
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dominiq at lps dot ens dot fr @ 2008-11-18 19:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from dominiq at lps dot ens dot fr  2008-11-18 19:54 -------
With the patches in comment #2 and #3, compiling the test in comment #0 on
i686-apple-darwin9 in 32 bit mode gives:

/var/tmp//ccMx60VC.s:13:non-relocatable subtraction expression, "_procptr"
minus "L00000000001$pb"
/var/tmp//ccMx60VC.s:13:symbol: "_procptr" can't be undefined in a subtraction
expression

Note that g95 compiles the test while ifort 11 returns:

pr38152.f90(4): error #8169: The specified interface is not declared.   [TEST]
  PROCEDURE(test), POINTER :: procptr
------------^
pr38152.f90(11): error #6437: A subroutine or function is calling itself
recursively.   [TEST]
    CALL bar (test)
--------------^
pr38152.f90(12): error #8191: The procedure target must be a procedure or a
procedure pointer.   [TEST]
    procptr => test
---------------^
compilation aborted for pr38152.f90 (code 1)


-- 


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


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

* [Bug fortran/38152] ICE for procedure pointer assignment
  2008-11-16  9:28 [Bug fortran/38152] New: ICE for procedure pointer assignment domob at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-11-18 19:55 ` dominiq at lps dot ens dot fr
@ 2008-11-19 16:31 ` dominiq at lps dot ens dot fr
  2008-11-22 21:43 ` burnus at gcc dot gnu dot org
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dominiq at lps dot ens dot fr @ 2008-11-19 16:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from dominiq at lps dot ens dot fr  2008-11-19 16:29 -------
On powerpc-apple-darwin9 I have the same kind of error as reported in comment
#4:

/var/folders/FK/FKCVPmNbH5SNynFQmqGomk+++TI/-Tmp-//cctJDhJw.s:21:non-relocatable
subtraction expression, "_procptr" minus "L00000000001$pb"
/var/folders/FK/FKCVPmNbH5SNynFQmqGomk+++TI/-Tmp-//cctJDhJw.s:21:symbol:
"_procptr" can't be undefined in a subtraction expression
/var/folders/FK/FKCVPmNbH5SNynFQmqGomk+++TI/-Tmp-//cctJDhJw.s:19:non-relocatable
subtraction expression, "_procptr" minus "L00000000001$pb"
/var/folders/FK/FKCVPmNbH5SNynFQmqGomk+++TI/-Tmp-//cctJDhJw.s:19:symbol:
"_procptr" can't be undefined in a subtraction expression

in this case for 32 and 64 bit modes. The errors disappear if I compile with
-fno-PIC (ppc/intel).


-- 


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


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

* [Bug fortran/38152] ICE for procedure pointer assignment
  2008-11-16  9:28 [Bug fortran/38152] New: ICE for procedure pointer assignment domob at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-11-19 16:31 ` dominiq at lps dot ens dot fr
@ 2008-11-22 21:43 ` burnus at gcc dot gnu dot org
  2009-01-13 19:47 ` domob at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-11-22 21:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from burnus at gcc dot gnu dot org  2008-11-22 21:42 -------
See also test cases at:
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/e0d04d755453a2a5


-- 


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


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

* [Bug fortran/38152] ICE for procedure pointer assignment
  2008-11-16  9:28 [Bug fortran/38152] New: ICE for procedure pointer assignment domob at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2008-11-22 21:43 ` burnus at gcc dot gnu dot org
@ 2009-01-13 19:47 ` domob at gcc dot gnu dot org
  2009-01-15 22:56 ` janus at gcc dot gnu dot org
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: domob at gcc dot gnu dot org @ 2009-01-13 19:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from domob at gcc dot gnu dot org  2009-01-13 19:47 -------
Created an attachment (id=17090)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17090&action=view)
Another test case

This seems to be yet another test triggering this ICE.


-- 


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


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

* [Bug fortran/38152] ICE for procedure pointer assignment
  2008-11-16  9:28 [Bug fortran/38152] New: ICE for procedure pointer assignment domob at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2009-01-13 19:47 ` domob at gcc dot gnu dot org
@ 2009-01-15 22:56 ` janus at gcc dot gnu dot org
  2009-01-16  6:50 ` [Bug fortran/38152] [4.4 Regression] procedure pointers as module variables burnus at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-01-15 22:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from janus at gcc dot gnu dot org  2009-01-15 22:56 -------
Created an attachment (id=17110)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17110&action=view)
patch

Here is a patch which fixes the testcases in comment #0, #1 and #7.

Dominique: Maybe you could check whether the problems from comment #4 and #5
still persist.

Can we still get this into 4.4? In a way the ICE is a regression, since 4.3
just gave an error message (stating that procedure pointers are not
implemented) but no ICE.


-- 

janus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |janus at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


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

* [Bug fortran/38152] [4.4 Regression] procedure pointers as module variables
  2008-11-16  9:28 [Bug fortran/38152] New: ICE for procedure pointer assignment domob at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2009-01-15 22:56 ` janus at gcc dot gnu dot org
@ 2009-01-16  6:50 ` burnus at gcc dot gnu dot org
  2009-01-16 12:04 ` janus at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-01-16  6:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from burnus at gcc dot gnu dot org  2009-01-16 06:50 -------
> Can we still get this into 4.4? In a way the ICE is a regression, since 4.3
> just gave an error message (stating that procedure pointers are not
> implemented) but no ICE.

I think one could; the patch only affects proc pointer and thus even if it
breaks, it would not be that bad. Note: There are currently only 102 serious
regressions left (6 P1 regressions; goal < 100 P1-P3 regressions, 0 P1
regressions) thus branching will be relatively soon.


-- 


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


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

* [Bug fortran/38152] [4.4 Regression] procedure pointers as module variables
  2008-11-16  9:28 [Bug fortran/38152] New: ICE for procedure pointer assignment domob at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2009-01-16  6:50 ` [Bug fortran/38152] [4.4 Regression] procedure pointers as module variables burnus at gcc dot gnu dot org
@ 2009-01-16 12:04 ` janus at gcc dot gnu dot org
  2009-01-16 12:31 ` janus at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-01-16 12:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from janus at gcc dot gnu dot org  2009-01-16 12:04 -------
Subject: Bug 38152

Author: janus
Date: Fri Jan 16 12:03:51 2009
New Revision: 143430

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143430
Log:
2009-01-16  Janus Weil  <janus@gcc.gnu.org>

        PR fortran/38152
        * expr.c (gfc_check_pointer_assign): Allow use-associated procedure
        pointers as lvalue.
        * trans-decl.c (get_proc_pointer_decl,gfc_create_module_variable):
        Enable procedure pointers as module variables.


2009-01-16  Janus Weil  <janus@gcc.gnu.org>

        PR fortran/38152
        * gfortran.dg/proc_ptr_13.f90: New.

Added:
    trunk/gcc/testsuite/gfortran.dg/proc_ptr_13.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/expr.c
    trunk/gcc/fortran/trans-decl.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/38152] [4.4 Regression] procedure pointers as module variables
  2008-11-16  9:28 [Bug fortran/38152] New: ICE for procedure pointer assignment domob at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2009-01-16 12:04 ` janus at gcc dot gnu dot org
@ 2009-01-16 12:31 ` janus at gcc dot gnu dot org
  2009-01-17 13:20 ` dominiq at lps dot ens dot fr
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-01-16 12:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from janus at gcc dot gnu dot org  2009-01-16 12:30 -------
This PR can be closed, provided there are no remaining issues on darwin9 (see
comment #4 and #5). I cannot check this myself (since I don't have access to a
darwin system), but maybe Dominique can?


-- 

janus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dominiq at lps dot ens dot
                   |                            |fr


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


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

* [Bug fortran/38152] [4.4 Regression] procedure pointers as module variables
  2008-11-16  9:28 [Bug fortran/38152] New: ICE for procedure pointer assignment domob at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2009-01-16 12:31 ` janus at gcc dot gnu dot org
@ 2009-01-17 13:20 ` dominiq at lps dot ens dot fr
  2009-01-17 13:25 ` burnus at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dominiq at lps dot ens dot fr @ 2009-01-17 13:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from dominiq at lps dot ens dot fr  2009-01-17 13:20 -------
(In reply to comment #11)
> This PR can be closed, provided there are no remaining issues on darwin9 (see
> comment #4 and #5). I cannot check this myself (since I don't have access to a
> darwin system), but maybe Dominique can?

AFAICT all the tests I have run passed, so this PR can probably be closed. If I
see anything I'll reopen it and report.  Thanks for the patch.


-- 


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


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

* [Bug fortran/38152] [4.4 Regression] procedure pointers as module variables
  2008-11-16  9:28 [Bug fortran/38152] New: ICE for procedure pointer assignment domob at gcc dot gnu dot org
                   ` (11 preceding siblings ...)
  2009-01-17 13:20 ` dominiq at lps dot ens dot fr
@ 2009-01-17 13:25 ` burnus at gcc dot gnu dot org
  2009-01-25  7:47 ` domob at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-01-17 13:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from burnus at gcc dot gnu dot org  2009-01-17 13:25 -------
Close as FIXED based on Dominique's remark.


-- 

burnus at gcc dot gnu dot org changed:

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


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


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

* [Bug fortran/38152] [4.4 Regression] procedure pointers as module variables
  2008-11-16  9:28 [Bug fortran/38152] New: ICE for procedure pointer assignment domob at gcc dot gnu dot org
                   ` (12 preceding siblings ...)
  2009-01-17 13:25 ` burnus at gcc dot gnu dot org
@ 2009-01-25  7:47 ` domob at gcc dot gnu dot org
  2009-01-30 22:21 ` hjl dot tools at gmail dot com
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: domob at gcc dot gnu dot org @ 2009-01-25  7:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from domob at gcc dot gnu dot org  2009-01-25 07:47 -------
*** Bug 38831 has been marked as a duplicate of this bug. ***


-- 


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


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

* [Bug fortran/38152] [4.4 Regression] procedure pointers as module variables
  2008-11-16  9:28 [Bug fortran/38152] New: ICE for procedure pointer assignment domob at gcc dot gnu dot org
                   ` (13 preceding siblings ...)
  2009-01-25  7:47 ` domob at gcc dot gnu dot org
@ 2009-01-30 22:21 ` hjl dot tools at gmail dot com
  2009-04-07 11:40 ` janus at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-01-30 22:21 UTC (permalink / raw)
  To: gcc-bugs



-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.4.0
            Version|unknown                     |4.4.0


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


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

* [Bug fortran/38152] [4.4 Regression] procedure pointers as module variables
  2008-11-16  9:28 [Bug fortran/38152] New: ICE for procedure pointer assignment domob at gcc dot gnu dot org
                   ` (14 preceding siblings ...)
  2009-01-30 22:21 ` hjl dot tools at gmail dot com
@ 2009-04-07 11:40 ` janus at gcc dot gnu dot org
  2009-04-07 11:43 ` janus at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-04-07 11:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from janus at gcc dot gnu dot org  2009-04-07 11:40 -------
Reopening.

proc_decl_13.f90 produces a segfault when compiled with "-g".

Backtrace:

#0  0x0000000000f4bee1 in htab_hash_string (p=0x0) at
/home/jweil/gcc45/trunk/libiberty/hashtab.c:812
#1  0x00000000005ff979 in lookup_filename (file_name=0x0) at
/home/jweil/gcc45/trunk/gcc/dwarf2out.c:15710
#2  0x00000000005f3efd in add_src_coords_attributes (die=0x7f26495edcc0,
decl=0x7f26496adaa0) at /home/jweil/gcc45/trunk/gcc/dwarf2out.c:12551
#3  0x00000000005f4089 in add_name_and_src_coords_attributes
(die=0x7f26495edcc0, decl=0x7f26496adaa0) at
/home/jweil/gcc45/trunk/gcc/dwarf2out.c:12568
#4  0x00000000005f9405 in gen_variable_die (decl=0x7f26496adaa0, origin=0x0,
context_die=0x7f26495ed3c0) at /home/jweil/gcc45/trunk/gcc/dwarf2out.c:14036
#5  0x00000000005fe0ba in gen_decl_die (decl=0x7f26496adaa0, origin=0x0,
context_die=0x7f26495ed3c0) at /home/jweil/gcc45/trunk/gcc/dwarf2out.c:15309
#6  0x00000000005ff2a4 in dwarf2out_decl (decl=0x7f26496adaa0) at
/home/jweil/gcc45/trunk/gcc/dwarf2out.c:15615
#7  0x00000000005fe7c6 in dwarf2out_global_decl (decl=0x7f26496adaa0) at
/home/jweil/gcc45/trunk/gcc/dwarf2out.c:15355
#8  0x0000000000907815 in emit_debug_global_declarations (vec=0x2f7ba40,
len=1342) at /home/jweil/gcc45/trunk/gcc/toplev.c:902
#9  0x00000000007bffec in write_global_declarations () at
/home/jweil/gcc45/trunk/gcc/langhooks.c:334
#10 0x0000000000907dbc in compile_file () at
/home/jweil/gcc45/trunk/gcc/toplev.c:987
#11 0x0000000000909c7e in do_compile () at
/home/jweil/gcc45/trunk/gcc/toplev.c:2241
#12 0x0000000000909ce2 in toplev_main (argc=3, argv=0x7fff5172fb68) at
/home/jweil/gcc45/trunk/gcc/toplev.c:2273
#13 0x00000000005137db in main (argc=3, argv=0x7fff5172fb68) at
/home/jweil/gcc45/trunk/gcc/main.c:35


-- 

janus at gcc dot gnu dot org changed:

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


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


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

* [Bug fortran/38152] [4.4 Regression] procedure pointers as module variables
  2008-11-16  9:28 [Bug fortran/38152] New: ICE for procedure pointer assignment domob at gcc dot gnu dot org
                   ` (15 preceding siblings ...)
  2009-04-07 11:40 ` janus at gcc dot gnu dot org
@ 2009-04-07 11:43 ` janus at gcc dot gnu dot org
  2009-04-07 12:12 ` jakub at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-04-07 11:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from janus at gcc dot gnu dot org  2009-04-07 11:43 -------
(In reply to comment #15) 
> proc_decl_13.f90 produces a segfault when compiled with "-g".

Sorry. Of course I'm talking about proc_ptr_13.f90.


-- 


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


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

* [Bug fortran/38152] [4.4 Regression] procedure pointers as module variables
  2008-11-16  9:28 [Bug fortran/38152] New: ICE for procedure pointer assignment domob at gcc dot gnu dot org
                   ` (16 preceding siblings ...)
  2009-04-07 11:43 ` janus at gcc dot gnu dot org
@ 2009-04-07 12:12 ` jakub at gcc dot gnu dot org
  2009-04-07 12:41 ` janus at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-04-07 12:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from jakub at gcc dot gnu dot org  2009-04-07 12:11 -------
All !DECL_IGNORED_P VAR_DECLs should have DECL_SOURCE_LOCATION set to something
other than UNKNOWN_LOCATION.  So, either the FE forgot to set it, or it didn't
set DECL_IGNORED_P flag when it should.


-- 


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


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

* [Bug fortran/38152] [4.4 Regression] procedure pointers as module variables
  2008-11-16  9:28 [Bug fortran/38152] New: ICE for procedure pointer assignment domob at gcc dot gnu dot org
                   ` (17 preceding siblings ...)
  2009-04-07 12:12 ` jakub at gcc dot gnu dot org
@ 2009-04-07 12:41 ` janus at gcc dot gnu dot org
  2009-04-07 16:25 ` janus at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-04-07 12:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from janus at gcc dot gnu dot org  2009-04-07 12:41 -------
Patch:

Index: gcc/fortran/trans-decl.c
===================================================================
--- gcc/fortran/trans-decl.c    (Revision 145652)
+++ gcc/fortran/trans-decl.c    (Arbeitskopie)
@@ -1015,10 +1015,12 @@ gfc_get_symbol_decl (gfc_symbol * sym)
   if (sym->backend_decl)
     return sym->backend_decl;

-  /* Catch function declarations.  Only used for actual parameters.  */
+  /* Catch function declarations.  Only used for actual parameters and
+     procedure pointers.  */
   if (sym->attr.flavor == FL_PROCEDURE)
     {
       decl = gfc_get_extern_function_decl (sym);
+      gfc_set_decl_location (decl, &sym->declared_at);
       return decl;
     }


-- 


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


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

* [Bug fortran/38152] [4.4 Regression] procedure pointers as module variables
  2008-11-16  9:28 [Bug fortran/38152] New: ICE for procedure pointer assignment domob at gcc dot gnu dot org
                   ` (18 preceding siblings ...)
  2009-04-07 12:41 ` janus at gcc dot gnu dot org
@ 2009-04-07 16:25 ` janus at gcc dot gnu dot org
  2009-04-08 14:04 ` janus at gcc dot gnu dot org
  2009-04-08 14:12 ` janus at gcc dot gnu dot org
  21 siblings, 0 replies; 23+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-04-07 16:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from janus at gcc dot gnu dot org  2009-04-07 16:24 -------
Subject: Bug 38152

Author: janus
Date: Tue Apr  7 16:24:31 2009
New Revision: 145692

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145692
Log:
2009-04-07  Janus Weil  <janus@gcc.gnu.org>

        PR fortran/38152
        * trans-decl.c (gfc_get_symbol_decl): Correctly set decl location for
        procedure pointer decls.


2009-04-07  Janus Weil  <janus@gcc.gnu.org>

        PR fortran/38152
        * gfortran.dg/proc_ptr_13.f90: Add "-g" option.


Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-decl.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/proc_ptr_13.f90


-- 


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


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

* [Bug fortran/38152] [4.4 Regression] procedure pointers as module variables
  2008-11-16  9:28 [Bug fortran/38152] New: ICE for procedure pointer assignment domob at gcc dot gnu dot org
                   ` (19 preceding siblings ...)
  2009-04-07 16:25 ` janus at gcc dot gnu dot org
@ 2009-04-08 14:04 ` janus at gcc dot gnu dot org
  2009-04-08 14:12 ` janus at gcc dot gnu dot org
  21 siblings, 0 replies; 23+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-04-08 14:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #20 from janus at gcc dot gnu dot org  2009-04-08 14:03 -------
Subject: Bug 38152

Author: janus
Date: Wed Apr  8 14:03:33 2009
New Revision: 145735

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145735
Log:
2009-04-08  Janus Weil  <janus@gcc.gnu.org>

        PR fortran/38152
        * trans-decl.c (gfc_get_symbol_decl): Correctly set decl location for
        procedure pointer decls.


2009-04-08  Janus Weil  <janus@gcc.gnu.org>

        PR fortran/38152
        * gfortran.dg/proc_ptr_13.f90: Add "-g" option.


Modified:
    branches/gcc-4_4-branch/gcc/fortran/trans-decl.c
    branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/proc_ptr_13.f90


-- 


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


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

* [Bug fortran/38152] [4.4 Regression] procedure pointers as module variables
  2008-11-16  9:28 [Bug fortran/38152] New: ICE for procedure pointer assignment domob at gcc dot gnu dot org
                   ` (20 preceding siblings ...)
  2009-04-08 14:04 ` janus at gcc dot gnu dot org
@ 2009-04-08 14:12 ` janus at gcc dot gnu dot org
  21 siblings, 0 replies; 23+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-04-08 14:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #21 from janus at gcc dot gnu dot org  2009-04-08 14:11 -------
Fixed in trunk and 4.4. Closing.


-- 

janus at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2009-04-08 14:12 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-16  9:28 [Bug fortran/38152] New: ICE for procedure pointer assignment domob at gcc dot gnu dot org
2008-11-16  9:28 ` [Bug fortran/38152] " domob at gcc dot gnu dot org
2008-11-16 19:01 ` janus at gcc dot gnu dot org
2008-11-17  0:02 ` burnus at gcc dot gnu dot org
2008-11-18 19:55 ` dominiq at lps dot ens dot fr
2008-11-19 16:31 ` dominiq at lps dot ens dot fr
2008-11-22 21:43 ` burnus at gcc dot gnu dot org
2009-01-13 19:47 ` domob at gcc dot gnu dot org
2009-01-15 22:56 ` janus at gcc dot gnu dot org
2009-01-16  6:50 ` [Bug fortran/38152] [4.4 Regression] procedure pointers as module variables burnus at gcc dot gnu dot org
2009-01-16 12:04 ` janus at gcc dot gnu dot org
2009-01-16 12:31 ` janus at gcc dot gnu dot org
2009-01-17 13:20 ` dominiq at lps dot ens dot fr
2009-01-17 13:25 ` burnus at gcc dot gnu dot org
2009-01-25  7:47 ` domob at gcc dot gnu dot org
2009-01-30 22:21 ` hjl dot tools at gmail dot com
2009-04-07 11:40 ` janus at gcc dot gnu dot org
2009-04-07 11:43 ` janus at gcc dot gnu dot org
2009-04-07 12:12 ` jakub at gcc dot gnu dot org
2009-04-07 12:41 ` janus at gcc dot gnu dot org
2009-04-07 16:25 ` janus at gcc dot gnu dot org
2009-04-08 14:04 ` janus at gcc dot gnu dot org
2009-04-08 14:12 ` janus 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).