From patchwork Tue Jan 24 17:49:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 137605 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]) by ozlabs.org (Postfix) with SMTP id 4437BB6EE8 for ; Wed, 25 Jan 2012 04:49:24 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1328032165; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=gEIL4nE +vr97LP0utRH+aPA97uU=; b=v8lVHimWymCFITuT8RdOjy1KwkAZVyRdUsKQ1z8 kBUBh5Lev9qjp3C5W0gOjxKz/ac2IR81VomHC+IiL++9NJIy6dQI6obiBaRv7rvT Xyppaz167OQC66Xe2CuCx6CK5Q3uaRzXZuG8X0iZJaGYd76QmcJRWz/01e3w/ays 9gSg= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=o9rGwpRRTOyCPJq/p/VpV1hw4jCB1xzUjSGhhpxfOIgCLjOuX38Bbp/xI4P7Vz n2T/TeAn3Uz9W1tjiJed0a0a3x0Px9jHWjT/Z3mDLb2vM7NyxJTldjjIPU/bmMgj Lg2VjM2tbdxUCvAEMOgpFFrvF7YPIK7yTtoaGpIj/6G50=; Received: (qmail 26638 invoked by alias); 24 Jan 2012 17:49:21 -0000 Received: (qmail 26626 invoked by uid 22791); 24 Jan 2012 17:49:20 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 24 Jan 2012 17:49:03 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0OHn3ha032654 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 24 Jan 2012 12:49:03 -0500 Received: from pebble.twiddle.net (vpn1-50-183.bne.redhat.com [10.64.50.183]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q0OHn1NE021240 for ; Tue, 24 Jan 2012 12:49:02 -0500 Message-ID: <4F1EEF0D.9080400@redhat.com> Date: Wed, 25 Jan 2012 04:49:01 +1100 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: GCC Patches Subject: sparc: fix v7 memory barrier handling X-IsSubscribed: yes 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 While investigating atomic-test-and-set problems, I found that sparc v7 wasn't matching the memory barrier as desired. The problem turned out to be that the lack of a match_code containing const_int meant that genpreds generated the wrong mode test within the predicate. Which meant that no values matched, instead of all values. Tested along side patches to come. Committed. r~ * config/sparc/predicates.md (zero_or_v7_operand): Use match_code. diff --git a/gcc/config/sparc/predicates.md b/gcc/config/sparc/predicates.md index 81e5320..308fbd6 100644 --- a/gcc/config/sparc/predicates.md +++ b/gcc/config/sparc/predicates.md @@ -1,5 +1,5 @@ ;; Predicate definitions for SPARC. -;; Copyright (C) 2005, 2007, 2008, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2005, 2007, 2008, 2010, 2012 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; @@ -113,8 +113,9 @@ ;; Return true if OP is Zero, or if the target is V7. (define_predicate "zero_or_v7_operand" - (ior (match_test "op == const0_rtx") - (match_test "!TARGET_V8 && !TARGET_V9"))) + (and (match_code "const_int") + (ior (match_test "INTVAL (op) == 0") + (match_test "!TARGET_V8 && !TARGET_V9")))) ;; Predicates for symbolic constants.