TCL is miscompiled in TraceVariableObjCmd wrt fortification.  Testcase:

struct X {
    void *p;
    struct {
        char s[4];
    } y;
};

void * __attribute__((noinline,noclone))
myalloc (unsigned int sz)
{
  return __builtin_malloc (sz);
}

int main()
{
  struct X *p = myalloc (sizeof (struct X)
                         + sizeof ("Hello World") + 1 - sizeof (p->y.s));
  __builtin___strcpy_chk (p->y.s, "Hello World",
                          __builtin_object_size (p->y.s, 1));
  return 0;
}

GCC 4.4 accepted growing the tail buffer just fine.


-- 
           Summary: [4.5 Regression] TCL is miscompiled
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


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

Reply via email to