From mboxrd@z Thu Jan 1 00:00:00 1970 From: robertlipe@usa.net To: gcc-gnats@gcc.gnu.org Subject: c/4417: struct copy calls memcpy with -ffreestanding Date: Fri, 28 Sep 2001 07:06:00 -0000 Message-id: <20010928135927.19545.qmail@sourceware.cygnus.com> X-SW-Source: 2001-09/msg00534.html List-Id: >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: