From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127446 invoked by alias); 4 Jul 2015 02:17:32 -0000 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 Received: (qmail 127392 invoked by uid 48); 4 Jul 2015 02:17:28 -0000 From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/66754] [4.9/5/6] gcc.dg/builtin-apply2.c aborts with -m32 -mregparm=3 or -miamcu Date: Sat, 04 Jul 2015 02:17:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 6.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-07/txt/msg00310.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66754 --- Comment #4 from H.J. Lu --- Doc says: Using the built-in functions described below, you can record the arguments a function received, and call another function with the same arguments, without knowing the number or types of the arguments. You can also record the return value of that function call, and later return that value, without knowing what data type the function tried to return (as long as your caller expects that data type). However, these built-in functions may interact badly with some sophisticated features or other extensions of the language. It is, therefore, not recommended to use them outside very simple functions acting as mere forwarders for their arguments. We have extern void foo (char *name, double d, double e, double f, int g); void bar (char *name, ...) { __builtin_apply(foo, __builtin_apply_args(), 64); } calling foo with bar's arguments won't work for IA MCU since all bar's arguments are passed on stack and some foo's arguments are passed in registers.