Bug ID: 77678
           Summary: ICE in fold_read_from_constant_string, at
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot
  Target Milestone: ---

A problem with default initialization (used for testing only),
starting at a specific negative value.
For versions down to at least 4.8, at -Og, -Os, -O1 or higher.
Testcode with an uninitialized variable "i" :

$ cat z1.f90
program p
   character(1) :: z
   integer :: i
   ! i = 2
   z = 'abc'(i:i)
   print *, z

$ gfortran-7-20160918 -O2 -finit-integer=-1 z1.f90
$ gfortran-7-20160918 -O2 -finit-integer=-8900000 z1.f90
$ gfortran-7-20160918 -O2 -finit-integer=-12345678 z1.f90


internal compiler error: Segmentation fault
0xc21a5f crash_signal
0x951f1b fold_read_from_constant_string(tree_node*)
0x996f7f fold_const_aggregate_ref_1(tree_node*, tree_node* (*)(tree_node*))
0x9984de fold_const_aggregate_ref(tree_node*)
0x9984de maybe_fold_reference
0x998999 fold_gimple_assign
0x99ddff fold_stmt_1
0xdc0781 substitute_and_fold_dom_walker::before_dom_children(basic_block_def*)
0x1299da2 dom_walker::walk(basic_block_def*)
0xdbfb9b substitute_and_fold(tree_node* (*)(tree_node*), bool
(*)(gimple_stmt_iterator*), bool)
0xd299cc ccp_finalize
0xd299cc do_ssa_ccp
0xd299cc execute

Reply via email to