public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [Patch, Fortran] PR 78392: ICE in gfc_trans_auto_array_allocation, at fortran/trans-array.c:5979
@ 2016-11-18 14:05 Dominique d'Humières
  2016-11-18 21:06 ` Janus Weil
  0 siblings, 1 reply; 11+ messages in thread
From: Dominique d'Humières @ 2016-11-18 14:05 UTC (permalink / raw)
  To: Janus Weil; +Cc: fortran, gcc-patches

Hi Janus,

> the attached patch fixes an ice-on-valid problem, simply by removing an assert. ...

I have several instances in my test suite showing that the proposed patch removes the ICE but generates wrong code:

pr42359, second test, => ICE on another place
pr54613, sixth and eighth tests,

Thanks for working on the issue,

Dominique

^ permalink raw reply	[flat|nested] 11+ messages in thread
* [Patch, Fortran] PR 78392: ICE in gfc_trans_auto_array_allocation, at fortran/trans-array.c:5979
@ 2016-11-18 13:03 Janus Weil
  0 siblings, 0 replies; 11+ messages in thread
From: Janus Weil @ 2016-11-18 13:03 UTC (permalink / raw)
  To: gfortran, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 472 bytes --]

Hi all,

the attached patch fixes an ice-on-valid problem, simply by removing
an assert. The generated code works as expected and the patch regtests
cleanly on x86_64-linux-gnu. Ok for trunk?

Cheers,
Janus



2016-11-18  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/78392
    * trans-array.c (gfc_trans_auto_array_allocation): Remove an assert.

2016-11-18  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/78392
    * gfortran.dg/saved_automatic_2.f90: New test case.

[-- Attachment #2: pr78392.diff --]
[-- Type: text/plain, Size: 440 bytes --]

Index: gcc/fortran/trans-array.c
===================================================================
--- gcc/fortran/trans-array.c	(Revision 242586)
+++ gcc/fortran/trans-array.c	(Arbeitskopie)
@@ -5976,7 +5976,6 @@ gfc_trans_auto_array_allocation (tree decl, gfc_sy
   type = TREE_TYPE (type);
 
   gcc_assert (!sym->attr.use_assoc);
-  gcc_assert (!TREE_STATIC (decl));
   gcc_assert (!sym->module);
 
   if (sym->ts.type == BT_CHARACTER

[-- Attachment #3: saved_automatic_2.f90 --]
[-- Type: text/x-fortran, Size: 393 bytes --]

! { dg-do run }
!
! PR 78392: ICE in gfc_trans_auto_array_allocation, at fortran/trans-array.c:5979
!
! Contributed by Janus Weil <janus@gcc.gnu.org>

module mytypes
   implicit none
 contains
   pure integer function get_i ()
     get_i = 13
   end function
end module

program test
  use mytypes
  implicit none
  integer, dimension(get_i()), save :: x
  if (size(x) /= 13) call abort()
end

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

end of thread, other threads:[~2016-12-12 18:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-18 14:05 [Patch, Fortran] PR 78392: ICE in gfc_trans_auto_array_allocation, at fortran/trans-array.c:5979 Dominique d'Humières
2016-11-18 21:06 ` Janus Weil
2016-11-19  9:12   ` Janus Weil
2016-11-26  9:45     ` Janus Weil
2016-11-26 16:37       ` Dominique d'Humières
2016-11-26 18:10         ` Janus Weil
2016-12-03  7:05       ` Janus Weil
2016-12-12 15:52         ` Janus Weil
2016-12-12 17:37           ` Paul Richard Thomas
2016-12-12 18:56             ` Janus Weil
  -- strict thread matches above, loose matches on Subject: below --
2016-11-18 13:03 Janus Weil

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).