[Bug fortran/67542] ICE in gfc_emit_parameter_debug_info, at fortran/trans-decl.c:4947 and :4945

2021-10-24 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67542

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |DUPLICATE
 CC||anlauf at gcc dot gnu.org

--- Comment #14 from anlauf at gcc dot gnu.org ---
Indeed this is a duplicate.  All ICEing cases are rejected by the new check.

*** This bug has been marked as a duplicate of bug 102685 ***

[Bug fortran/67542] ICE in gfc_emit_parameter_debug_info, at fortran/trans-decl.c:4947 and :4945

2021-10-24 Thread dominiq at lps dot ens.fr via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67542

--- Comment #13 from Dominique d'Humieres  ---
Duplicate of pr102685, fixed by r12-4452?

[Bug fortran/67542] ICE in gfc_emit_parameter_debug_info, at fortran/trans-decl.c:4947 and :4945

2021-10-24 Thread dominiq at lps dot ens.fr via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67542

--- Comment #12 from Dominique d'Humieres  ---
As for r12-4638 the tests are now rejected whit

Error: The shape of component 'c' in the structure constructor at (1) differs
from the shape of the declared component for dimension 1 (2/1)

So this old PR could probably be closed as FIXED.

[Bug fortran/67542] ICE in gfc_emit_parameter_debug_info, at fortran/trans-decl.c:4947 and :4945

2019-02-28 Thread gs...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67542

--- Comment #11 from G. Steinmetz  ---

Well, the ICEs are gone for all posted test cases above.

Assuming that different shapes are not supported as an extension
(aka feature), as such they are not standard-conforming.

F2018 7.5.10 item 2 says
"... expr shall conform in the same way as for a variable
and expr in an intrinsic assignment statement (10.2.1.2).
If necessary, each value of intrinsic type is converted
according to the rules of intrinsic assignment (10.2.1.3)
to a value that agrees in type and type parameters with
the corresponding component of the derived type. For a
nonpointer nonallocatable component, the shape of the
expression shall conform with the shape of the component."


In the following modified example z1.f90 from comment 0
x and z should be flagged with an error :

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


---


In the meantime I felt compelled to dig a little further ... 
and unfortunately there are more variants, which fail. 
(also depending on presence/absence of parameter attribute,
prints, compile options)


$ cat za.f90
program p
   type t
  integer :: a(1)
  integer :: b(1)
   end type
   type(t), parameter :: z(2) = t([1,2], [3])
end


$ gfortran-9-20190224 -c za.f90
$ gfortran-9-20190224 -c za.f90 -g
za.f90:7:0:

7 | end
  |
internal compiler error: in native_encode_initializer, at dwarf2out.c:20274
0x804af8 native_encode_initializer
../../gcc/dwarf2out.c:20274
0x804a97 native_encode_initializer
../../gcc/dwarf2out.c:20316
0x804ad7 native_encode_initializer
../../gcc/dwarf2out.c:20259
0x826d15 tree_add_const_value_attribute
../../gcc/dwarf2out.c:20374
#...



$ cat zb.f90
program p
   type t
  integer :: a(1)
  integer :: b(1)
   end type
   type(t), parameter :: z(2) = t([1,2], [3])
   print *, z
end


$ gfortran-9-20190224 -c zb.f90# -g not necessary
zb.f90:8:0:

8 | end
  |
internal compiler error: in output_constructor_regular_field, at varasm.c:5207
0xda71d1 output_constructor_regular_field
../../gcc/varasm.c:5207
0xda71d1 output_constructor
../../gcc/varasm.c:5513
0xda68a5 output_constant
../../gcc/varasm.c:4885
0xda68a5 output_constructor_regular_field
../../gcc/varasm.c:5246
#...

[Bug fortran/67542] ICE in gfc_emit_parameter_debug_info, at fortran/trans-decl.c:4947 and :4945

2019-02-28 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67542

--- Comment #10 from Dominique d'Humieres  ---
> Yep, done.

Do you mean that the PR can be closed as FIXED?

I am wondering if the tests are valid Fortran.

[Bug fortran/67542] ICE in gfc_emit_parameter_debug_info, at fortran/trans-decl.c:4947 and :4945

2019-02-26 Thread gs...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67542

G. Steinmetz  changed:

   What|Removed |Added

 CC||gs...@t-online.de

--- Comment #9 from G. Steinmetz  ---
Yep, done.

[Bug fortran/67542] ICE in gfc_emit_parameter_debug_info, at fortran/trans-decl.c:4947 and :4945

2019-02-26 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67542

--- Comment #8 from Dominique d'Humieres  ---
I cannot get any ICE with the options and revisions I have tried.

[Bug fortran/67542] ICE in gfc_emit_parameter_debug_info, at fortran/trans-decl.c:4947 and :4945

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

Gerhard Steinmetz  changed:

   What|Removed |Added

Summary|ICE on initializing type|ICE in
   |variable with a longer  |gfc_emit_parameter_debug_in
   |array   |fo, at
   ||fortran/trans-decl.c:4947
   ||and :4945

--- Comment #7 from Gerhard Steinmetz  
---

The problems are gone for examples z1, z2, z3 (and others),
but still there for examples z4, z5, z6. Volatile and transient,
for different runs and different options. Summary line adjusted.


One example -- but not limited to -std=f2008 nor depending on it :


$ for n in `seq 1 100`
$ do
$gfortran-7-20160731 -std=f2008 -c z6.f90
$ done


$ gfortran-7-20160731 -std=f2008 -c z6.f90
z6.f90:10:0:

 end

internal compiler error: Segmentation fault
0xc1436f crash_signal
../../gcc/toplev.c:335
0x73cb13 gfc_emit_parameter_debug_info
../../gcc/fortran/trans-decl.c:4947
0x706ddb do_traverse_symtree
../../gcc/fortran/symbol.c:3930
0x74bfc5 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:6381
0x6d7610 translate_all_program_units
../../gcc/fortran/parse.c:5916
0x6d7610 gfc_parse_file()
../../gcc/fortran/parse.c:6122
0x719b32 gfc_be_parse_file
../../gcc/fortran/f95-lang.c:198


---


$ gfortran-7-20160731 -std=f2008 -c z4.f90
z4.f90:9:0:

 end

internal compiler error: Segmentation fault
0xc1436f crash_signal
../../gcc/toplev.c:335
0x73ad38 gfc_conv_const_charlen(gfc_charlen*)
../../gcc/fortran/trans-const.c:182
0x73cb01 gfc_emit_parameter_debug_info
../../gcc/fortran/trans-decl.c:4945
0x706ddb do_traverse_symtree
../../gcc/fortran/symbol.c:3930
0x74bfc5 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:6381
0x6d7610 translate_all_program_units
../../gcc/fortran/parse.c:5916
0x6d7610 gfc_parse_file()
../../gcc/fortran/parse.c:6122
0x719b32 gfc_be_parse_file
../../gcc/fortran/f95-lang.c:198