From patchwork Sat Sep 20 16:32:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: FX Coudert X-Patchwork-Id: 391510 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4196D140189 for ; Sun, 21 Sep 2014 02:32:28 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:message-id:mime-version:subject:date:references:to :in-reply-to; q=dns; s=default; b=Viu0Evo0rXecBddmJxgq7/bIszLpv+ OoZ7NS55tpR79aEqpyAmDMXGu5EC+/2q6EFT6djsAz90M1i3VVtb5MwNbhmx4qBt 9Xn2lOS6tf8Tt24rzeyHyyp/iU/oy663HhttI/fZ/rIQlqjf9zcB1gSQnY448+G1 OCg50FXyhKqLI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:message-id:mime-version:subject:date:references:to :in-reply-to; s=default; bh=yFXHirMvSAYQafBLB/q9pfCQayQ=; b=J2kP 9DhFpmSMpeyQXhCZ5JsCylHcTr3lsOg1A46g8oYyZivyOAqMsBSRixzplfo5HMOk RBeMs/YcoNN/Y0+3MpCc36DOix7J7ybHyultSP97ucNjePIszzKHsfd/qvON2xLT UmgM2bP/KL+khT2prpX0wTCrMNOxgH1GiGX8xFI= Received: (qmail 2453 invoked by alias); 20 Sep 2014 16:32:22 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 2442 invoked by uid 89); 20 Sep 2014 16:32:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-we0-f173.google.com Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com) (74.125.82.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 20 Sep 2014 16:32:21 +0000 Received: by mail-we0-f173.google.com with SMTP id q58so1053242wes.32 for ; Sat, 20 Sep 2014 09:32:18 -0700 (PDT) X-Received: by 10.180.210.201 with SMTP id mw9mr4181698wic.35.1411230738005; Sat, 20 Sep 2014 09:32:18 -0700 (PDT) Received: from touille.bouyguesbox.fr (89-93-42-249.hfc.dyn.abo.bbox.fr. [89.93.42.249]) by mx.google.com with ESMTPSA id mz16sm5872997wic.13.2014.09.20.09.32.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 20 Sep 2014 09:32:17 -0700 (PDT) From: FX Message-Id: Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1985.3\)) Subject: Re: [patch i386]: Sibcall tail-call improvement and partial fix PR/60104 Date: Sat, 20 Sep 2014 18:32:16 +0200 References: <1478265243.5697739.1400792508558.JavaMail.zimbra@redhat.com> <20140915004309.GA29543@gate.crashing.org> <95EF5F55-098D-49F3-B6E6-79C1316D5148@comcast.net> <541708CF.2000708@redhat.com> <52368B3D-91AD-44CC-B451-9BEC03189625@gmail.com> <99F31408-76FF-4A10-8223-1BDE6EA981BB@gmail.com> To: Kai Tietz , Jeff Law , Iain Sandoe , Mike Stump , Kai Tietz , GCC Patches , Richard Henderson , hubicka@ucw.cz, Uros Bizjak In-Reply-To: <99F31408-76FF-4A10-8223-1BDE6EA981BB@gmail.com> > The patch you sent (copied below) does not fix the darwin regression. It still fails with the same ICE on attached valid code (in 64-bit mode; it compiles with -m32). The proposed patch by Iain’s patch (https://gcc.gnu.org/ml/gcc-patches/2014-09/msg01141.html and attached), which Mike seconds, fixes the issue. See the testresults I posted here: https://gcc.gnu.org/ml/gcc-testresults/2014-09/msg01449.html (without the patch, there are 900+ testsuite failures) Could one of the maintainers (i386 or global) review it, please? FX Index: gcc/config/i386/i386.c =================================================================== --- gcc/config/i386/i386.c (revision 215419) +++ gcc/config/i386/i386.c (working copy) @@ -38968,9 +38968,11 @@ x86_output_mi_thunk (FILE *file, tree, H { if (sibcall_insn_operand (fnaddr, word_mode)) { - tmp = gen_rtx_CALL (VOIDmode, fnaddr, const0_rtx); - tmp = emit_call_insn (tmp); - SIBLING_CALL_P (tmp) = 1; + fnaddr = XEXP (DECL_RTL (function), 0); + tmp = gen_rtx_MEM (QImode, fnaddr); + tmp = gen_rtx_CALL (VOIDmode, tmp, const0_rtx); + tmp = emit_call_insn (tmp); + SIBLING_CALL_P (tmp) = 1; } else emit_jump_insn (gen_indirect_jump (fnaddr));