c/4417: struct copy calls memcpy with -ffreestanding

robertlipe@usa.net robertlipe@usa.net
Fri Sep 28 07:06:00 GMT 2001


>Number:         4417
>Category:       c
>Synopsis:       struct copy calls memcpy with -ffreestanding
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 28 07:06:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Robert Lipe
>Release:        3.0.1
>Organization:
>Environment:
Any IA32 target, from what I can tell.
>Description:
-freestanding will, under some conditions, generate a call to 
memcpy behind the back of the user.  This defeats the point of 
that flag
>How-To-Repeat:
typedef struct foo{
        char blah[1024];
} foo_t;
 
extern foo_t one, two;
 
void
foo(void)
{
        one = two;
}


$ cc -ffreestanding -O3 -S -o - a.c | grep memcpy
        call    memcpy

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list