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] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* PR middle-end/38454 */
2
/* { dg-do compile } */
3
/* { dg-options "-O2" } */
4
 
5
typedef __SIZE_TYPE__ size_t;
6
 
7
extern inline __attribute__((gnu_inline, always_inline, artificial)) void *
8
memcpy (void *__restrict dest, const void *__restrict src, size_t len)
9
{
10
  return __builtin___memcpy_chk (dest, /* { dg-warning "will always overflow destination buffer" } */
11
                                 src, len, __builtin_object_size (dest, 0));
12
}
13
 
14
struct S { char buf[10]; } s;
15
 
16
void
17
foo (void)
18
{
19
  char buf[12];
20
  char *p = buf + 4;
21
  struct S *q = (struct S *) p;
22
  memcpy (q, &s, sizeof (s));
23
}
24
 
25
/* { dg-final { scan-assembler "__memcpy_chk" } } */

powered by: WebSVN 2.1.0

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