This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/49262] New: 3-yr-old infinite loop in dwarf2out.c


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49262

           Summary: 3-yr-old infinite loop in dwarf2out.c
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jim@meyering.net


coverity pointed out the infinite loop below, in dwarf2out.c.
I guess it is unreachable or at least hard to reach,
or it would have been reported/fixed before now:

17605              if (index && TREE_CODE (index) == RANGE_EXPR)
17606            {
17607              int count = tree_low_cst (TREE_OPERAND (index, 1), 0)
17608                      - tree_low_cst (TREE_OPERAND (index, 0), 0);

Event loop_top:     Top of the loop.
Event loop_condition:     "0 < count" must remain true for the loop to
continue.
Also see events:     [loop_bottom]

17609              while (count > 0)
17610                {
17611                  if (val)
17612                memcpy (array + curpos, array + pos, fieldsize);

Event loop_bottom:     Bottom of the loop.
Also see events:     [loop_top][loop_condition]

17613                  curpos += fieldsize;
17614                }
17615            }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]