From patchwork Mon Mar 25 11:24:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 230635 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id BE6D52C00A5 for ; Mon, 25 Mar 2013 22:24:56 +1100 (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 :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=txIaLXPczLcX+Dzl zV1EalAtUvHBQTF2s2/SsgZWVIyYe6VH+lBawWCK9KO1GERIAua/ol/hBLSFlENe 0jwWneePAmPNWPCgtb8YLCginUFA0OH06q902kH+KR+//bTVwFz7w2zRWRL3mCBP zFECC/i/tqu5iz4iBAm9gCcCviY= 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 :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=EyZn6zr+xE3FT8aqWCoLI9 TjZG0=; b=hfHVxzNFdwFwMzXcl35OSngok5qJ/Oh5L3WHsOnPFKYLzmHiIwypoZ H0zu9YPAWbMHbv/OZ57/EXMZTXvnotGKKK1Cz9eaZOhjYqyM1eorYBGe6vlPDNWf Ld64jlvu47EFyYrb4acfTv80SvJWLGwtgdytanBWKs/PP5Tye7fLs= Received: (qmail 29624 invoked by alias); 25 Mar 2013 11:24:47 -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 29599 invoked by uid 89); 25 Mar 2013 11:24:40 -0000 X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.1 Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 25 Mar 2013 11:24:37 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 9667D290041 for ; Mon, 25 Mar 2013 12:24:34 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ootM1wsTRjpR for ; Mon, 25 Mar 2013 12:24:34 +0100 (CET) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 607C6290023 for ; Mon, 25 Mar 2013 12:24:34 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: Fix bug with simple returns on cc0 targets Date: Mon, 25 Mar 2013 12:24:15 +0100 Message-ID: <1575965.2NCIYs47i8@polaris> User-Agent: KMail/4.7.2 (Linux/3.1.10-1.19-desktop; KDE/4.7.2; x86_64; ; ) MIME-Version: 1.0 X-Virus-Found: No Hi, for a private port which both is a cc0 target and has conditional returns, emit_use_return_register_into_block will try to emit the use return register sequence between a cc0 setter and a cc0 user. Fixed thusly, tested on x86_64-suse-linux, applied on the mainline. 2013-03-25 Eric Botcazou * function.c (emit_use_return_register_into_block): On cc0 targets, do not emit the sequence between cc0 setter and user. Index: function.c =================================================================== --- function.c (revision 197003) +++ function.c (working copy) @@ -5598,12 +5598,17 @@ prepare_shrink_wrap (basic_block entry_b static void emit_use_return_register_into_block (basic_block bb) { - rtx seq; + rtx seq, insn; start_sequence (); use_return_register (); seq = get_insns (); end_sequence (); - emit_insn_before (seq, BB_END (bb)); + insn = BB_END (bb); +#ifdef HAVE_cc0 + if (reg_mentioned_p (cc0_rtx, PATTERN (insn))) + insn = prev_cc0_setter (insn); +#endif + emit_insn_before (seq, insn); }