From patchwork Thu Nov 26 11:49:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 549027 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 695961402C4 for ; Thu, 26 Nov 2015 22:49:53 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=nf76amkv; 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=Zp+j1aN0xBjgDOz0byrurmmO4tI4qfHe34nkjiaj3XcqOcgjFXav6 PYNtJydef9srV0UE6WqMjsQuNSoIDM4OLKA5v25Oy0I1FM/I1LwJXJxspo/P1VF6 oBPYOYW3SbJuP6+K1zNFNxFaJnrpIFrZn70WqfAkNSQjM6XtKvicRM= 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=2fl7mkvi6cM6wn/hSgGQzYqNsCk=; b=nf76amkvDuKc89vOdWOB kxfcyOPEoN554xPVWjstkU+HL2dcGdPUW11vn+hye7aGUSx1SZSMFMGzDN/Wx92X RzKlJNJ94SxQi8kPuj2ncDMVEc5yX6bc+hMchUtNr0AvNl3sQVGmmOa4qC59Q6Af r1un+LfK0JyN0ko7DQ9nHi4= Received: (qmail 91174 invoked by alias); 26 Nov 2015 11:49:43 -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 91163 invoked by uid 89); 26 Nov 2015 11:49:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from mx2.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, 26 Nov 2015 11:49:39 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id E43CAAAB2 for ; Thu, 26 Nov 2015 11:47:56 +0000 (UTC) Date: Thu, 26 Nov 2015 12:49:36 +0100 (CET) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix PR67203 Message-ID: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 This fixes the g++.dg/tree-ssa/pr61034.C to make the expected result dependent on PUSH_ARGS_REVERSED (via an explicit list of targets). With swapping the final cd_dce and dse passes I get all targets to produce zero 'free' calls in .optimized but that doesn't sound appropriate at this stage. And instead of swapping order DSE and DCE should be merged. I'll see what I can do for next stage1 or maybe this is an interesting GSoC project as well. Tested on x86_64, applied. Richard. 2015-11-26 Richard Biener PR testsuite/67203 * g++.dg/tree-ssa/pr61034.C: Make expected optimization result dependent on PUSH_ARGS_REVERSED. Drop optimization level and also monitor final optimization result. Index: gcc/testsuite/g++.dg/tree-ssa/pr61034.C =================================================================== --- gcc/testsuite/g++.dg/tree-ssa/pr61034.C (revision 230925) +++ gcc/testsuite/g++.dg/tree-ssa/pr61034.C (working copy) @@ -1,5 +1,5 @@ // { dg-do compile } -// { dg-options "-O3 -fdump-tree-fre2" } +// { dg-options "-O2 -fdump-tree-fre2 -fdump-tree-optimized" } #define assume(x) if(!(x))__builtin_unreachable() @@ -43,5 +43,12 @@ bool f(I a, I b, I c, I d) { // This works only if everything is inlined into 'f'. // { dg-final { scan-tree-dump-times ";; Function" 1 "fre2" } } -// { dg-final { scan-tree-dump-times "free" 10 "fre2" } } // { dg-final { scan-tree-dump-times "unreachable" 11 "fre2" } } + +// Note that depending on PUSH_ARGS_REVERSED we are presented with +// a different initial CFG and thus the final outcome is different + +// { dg-final { scan-tree-dump-times "free" 10 "fre2" { target x86_64-*-* i?86-*-* } } } +// { dg-final { scan-tree-dump-times "free" 3 "optimized" { target x86_64-*-* i?86-*-* } } } +// { dg-final { scan-tree-dump-times "free" 14 "fre2" { target aarch64-*-* ia64-*-* arm-*-* hppa*-*-* sparc*-*-* powerpc*-*-* } } } +// { dg-final { scan-tree-dump-times "free" 4 "optimized" { target aarch64-*-* ia64-*-* arm-*-* hppa*-*-* sparc*-*-* powerpc*-*-* } } }