From patchwork Thu Jan 15 17:23:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 429535 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 516B01400EA for ; Fri, 16 Jan 2015 04:23:28 +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 :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=QpUqdwWcTPL0+T6iouLhXYKj+ZTzOAj2CtocaOsnqCb TieWp0D/Vlx6ZOSW3SGXS+4Mt9EB3JjVhZ+eT5NDVoJyPhuyHID6kFmeE+Pi1SJt cUmO+1oPqJShXYZwzpsJ6WfuWHwYxnMB33imsUmG4YWYw/J8jFCmlO56+fTMbruA = 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 :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=cadxNbbLmaAxIWWr6E67F6kvk3A=; b=tNTxws1sFx00jsLLJ 5nTXrrPgy1sfWtRWV5x+bo0VqSRprHoWIk6SqukWTwFSGTHl+DfLx1/24hlkNm0R PgAq62yWgoVkt1q/xI14y8heThoGdFYLsMjKQ1O6Db5+74ExRn2mF7z11xjlPRfO Z0laPOmmlypsIwrMm4Oe0CxBX0= Received: (qmail 30679 invoked by alias); 15 Jan 2015 17:23:21 -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 30668 invoked by uid 89); 15 Jan 2015 17:23:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL, BAYES_00 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, 15 Jan 2015 17:23:17 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 63EC1AAC5; Thu, 15 Jan 2015 17:23:14 +0000 (UTC) Message-ID: <54B7F782.4020405@suse.cz> Date: Thu, 15 Jan 2015 18:23:14 +0100 From: =?UTF-8?B?TWFydGluIExpxaFrYQ==?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: GCC Patches CC: "hubick >> Jan Hubicka" Subject: [PATCH] Fix PR64068 and PR64559 X-IsSubscribed: yes Hello. This is Honsa's patch that I've just tested on x86_64-linux-pc. The patch is preapproved by Honza and is going to be installed. Thanks, Martin From 84b6878f168802516febfbd00252f56f965b9666 Mon Sep 17 00:00:00 2001 From: mliska Date: Thu, 15 Jan 2015 17:20:00 +0100 Subject: [PATCH] Fix for PR64068 and PR64559. gcc/testsuite/ChangeLog: 2015-01-15 Martin Liska * g++.dg/ipa/pr64068.C: New test. * gcc.dg/ipa/PR64559.c: New test. gcc/ChangeLog: 2015-01-15 Jan Hubicka PR ipa/64068 PR ipa/64559 * ipa.c (symbol_table::remove_unreachable_nodes): Do not put abstract origins into boundary. --- gcc/ipa.c | 1 - gcc/testsuite/g++.dg/ipa/pr64068.C | 49 ++++++++++++++++++++++++++++++++++++++ gcc/testsuite/gcc.dg/ipa/PR64559.c | 39 ++++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/ipa/pr64068.C create mode 100644 gcc/testsuite/gcc.dg/ipa/PR64559.c diff --git a/gcc/ipa.c b/gcc/ipa.c index df96515..3626417 100644 --- a/gcc/ipa.c +++ b/gcc/ipa.c @@ -400,7 +400,6 @@ symbol_table::remove_unreachable_nodes (FILE *file) n = n->next_sibling_clone) if (n->decl == DECL_ABSTRACT_ORIGIN (node->decl)) n->used_as_abstract_origin = true; - enqueue_node (origin_node, &first, &reachable); } } /* If any symbol in a comdat group is reachable, force diff --git a/gcc/testsuite/g++.dg/ipa/pr64068.C b/gcc/testsuite/g++.dg/ipa/pr64068.C new file mode 100644 index 0000000..9528883 --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr64068.C @@ -0,0 +1,49 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +typedef int PROV_ENUMALGS_EX, PCCRYPT_OID_INFO; +class A { + int m_fn2(); + virtual bool m_fn1(PCCRYPT_OID_INFO); +}; +int fn1(); +void fn2(); +int A::m_fn2() { m_fn1(0); } + +bool fn3() { + for (;;) { + if (fn1()) { + if (fn1() != 259) + fn2(); + break; + } + return 1; + } + return 0; +} + +class B { +public: + B() { fn3(); } +}; +class C : A { + bool m_fn1(PCCRYPT_OID_INFO) { m_fn3(); } + int isSupportedByProvider_algId; + PROV_ENUMALGS_EX isSupportedByProvider_outEnumAlgs; + PROV_ENUMALGS_EX isSupportedByProvider_enumAlgs; + bool m_fn3() { + while (1) { + if (fn1()) { + if (fn1() != 259) + fn2(); + break; + } + if (isSupportedByProvider_algId) + isSupportedByProvider_outEnumAlgs = isSupportedByProvider_enumAlgs; + return 1; + } + return 0; + } +}; + +void fn4() { B(); } diff --git a/gcc/testsuite/gcc.dg/ipa/PR64559.c b/gcc/testsuite/gcc.dg/ipa/PR64559.c new file mode 100644 index 0000000..463afdc --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/PR64559.c @@ -0,0 +1,39 @@ +/* { dg-do compile } */ +/* { dg-options "-Os" } */ + +int a, b, c, d; + +struct S +{ + int f0; +}; + +static int +fn1 (int p) +{ + return p == 0 || a; +} + +static int +fn2 () +{ + d = fn1 (c); + return 0; +} + +static int +fn3 (struct S p) +{ + p.f0 || fn2 (); + if (fn1 (1)) + b = 0; + return 0; +} + +int +main () +{ + struct S e = { 1 }; + fn3 (e); + return 0; +} -- 2.1.2