From patchwork Thu Oct 20 20:54:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 120874 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 667F5B71BE for ; Fri, 21 Oct 2011 07:55:08 +1100 (EST) Received: (qmail 3982 invoked by alias); 20 Oct 2011 20:55:06 -0000 Received: (qmail 3968 invoked by uid 22791); 20 Oct 2011 20:55:05 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, SPF_HELO_PASS 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; Thu, 20 Oct 2011 20:54:47 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9KKsl8w027259 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 20 Oct 2011 16:54:47 -0400 Received: from houston.quesejoda.com (vpn-238-107.phx2.redhat.com [10.3.238.107]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p9KKskoX010633; Thu, 20 Oct 2011 16:54:46 -0400 Message-ID: <4EA08A96.4070209@redhat.com> Date: Thu, 20 Oct 2011 15:54:46 -0500 From: Aldy Hernandez User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110927 Thunderbird/7.0 MIME-Version: 1.0 To: Andrew MacLeod , gcc-patches Subject: [cxx-mem-model] expand_atomic_load: Handle an empty target 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 Found this while testing the branch on ia64. The call to expand_val_compare_and_swap() above returns NULL_RTX when it can't find a suitable instruction. OK for branch? * optabs.c (expand_atomic_load): Handle a NULL target. Index: optabs.c =================================================================== --- optabs.c (revision 180273) +++ optabs.c (working copy) @@ -7140,7 +7140,7 @@ expand_atomic_load (rtx target, rtx mem, return target; } - if (target == const0_rtx) + if (!target || target == const0_rtx) target = gen_reg_rtx (mode); /* Emit the appropriate barrier before the load. */