From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14344 invoked by alias); 31 May 2014 12:11:45 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 14327 invoked by uid 89); 31 May 2014 12:11:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: mail-out.m-online.net Received: from mail-out.m-online.net (HELO mail-out.m-online.net) (212.18.0.9) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Sat, 31 May 2014 12:11:43 +0000 Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3gghMc1pWXz3hhTd for ; Sat, 31 May 2014 14:11:39 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3gghMb6N0bzbbtM for ; Sat, 31 May 2014 14:11:39 +0200 (CEST) Received: from mail.mnet-online.de ([192.168.8.180]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id K-mY3hb5xQya for ; Sat, 31 May 2014 14:11:39 +0200 (CEST) X-Auth-Info: iWxRYSXhSELwYCRxVDBueHXa4b6m/OefaIW6d7CIOj0= Received: from igel.home (ppp-93-104-159-37.dynamic.mnet-online.de [93.104.159.37]) by mail.mnet-online.de (Postfix) with ESMTPA for ; Sat, 31 May 2014 14:11:39 +0200 (CEST) Received: by igel.home (Postfix, from userid 1000) id D4BF82C16EA; Sat, 31 May 2014 14:11:38 +0200 (CEST) From: Andreas Schwab To: gcc-patches@gcc.gnu.org Subject: [PATCH] m68k: add missing early clobber in beq0_di, bne0_di patterns X-Yow: If Robert Di Niro assassinates Walter Slezak, will Jodie Foster marry Bonzo?? Date: Sat, 31 May 2014 12:11:00 -0000 Message-ID: <871tvagnb9.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2014-05/txt/msg02687.txt.bz2 This is a wrong code bug that appeared in netcdf when compiling with gcc 4.8. Due to difference in register allocation this doesn't trigger in 4.9 or trunk, but it is obvious that the bug is only dormant. The issue is that if the first operand matches "o" it may contain the same register as operand 2 as part of the address. Clearly the register overlap checks only make sense if the first operand matches "d". So for an "o" operand we need to mark the scratch register as early clobber. Bootstrapped on m68k-suse-linux and installed in trunk. Andreas. * config/m68k/m68k.md (beq0_di, bne0_di): Make the "o" constraint a separate alternative where the scratch operand 2 is marked as early clobber. --- gcc/config/m68k/m68k.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md index c4ebb0e..9729624 100644 --- a/gcc/config/m68k/m68k.md +++ b/gcc/config/m68k/m68k.md @@ -5961,15 +5961,15 @@ (define_insn "beq0_di" [(set (pc) - (if_then_else (eq (match_operand:DI 0 "general_operand" "d*ao,<>") + (if_then_else (eq (match_operand:DI 0 "general_operand" "d*a,o,<>") (const_int 0)) - (label_ref (match_operand 1 "" ",")) + (label_ref (match_operand 1 "" ",,")) (pc))) - (clobber (match_scratch:SI 2 "=d,d"))] + (clobber (match_scratch:SI 2 "=d,&d,d"))] "" { CC_STATUS_INIT; - if (which_alternative == 1) + if (which_alternative == 2) return "move%.l %0,%2\;or%.l %0,%2\;jeq %l1"; if ((cc_prev_status.value1 && rtx_equal_p (cc_prev_status.value1, operands[0])) @@ -6006,11 +6006,11 @@ (define_insn "bne0_di" [(set (pc) - (if_then_else (ne (match_operand:DI 0 "general_operand" "do,*a") + (if_then_else (ne (match_operand:DI 0 "general_operand" "d,o,*a") (const_int 0)) - (label_ref (match_operand 1 "" ",")) + (label_ref (match_operand 1 "" ",,")) (pc))) - (clobber (match_scratch:SI 2 "=d,X"))] + (clobber (match_scratch:SI 2 "=d,&d,X"))] "" { if ((cc_prev_status.value1 -- 2.0.0 -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."