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 tree-optimization/42821] New: [4.5 Regression] TCL is miscompiled


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


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