[Bug fortran/67542] ICE on initializing type variable with a longer array

2016-08-04 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67542

--- Comment #6 from Dominique d'Humieres  ---
Is not this PR fixed?

[Bug fortran/67542] ICE on initializing type variable with a longer array

2016-05-03 Thread gerhard.steinmetz.fort...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67542

--- Comment #5 from Gerhard Steinmetz  
---
If not covered elsewhere, one problem is remaining.
Nondeterministic and depending on used options :


$ cat z4.f90
program p
   character(1), parameter :: a(4) = ['a','b','c','d']
   type t
  integer :: n
  character(2) :: c(3)
   end type
   type(t) :: x = t(4, [a])
   print *, x
end


$ cat z5.f90
program p
   character(1), parameter :: a(4) = ['a','b','c','d']
   type t
  integer :: n
  character(2) :: c(3)
   end type
   type(t) :: x = t(4, [a(1:4)])
   print *, x
end


$ cat z6.f90
program p
   integer :: k
   character(1), parameter :: a(4) = ['a','b','c','d']
   type t
  integer :: n
  character(2) :: c(3)
   end type
   type(t) :: x = t(4, [(a(k),k=1,4)])
   print *, x
end


$ gfortran-6 -O0 -g -Wall -fcheck=all z6.f90
internal compiler error: Segmentation fault


$ gfortran-7-20160501 -g z6.f90
internal compiler error: Segmentation fault
0xbf6ebf crash_signal
../../gcc/toplev.c:333
0x72f8c3 gfc_emit_parameter_debug_info
../../gcc/fortran/trans-decl.c:4894
0x6f9d3b do_traverse_symtree
../../gcc/fortran/symbol.c:3817
0x73eb65 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:6328
0x6cabc0 translate_all_program_units
../../gcc/fortran/parse.c:5613
0x6cabc0 gfc_parse_file()
../../gcc/fortran/parse.c:5819
0x70ca32 gfc_be_parse_file
../../gcc/fortran/f95-lang.c:201

[Bug fortran/67542] ICE on initializing type variable with a longer array

2016-05-03 Thread gerhard.steinmetz.fort...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67542

--- Comment #4 from Gerhard Steinmetz  
---
The ICE from above is gone a while ago.

$ gfortran-6 --version
GNU Fortran (SUSE Linux) 6.1.1 20160502 [gcc-6-branch revision 235698]

$ gfortran-6 -g -O0 -Wall -fcheck=all z1.f90
z1.f90:6:15:

type(t) :: x = t(1, ['a'])
   1
Warning: Unused variable ‘x’ declared at (1) [-Wunused-variable]
z1.f90:7:15:

type(t) :: y = t(2, ['a', 'b'])
   1
Warning: Unused variable ‘y’ declared at (1) [-Wunused-variable]

---

$ cat z3.f90
program p
   character(1), parameter :: a(4) = ['a','b','c','d']
   type t
  integer :: n
  character(2) :: c(3)
   end type
   type(t) :: x = t(1, a(1:2))
   type(t) :: y = t(2, a(1:4))
   type(t) :: z = t(3, a)
   print *, x
   print *, y
   print *, z
end

$ gfortran-6 -g -O0 -Wall -fcheck=all z3.f90
$ a.out
   1 a b
   2 a b c
   3 a b c

[Bug fortran/67542] ICE on initializing type variable with a longer array

2015-12-05 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67542

--- Comment #3 from Dominique d'Humieres  ---
> I don't get any internal compiler error for the test in comment 0 from 4.8
> up to trunk (6.0).

This is not true if I compile the test with -g up to revision r224160
(2015-06-05, ICE), but is true after r224647 (2015-06-19, compiles).

[Bug fortran/67542] ICE on initializing type variable with a longer array

2015-09-13 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67542

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2015-09-13
 Ever confirmed|0   |1

--- Comment #2 from Dominique d'Humieres  ---
I don't get any internal compiler error for the test in comment 0 from 4.8 up
to trunk (6.0). However I am surprised that I don't get any error. The
following test

character(4) :: str
str=['a', 'b']
print *, str
end

gives

 str=['a', 'b']
1
Error: Incompatible ranks 0 and 1 in assignment at (1)


[Bug fortran/67542] ICE on initializing type variable with a longer array

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

--- Comment #1 from Gerhard Steinmetz  
---

The ICE disappears if some prints are added :

$ cat z2.f90
program p
   type t
  integer :: n
  character(8) :: c(1)
   end type
   type(t) :: x = t(1, ['a'])
   type(t) :: y = t(1, ['a', 'b'])
   print *, x
   print *, y
end

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