From patchwork Sat May 31 12:11:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 354447 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 06B5E1400A3 for ; Sat, 31 May 2014 22:11:53 +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 :to:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=mbkTb23IJDqA2f8jFyh4PSKToyNbZFmArR0VlPqsu+BJgTsArMwed RkOOqydDs+Tl84a3cSIaNI3LT93oCmBZXTmW8aB0AtgDqdFKLvEAL+ExhdHi1by2 /eyHeZ+E7IQhxDQzerRG6pQ82wdaAWnJjPeiXh0Yb+wQ9tIDNPKd0c= 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; s= default; bh=6O+DfeJfaSiHEJWMqRlprSwdUjI=; b=VmIxLKdgWjsAt+q+Gkvj diVV1vgd80sZuVeeqppGwlX31le3GTvDxqp9NEiYR5xE/E6jLoiwVkjSAMCcoWjg VpqS8HltYFQVpFIgL2Fj+GGKRrQCcJe2BWCiQSKKFqnnYxPLkBFIkrcIySKh4jDG TXQpvahdA0VOwdZHOCcFQh0= 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-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 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 14:11:38 +0200 Message-ID: <871tvagnb9.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.91 (gnu/linux) MIME-Version: 1.0 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