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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20111212-1.c] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
/* PR tree-optimization/50569 */
2
/* Reported by Paul Koning <pkoning@gcc.gnu.org> */
3
/* Reduced testcase by Mikael Pettersson <mikpe@it.uu.se> */
4
 
5
struct event {
6
    struct {
7
        unsigned int sec;
8
    } sent __attribute__((packed));
9
};
10
 
11
void __attribute__((noinline,noclone)) frob_entry(char *buf)
12
{
13
    struct event event;
14
 
15
    __builtin_memcpy(&event, buf, sizeof(event));
16
    if (event.sent.sec < 64) {
17
        event.sent.sec = -1U;
18
        __builtin_memcpy(buf, &event, sizeof(event));
19
    }
20
}
21
 
22
int main(void)
23
{
24
    union {
25
        char buf[1 + sizeof(struct event)];
26
        int align;
27
    } u;
28
 
29
    __builtin_memset(&u, 0, sizeof u);
30
 
31
    frob_entry(&u.buf[1]);
32
 
33
    return 0;
34
}

powered by: WebSVN 2.1.0

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