From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 568 invoked by alias); 5 Nov 2002 16:05:53 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 549 invoked by uid 61); 5 Nov 2002 16:05:53 -0000 Date: Tue, 05 Nov 2002 08:05:00 -0000 Message-ID: <20021105160553.548.qmail@sources.redhat.com> To: awk@localhost.localdomain, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org From: bangerth@dealii.org Reply-To: bangerth@dealii.org, awk@localhost.localdomain, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c/5351: function pass-by-value structure copy corrupts structure on stack X-SW-Source: 2002-11/txt/msg00223.txt.bz2 List-Id: Synopsis: function pass-by-value structure copy corrupts structure on stack State-Changed-From-To: open->analyzed State-Changed-By: bangerth State-Changed-When: Tue Nov 5 08:05:52 2002 State-Changed-Why: I can reproduce this with 3.2.1pre, but it seems fixed in present CVS. However, since this is a regression w.r.t. 2.95, I leave it open and put it into "high". A reduced testcase is this: ---------------------------------- #include #include struct X { char s[100]; }; void foo(struct X x) { printf("x.s: %s\n", x.s); } int main() { struct X x; strcpy(x.s, "this is a test string"); foo(x); } ------------------------------------- With 3.2.1pre I get tmp/g> /home/bangerth/bin/gcc-3.2.1-pre/bin/gcc x.c tmp/g> ./a.out x.s: Äñÿ¿Ôa@st string This is not what I want to see. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5351