[Bug fortran/67885] ICE on using parameter array in block

2015-10-29 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67885

--- Comment #7 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Thu Oct 29 17:06:58 2015
New Revision: 229540

URL: https://gcc.gnu.org/viewcvs?rev=229540=gcc=rev
Log:
2015-10-29  Steven G. Kargl  

PR fortran/67885
* trans-decl.c (generate_local_decl): Mark PARAMETER entities in
BLOCK construct.

2015-10-26  Steven G. Kargl  

PR fortran/67885
* gfortran.dg/pr67885.f90: New test.

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


[Bug fortran/67885] ICE on using parameter array in block

2015-10-29 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67885

kargl at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |5.3

--- Comment #9 from kargl at gcc dot gnu.org ---
Fixed on trunk and 5-branch.  Thanks for the bug report.


[Bug fortran/67885] ICE on using parameter array in block

2015-10-29 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67885

--- Comment #8 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Thu Oct 29 19:52:56 2015
New Revision: 229554

URL: https://gcc.gnu.org/viewcvs?rev=229554=gcc=rev
Log:
2015-10-29  Steven G. Kargl  

PR fortran/67885
* trans-decl.c (generate_local_decl): Mark PARAMETER entities in
BLOCK construct.

2015-10-29  Steven G. Kargl  

PR fortran/67885
* gfortran.dg/pr67885.f90: New test.

Added:
branches/gcc-5-branch/gcc/testsuite/gfortran.dg/pr67885.f90
Modified:
branches/gcc-5-branch/gcc/fortran/ChangeLog
branches/gcc-5-branch/gcc/fortran/trans-decl.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog


[Bug fortran/67885] ICE on using parameter array in block

2015-10-29 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67885

--- Comment #6 from Dominique d'Humieres  ---
Patch submitted at https://gcc.gnu.org/ml/fortran/2015-10/msg00153.html and
approved at https://gcc.gnu.org/ml/fortran/2015-10/msg00154.html.


[Bug fortran/67885] ICE on using parameter array in block

2015-10-26 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67885

kargl at gcc dot gnu.org changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |kargl at gcc dot gnu.org

--- Comment #5 from kargl at gcc dot gnu.org ---
I'm testing a patch now.


[Bug fortran/67885] ICE on using parameter array in block

2015-10-12 Thread gerhard.steinmetz.fort...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67885

--- Comment #4 from Gerhard Steinmetz  
---
Deleting the dimension from parameter a (making it scalar)
lets examples z1.f90 and z5.f90 compile and run fine.


$ cat y1.f90
program p
   block
  real, parameter :: a = 1.0
  real :: x(2)
  x = a
  print *, x
  block
 print *, x
  end block
  print *, x
   end block
end

$ gfortran -g -O0 -Wall -fcheck=all -fno-frontend-optimize y1.f90
$ a.out
   1.   1.
   1.   1.
   1.   1.

---

$ cat y5.f90
program p
   block
  real, parameter :: a = 1.0
  real :: x(2)
  x = a
  print *, x
   end block
end

$ gfortran -g -O0 -Wall -fcheck=all -fno-frontend-optimize y5.f90
$ a.out
   1.   1.


[Bug fortran/67885] ICE on using parameter array in block

2015-10-07 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67885

kargl at gcc dot gnu.org changed:

   What|Removed |Added

 CC||kargl at gcc dot gnu.org

--- Comment #3 from kargl at gcc dot gnu.org ---
(In reply to Gerhard Steinmetz from comment #1)
> Deleting this inner block gives another error :
> 
> $ cat z5.f90
> program p
>block
>   real, parameter :: a(2) = 1.0
>   real :: x(2)
>   x = a
>   print *, x
>end block
> end
> 
> 
> $ gfortran -g -O0 -Wall -fcheck=all -fno-frontend-optimize z5.f90
> /tmp/cckgiZhq.o: In function `p':
> /home/.../z5.f90:5: undefined reference to `a.3386'
> collect2: error: ld returned 1 exit status
> 

The a(2) appears to be optimized out.  Don't know if the
code is legal because I haven't looked at standard, yet.
Changing your print statement to 

  if (x(1) /= 1.0) call abort

gives

% gfc6 -fdump-tree-original -c g5.f90
% cat g5.f90.003t.original
p ()
{
  {
real(kind=4) x[2];

(void) __builtin_memcpy ((void *) , (void *) , 8);
if (x[0] != 1.0e+0)
  {
_gfortran_abort ();
  }
L.2:;
L.1:;
  }
}


[Bug fortran/67885] ICE on using parameter array in block

2015-10-07 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67885

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-10-07
 Ever confirmed|0   |1

--- Comment #2 from Dominique d'Humieres  ---
Confirmed from 4.8 up to trunk (6.0).


[Bug fortran/67885] ICE on using parameter array in block

2015-10-07 Thread gerhard.steinmetz.fort...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67885

--- Comment #1 from Gerhard Steinmetz  
---
Deleting this inner block gives another error :

$ cat z5.f90
program p
   block
  real, parameter :: a(2) = 1.0
  real :: x(2)
  x = a
  print *, x
   end block
end


$ gfortran -g -O0 -Wall -fcheck=all -fno-frontend-optimize z5.f90
/tmp/cckgiZhq.o: In function `p':
/home/.../z5.f90:5: undefined reference to `a.3386'
collect2: error: ld returned 1 exit status


$ gfortran z5.f90
/tmp/ccwaNc8P.o: In function `MAIN__':
z5.f90:(.text+0xe): undefined reference to `a.3385'
collect2: error: ld returned 1 exit status