From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31110 invoked by alias); 9 Feb 2010 08:58:24 -0000 Received: (qmail 31087 invoked by uid 48); 9 Feb 2010 08:58:14 -0000 Date: Tue, 09 Feb 2010 08:58:00 -0000 Message-ID: <20100209085814.31086.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/42722] move_by_pieces() incorrectly pushes structures to stack In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "mikpe at it dot uu dot se" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-02/txt/msg00787.txt.bz2 ------- Comment #10 from mikpe at it dot uu dot se 2010-02-09 08:58 ------- (In reply to comment #9) > Finally, the m32c port defines both PUSH_ARGS and HAVE_POST_INCREMENT, so it > can be possible to reproduce the bug on this port. > cat pr42722.c struct test { int a, b, c, d; }; void func2(struct test copy); void func1(struct test copy) {func2(copy);} > m32c-unknown-elf-gcc -Os -S pr42722.c > cat pr42722.s .file "pr42722.c" .text .global _func1 .type _func1, @function _func1: enter #0 push.w 11[fb] push.w 9[fb] push.w 7[fb] push.w 5[fb] jsr.a _func2 add.w #8,sp exitd .size _func1, .-_func1 .ident "GCC: (GNU) 4.4.3" which looks correct to me (not knowing m32c asm at all). With a larger struct gcc generates a memcpy() call instead. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42722