From patchwork Thu Jun 25 13:21:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 488453 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 D55021402EC for ; Thu, 25 Jun 2015 23:22:09 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=TpTYq7CV; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=CgHvX45Si9Iw+fy3dR6jQUWIhHOMEIBStKoIymm1AHVMNmkf0TGUE YEOEwraJCldevvNRsNwZVORcBHaQA//2h4Yhd6tSMFb8LtEIwvoWVyvdZJ2PZBl6 2THALfryoJcSoWQIUxwd/Dxb8L95AaftMw3dyEm0eU/2zifysNjils= 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 :from:to:subject:message-id:mime-version:content-type; s= default; bh=eUrVzyjC1J+8Tgr+E6IUd5hxoXw=; b=TpTYq7CVZjrH8upQMCKH 63qHTAFm7JBF3uZY8j5bjJL9hrwJyBcyTyaWDxS9gPB0TBn5b55GOcvsPZOa0UZ5 4njXQ7G6hwv4LQWHNza5/ipK4tRNr1caPn0JhfE5F3dWTEMRy2ZvhqTDGQe9TmWL DutGxKD1Zu12xlOCfs9qViY= Received: (qmail 99365 invoked by alias); 25 Jun 2015 13:22:02 -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 99344 invoked by uid 89); 25 Jun 2015 13:22:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Thu, 25 Jun 2015 13:22:00 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 2F6DAABF2 for ; Thu, 25 Jun 2015 13:21:57 +0000 (UTC) Date: Thu, 25 Jun 2015 15:21:57 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH][3/n] Remove GENERIC stmt combining from SCCVN Message-ID: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 This allows (p + 1) + 2 to be combined to p + 3 (also a good sign on why that single_use stuff is "bad" - bad in case we have restricted simplifications to a single stmt as result anyway). This shows up in gcc.dg/20020415-1.c (and more places) Bootstrap and regtest running on x86_64-unknown-linux-gnu. Richard. 2015-06-25 Richard Biener * match.pd: Allow (p +p off1) +p off2 to (p +p (off1 + off2)) irrespective on whether the inner operation has a single use of both off are constant. Index: gcc/match.pd =================================================================== --- gcc/match.pd (revision 224893) +++ gcc/match.pd (working copy) @@ -503,7 +520,8 @@ (define_operator_list swapped_tcc_compar /* Associate (p +p off1) +p off2 as (p +p (off1 + off2)). */ (simplify (pointer_plus (pointer_plus@2 @0 @1) @3) - (if (single_use (@2)) + (if (single_use (@2) + || (TREE_CODE (@1) == INTEGER_CST && TREE_CODE (@3) == INTEGER_CST)) (pointer_plus @0 (plus @1 @3)))) /* Pattern match