In this short program, on i386-darwin (probably all i386),

struct pt
{
  int x, y;
};

struct pt sum(struct pt *p)
{
  struct pt tmp = { 0, 0 };
  int i;
  for (i = 0; i < 100; i++)
    {
      tmp.x += p[i].x;
      tmp.y += p[i].y;
    }
  return tmp;
}

when compiled with -O1 -g, there is no location information for 'i', despite it
being in %ecx.  This is because ivopts has replaced 'i' with a variable with
exactly the same value but a different name, breaking the debug information.


-- 
           Summary: no debug information for loop counters
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: geoffk at gcc dot gnu dot org
GCC target triplet: i386-*-*


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

Reply via email to