Testcase:
struct a {};
static const int d = 1;
static const struct a b = {};
static const int c = 1;
int f(const int *, const struct a *, const int*, const int*);
int g(void)
{
  return f(&c, &b, &d, &c);
}
int f(const int *b, const struct a *c, const int *d, const int *e)
{
  return *b == *d;
}
int main(void)
{
  if (!g())
    __builtin_abort();
}

-----
What is happening is that the size for b is being calcuated wrong in the anchor
code, I don't know how to fix this yet.


-- 
           Summary: Regressions with -fsection-anchors with zero sized
                    structs
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
GCC target triplet: powerpc-darwin
 BugsThisDependsOn: 26389


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

Reply via email to