From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24500 invoked by alias); 9 Jan 2011 18:22:10 -0000 Received: (qmail 24491 invoked by uid 22791); 9 Jan 2011 18:22:10 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 09 Jan 2011 18:22:05 +0000 From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/47237] New: builtin_apply_args broken WRT local API changes. X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Sun, 09 Jan 2011 18:28:00 -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 X-SW-Source: 2011-01/txt/msg00837.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47237 Summary: builtin_apply_args broken WRT local API changes. Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned@gcc.gnu.org ReportedBy: hubicka@gcc.gnu.org #define INTEGER_ARG 5 extern void abort(void); static void foo(int arg) { if (arg != INTEGER_ARG) abort(); } static void bar(int arg) { foo(arg); __builtin_apply(foo, __builtin_apply_args(), 16); } int main(void) { bar(INTEGER_ARG); return 0; } fails at 32bit. The problem is that we call bar with register calling conventions, while foo's calling conventions are default. We must prevent any call conventions changes on functions calling builtlin_apply. This is not only case where builtin_apply_args breaks, since we will happily clone the functions, too. I guess in addition to inlinable and cloning flag, we need flag whether function calling convention can change. In what conditions this is false in addition to apply_args? This bug probably exists since GCC 3.4. I tested 4.3 and 4.5 to fail.