OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [memcpy-2.c] - Rev 298

Compare with Previous | Blame | View Log

/* PR middle-end/38454 */
/* { dg-do compile } */
/* { dg-options "-O2" } */
 
typedef __SIZE_TYPE__ size_t;
 
extern inline __attribute__((gnu_inline, always_inline, artificial)) void *
memcpy (void *__restrict dest, const void *__restrict src, size_t len)
{
  return __builtin___memcpy_chk (dest, /* { dg-warning "will always overflow destination buffer" } */
				 src, len, __builtin_object_size (dest, 0));
}
 
struct S { char buf[10]; } s;
 
void
foo (void)
{
  char buf[12];
  char *p = buf + 4;
  struct S *q = (struct S *) p;
  memcpy (q, &s, sizeof (s));
}
 
/* { dg-final { scan-assembler "__memcpy_chk" } } */
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.