From patchwork Tue Jan 27 04:07:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: DJ Delorie X-Patchwork-Id: 433182 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 4107C140272 for ; Tue, 27 Jan 2015 15:08:15 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :message-id:from:to:subject; q=dns; s=default; b=fLTzQCAV8I7pWrd N6J7AaIJPNWPDli4a6FpsQXHcc8AX9CNelYu34p1Q3iTod85bN79EOKEs3lzVx+R LLskbdQqbb5mzxflCmKD6D3TmldQDnXhSp9OP5JaP+B6lsoPTu8XcHW2rETZ8Ncu 7oOQq2VktJNCLyC+RLCdjQUUT+q0= 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:date :message-id:from:to:subject; s=default; bh=pUA7CbqEj0MMYdd1eTHQO LdNOAg=; b=IPxMi4s4NVPgS7ppfBiZ0cYolkcWIyiotDNdLAvasOaeHM/roUOTq trLV+/wfWlmf3prTcUySv5OJmwqfPCmCEwSthKX45agYzk/sQor4UJDd7STdzfNT /tsJDYvZe4LhfL3oWYnD6pyESbWl1qC5NYX3VUoef1qogLi8GXn0zc= Received: (qmail 10094 invoked by alias); 27 Jan 2015 04:08:06 -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 10083 invoked by uid 89); 27 Jan 2015 04:08:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 27 Jan 2015 04:08:03 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0R4812M032096 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 26 Jan 2015 23:08:01 -0500 Received: from greed.delorie.com (ovpn-113-24.phx2.redhat.com [10.3.113.24]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t0R480uP032593 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 26 Jan 2015 23:08:01 -0500 Received: from greed.delorie.com (greed.delorie.com [127.0.0.1]) by greed.delorie.com (8.14.4/8.14.4) with ESMTP id t0R47x3R017358 for ; Mon, 26 Jan 2015 23:07:59 -0500 Received: (from dj@localhost) by greed.delorie.com (8.14.4/8.14.4/Submit) id t0R47xHe017356; Mon, 26 Jan 2015 23:07:59 -0500 Date: Mon, 26 Jan 2015 23:07:59 -0500 Message-Id: <201501270407.t0R47xHe017356@greed.delorie.com> From: DJ Delorie To: gcc-patches@gcc.gnu.org Subject: [rl78] avoid move-elim on volatile mems X-IsSubscribed: yes See $subj. Committed. * config/rl78/rl78.c (move_elim_pass): Don't optimize away volatile memory references. Index: config/rl78/rl78.c =================================================================== --- config/rl78/rl78.c (revision 220150) +++ config/rl78/rl78.c (working copy) @@ -222,7 +222,12 @@ can eliminate the second SET. */ if (prev && rtx_equal_p (SET_DEST (prev), SET_SRC (set)) - && rtx_equal_p (SET_DEST (set), SET_SRC (prev))) + && rtx_equal_p (SET_DEST (set), SET_SRC (prev)) + /* ... and none of the operands are volatile. */ + && ! volatile_refs_p (SET_SRC (prev)) + && ! volatile_refs_p (SET_DEST (prev)) + && ! volatile_refs_p (SET_SRC (set)) + && ! volatile_refs_p (SET_DEST (set))) { if (dump_file) fprintf (dump_file, " Delete insn %d because it is redundant\n",