https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80217

            Bug ID: 80217
           Summary: [7 Regression] ICE in set_ssa_name_value (deep
                    recursion in derive_equivalencs_from_bit_ior)
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

gcc-7.0.0-alpha20170326 snapshot ICEs when compiling the following snippet w/
-O1 (-O2, -O3, -Ofast):

int uk, c4;

void
hk (int zo, unsigned char tu)
{
  if (uk != 0)
    {
      for (;;)
        {
        }

      if (uk != 0)
        {
          if (uk != 0)
            {
              tu |= (0 || ((c4 /= 2) / c4) * c4);
              ++c4;
              uk += tu;
              ++uk;
            }
          ++uk;
        }
    }

    if (zo != 0)
      {
        uk = 2;
        while (uk != 0)
          uk = 1;

        while (tu != 0)
          {
 lh:
            zo |= uk;
            if (zo != 0)
              tu = zo;
            else
              tu = 0;

            while (uk != 0)
              {
              }
          }
      }

  for (uk = 0; uk < 1; ++uk)
    for (uk = 0; uk < 1; ++uk)
      {
        uk = 1;
        while (uk != 0)
          {
          }
      }

  goto lh;
}

% gcc-7.0.0-alpha20170326 -O1 -w -c btw2qvlq.c
gcc-7.0.0-alpha20170326: internal compiler error: Segmentation fault (program
cc1)

Program received signal SIGSEGV, Segmentation fault.
0x0000000000d7140c in set_ssa_name_value(tree_node*, tree_node*) ()
#0  0x0000000000d7140c in set_ssa_name_value(tree_node*, tree_node*) ()
#1  0x0000000000d41b4a in
const_and_copies::record_const_or_copy_raw(tree_node*, tree_node*, tree_node*)
()
#2  0x0000000000c99c7a in derive_equivalencs_from_bit_ior(tree_node*,
const_and_copies*) ()
#3  0x0000000000c99cb4 in derive_equivalencs_from_bit_ior(tree_node*,
const_and_copies*) ()
#4  0x0000000000c99cb4 in derive_equivalencs_from_bit_ior(tree_node*,
const_and_copies*) ()
#5  0x0000000000c99cb4 in derive_equivalencs_from_bit_ior(tree_node*,
const_and_copies*) ()
#6  0x0000000000c99cb4 in derive_equivalencs_from_bit_ior(tree_node*,
const_and_copies*) ()
#7  0x0000000000c99cb4 in derive_equivalencs_from_bit_ior(tree_node*,
const_and_copies*) ()
#8  0x0000000000c99cb4 in derive_equivalencs_from_bit_ior(tree_node*,
const_and_copies*) ()
#9  0x0000000000c99cb4 in derive_equivalencs_from_bit_ior(tree_node*,
const_and_copies*) ()
(More stack frames follow...)

Reply via email to