public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/39931]  New: ICE on invalid Fortran 95 code (bad pointer assignment), gimplify_expr  at gimplify.c:6315
@ 2009-04-27 13:37 thomas dot orgis at awi dot de
  2009-04-27 13:46 ` [Bug fortran/39931] " dominiq at lps dot ens dot fr
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: thomas dot orgis at awi dot de @ 2009-04-27 13:37 UTC (permalink / raw)
  To: gcc-bugs

I observed this for gfortran 4.3.2, but also just upgraded to 4.3.3, where only
the line number in gimplify.c increases by one.
The code is bad, I know, but the compiler should tell me that instead of
crashing, I guess.
A SuSE gfortran (version 4.1.2 20070115 (prerelease)) does correctly point out:

 In file point_of_no_return.f95:20

face%bla => blu
   1
Error: Pointer assignment to non-POINTER at (1)

While vanilla gfortran 4.3.3's response is an ICE, as noted in the
stripped-down example:


program point_of_no_return

implicit none

type face_t
        ! This is intended to be a pointer, but the keyword has been
forgotten...
        integer :: bla
end type

integer, pointer :: blu
type(face_t), pointer :: face

allocate(face)
allocate(blu)

! Gfortran 4.3.2 gets ICE on this.
! It rather should detect that face%bla is no pointer (just a data field inside
a structure that is pointed to).
!point_of_no_return.f95: In function
'point_of_no_return':!point_of_no_return.f95:20: internal compiler error: in
gimplify_expr, at gimplify.c:6314

face%bla => blu

end program


-- 
           Summary: ICE on invalid Fortran 95 code (bad pointer assignment),
                    gimplify_expr  at gimplify.c:6315
           Product: gcc
           Version: 4.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: thomas dot orgis at awi dot de
 GCC build triplet: x86_64-pc-linux-gnu
  GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64-pc-linux-gnu


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


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

* [Bug fortran/39931] ICE on invalid Fortran 95 code (bad pointer assignment), gimplify_expr  at gimplify.c:6315
  2009-04-27 13:37 [Bug fortran/39931] New: ICE on invalid Fortran 95 code (bad pointer assignment), gimplify_expr at gimplify.c:6315 thomas dot orgis at awi dot de
@ 2009-04-27 13:46 ` dominiq at lps dot ens dot fr
  2009-04-27 15:17 ` rguenth at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens dot fr @ 2009-04-27 13:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from dominiq at lps dot ens dot fr  2009-04-27 13:46 -------
Confirmed on (powerpc|i686)-apple-darwin9 gfortran 4.3.3, 4.4.0, and trunk,
gives the error on 4.2.3.
Trunk gives:

gimplification failed:
&face->bla <addr_expr 0x41598380
    type <pointer_type 0x41510e00
        type <integer_type 0x41510310 integer(kind=4) public SI
            size <integer_cst 0x413b16c0 constant 32>
            unit size <integer_cst 0x413b1330 constant 4>
            align 32 symtab 0 alias set -1 canonical type 0x41510310 precision
32 min <integer_cst 0x413b1630 -2147483648> max <integer_cst 0x413b1660
2147483647>
            pointer_to_this <pointer_type 0x41510e00>>
        unsigned type_3 SI size <integer_cst 0x413b16c0 32> unit size
<integer_cst 0x413b1330 4>
        align 32 symtab 0 alias set -1 canonical type 0x41510e00>

    arg 0 <component_ref 0x41590f60 type <integer_type 0x41510310
integer(kind=4)>

        arg 0 <indirect_ref 0x41598360 type <record_type 0x415963f0 face_t>
            arg 0 <var_decl 0x415942a0 face>>
        arg 1 <field_decl 0x41594240 bla type <integer_type 0x41510310
integer(kind=4)>
            SI file pr39931.f90 line 7 col 0 size <integer_cst 0x413b16c0 32>
unit size <integer_cst 0x413b1330 4>
            align 32 offset_align 128
            offset <integer_cst 0x413b1360 constant 0>
            bit offset <integer_cst 0x413b1ae0 constant 0> context <record_type
0x415963f0 face_t>>>>
pr39931.f90: In function 'point_of_no_return':
pr39931.f90:20: internal compiler error: gimplification failed


-- 


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


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

* [Bug fortran/39931] ICE on invalid Fortran 95 code (bad pointer assignment), gimplify_expr  at gimplify.c:6315
  2009-04-27 13:37 [Bug fortran/39931] New: ICE on invalid Fortran 95 code (bad pointer assignment), gimplify_expr at gimplify.c:6315 thomas dot orgis at awi dot de
  2009-04-27 13:46 ` [Bug fortran/39931] " dominiq at lps dot ens dot fr
@ 2009-04-27 15:17 ` rguenth at gcc dot gnu dot org
  2009-04-27 17:54 ` janus at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-04-27 15:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2009-04-27 15:16 -------
Well, the FE asks us to gimplify

&face->bla = blu;

which obviously cannot work (you cannot assign to an address).  I would suggest
to put error_mark_node there.


-- 


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


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

* [Bug fortran/39931] ICE on invalid Fortran 95 code (bad pointer assignment), gimplify_expr  at gimplify.c:6315
  2009-04-27 13:37 [Bug fortran/39931] New: ICE on invalid Fortran 95 code (bad pointer assignment), gimplify_expr at gimplify.c:6315 thomas dot orgis at awi dot de
  2009-04-27 13:46 ` [Bug fortran/39931] " dominiq at lps dot ens dot fr
  2009-04-27 15:17 ` rguenth at gcc dot gnu dot org
@ 2009-04-27 17:54 ` janus at gcc dot gnu dot org
  2009-04-27 18:04 ` janus at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-04-27 17:54 UTC (permalink / raw)
  To: gcc-bugs



-- 

janus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |janus at gcc dot gnu dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-04-27 17:54:23
               date|                            |


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


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

* [Bug fortran/39931] ICE on invalid Fortran 95 code (bad pointer assignment), gimplify_expr  at gimplify.c:6315
  2009-04-27 13:37 [Bug fortran/39931] New: ICE on invalid Fortran 95 code (bad pointer assignment), gimplify_expr at gimplify.c:6315 thomas dot orgis at awi dot de
                   ` (2 preceding siblings ...)
  2009-04-27 17:54 ` janus at gcc dot gnu dot org
@ 2009-04-27 18:04 ` janus at gcc dot gnu dot org
  2009-04-27 19:09 ` janus at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-04-27 18:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from janus at gcc dot gnu dot org  2009-04-27 18:04 -------
An error message should be emitted already in the front end, probably in
gfc_check_pointer_assign (expr.c).


-- 


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


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

* [Bug fortran/39931] ICE on invalid Fortran 95 code (bad pointer assignment), gimplify_expr  at gimplify.c:6315
  2009-04-27 13:37 [Bug fortran/39931] New: ICE on invalid Fortran 95 code (bad pointer assignment), gimplify_expr at gimplify.c:6315 thomas dot orgis at awi dot de
                   ` (3 preceding siblings ...)
  2009-04-27 18:04 ` janus at gcc dot gnu dot org
@ 2009-04-27 19:09 ` janus at gcc dot gnu dot org
  2009-04-28  9:45 ` janus at gcc dot gnu dot org
  2009-04-28 10:52 ` janus at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-04-27 19:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from janus at gcc dot gnu dot org  2009-04-27 19:09 -------
Patch:

Index: gcc/fortran/expr.c
===================================================================
--- gcc/fortran/expr.c  (Revision 146847)
+++ gcc/fortran/expr.c  (Arbeitskopie)
@@ -3070,8 +3070,8 @@
       if (pointer)
        check_intent_in = 0;

-      if (ref->type == REF_COMPONENT && ref->u.c.component->attr.pointer)
-       pointer = 1;
+      if (ref->type == REF_COMPONENT)
+       pointer = ref->u.c.component->attr.pointer;

       if (ref->type == REF_ARRAY && ref->next == NULL)
        {


-- 

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
   Last reconfirmed|2009-04-27 17:54:23         |2009-04-27 19:09:03
               date|                            |


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


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

* [Bug fortran/39931] ICE on invalid Fortran 95 code (bad pointer assignment), gimplify_expr  at gimplify.c:6315
  2009-04-27 13:37 [Bug fortran/39931] New: ICE on invalid Fortran 95 code (bad pointer assignment), gimplify_expr at gimplify.c:6315 thomas dot orgis at awi dot de
                   ` (4 preceding siblings ...)
  2009-04-27 19:09 ` janus at gcc dot gnu dot org
@ 2009-04-28  9:45 ` janus at gcc dot gnu dot org
  2009-04-28 10:52 ` janus at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-04-28  9:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from janus at gcc dot gnu dot org  2009-04-28 09:44 -------
Subject: Bug 39931

Author: janus
Date: Tue Apr 28 09:44:36 2009
New Revision: 146880

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

        PR fortran/39930
        PR fortran/39931
        * expr.c (gfc_check_pointer_assign): Correctly detect if the left hand
        side is a pointer.
        * parse.c (gfc_fixup_sibling_symbols): Don't check for ambiguity.


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

        PR fortran/39930
        PR fortran/39931
        * gfortran.dg/ambiguous_reference_2.f90: New.
        * gfortran.dg/pointer_assign_7.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/ambiguous_reference_2.f90
    trunk/gcc/testsuite/gfortran.dg/pointer_assign_7.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/expr.c
    trunk/gcc/fortran/parse.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/39931] ICE on invalid Fortran 95 code (bad pointer assignment), gimplify_expr  at gimplify.c:6315
  2009-04-27 13:37 [Bug fortran/39931] New: ICE on invalid Fortran 95 code (bad pointer assignment), gimplify_expr at gimplify.c:6315 thomas dot orgis at awi dot de
                   ` (5 preceding siblings ...)
  2009-04-28  9:45 ` janus at gcc dot gnu dot org
@ 2009-04-28 10:52 ` janus at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-04-28 10:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from janus at gcc dot gnu dot org  2009-04-28 10:52 -------
Fixed with r146880. Closing.


-- 

janus at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2009-04-28 10:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-27 13:37 [Bug fortran/39931] New: ICE on invalid Fortran 95 code (bad pointer assignment), gimplify_expr at gimplify.c:6315 thomas dot orgis at awi dot de
2009-04-27 13:46 ` [Bug fortran/39931] " dominiq at lps dot ens dot fr
2009-04-27 15:17 ` rguenth at gcc dot gnu dot org
2009-04-27 17:54 ` janus at gcc dot gnu dot org
2009-04-27 18:04 ` janus at gcc dot gnu dot org
2009-04-27 19:09 ` janus at gcc dot gnu dot org
2009-04-28  9:45 ` janus at gcc dot gnu dot org
2009-04-28 10:52 ` 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).