From patchwork Sun Oct 19 20:38:32 2014 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: 400886 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 318B814008C for ; Mon, 20 Oct 2014 07:35:50 +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=QAPa6++RkwxSQpKD2fO/+/jJsoe9V9Scp6gJ1qdh1Gw uRj8182Mqlh0S8/wZnYjoN5/8GCVnN5oB2/xXvLnzz10fe6UTZaPKALLEkqdTJ4H xON+dSGyS2tmEuHeT/sJSeEYQHYU002Ud4QixUIC30nGNhoP6teFXukpMeFVMEII = 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=85XCUfkt4D6GHeCXwPDXC9R8D98=; b=gY4c5SoWYAyZsSPt9 QHPGyh+ugoXCSjEY14/h+9FVa0quG7H6DdoKJqcq+jnDv+gkG/I1M1K2o2vRH/Iz 6VJxMnLbrg2D1NgVbL9eq7HIsKeIlX4/hCPFj9cx9o10ezg1I5hQ+aRgVVyBWvao 8KCQO+JVrQ6eXh8+/20JWaIXh0= Received: (qmail 25397 invoked by alias); 19 Oct 2014 20:35:44 -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 25382 invoked by uid 89); 19 Oct 2014 20:35:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients 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; Sun, 19 Oct 2014 20:35:42 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 0279EAB08; Sun, 19 Oct 2014 20:35:39 +0000 (UTC) Message-ID: <54442148.2070108@suse.cz> Date: Sun, 19 Oct 2014 22:38:32 +0200 From: =?UTF-8?B?TWFydGluIExpxaFrYQ==?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: GCC Patches CC: pinskia@gcc.gnu.org, "hubi >> Jan Hubicka" Subject: [PATCH] Fix for PR63583 X-IsSubscribed: yes Hello. I added missing gimple_asm_string comparison for a function with an asm statement. Bootstrap and regression tests still running, ready for trunk after it finishes? Thank you, Martin gcc/ChangeLog: 2014-10-19 Martin Liska * ipa-icf-gimple.c (func_checker::compare_gimple_asm): Gimple tempate string is compared. gcc/testsuite/ChangeLog: 2014-10-19 Martin Liska * gcc.dg/ipa/pr63595.c: New test. diff --git a/gcc/ipa-icf-gimple.c b/gcc/ipa-icf-gimple.c index 792a3e4..1369b74 100644 --- a/gcc/ipa-icf-gimple.c +++ b/gcc/ipa-icf-gimple.c @@ -863,6 +863,9 @@ func_checker::compare_gimple_asm (gimple g1, gimple g2) if (gimple_asm_nclobbers (g1) != gimple_asm_nclobbers (g2)) return false; + if (strcmp (gimple_asm_string (g1), gimple_asm_string (g2)) != 0) + return return_false_with_msg ("ASM strings are different"); + for (unsigned i = 0; i < gimple_asm_ninputs (g1); i++) { tree input1 = gimple_asm_input_op (g1, i); diff --git a/gcc/testsuite/gcc.dg/ipa/pr63595.c b/gcc/testsuite/gcc.dg/ipa/pr63595.c new file mode 100644 index 0000000..9c9f3bf --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/pr63595.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-ipa-icf-details" } */ + +static int f(int t) __attribute__((noinline)); + +static int g(int t) __attribute__((noinline)); +static int g(int t) +{ + asm("addl %0, 1": "+r"(t)); + return t; +} +static int f(int t) +{ + asm("addq %0, -1": "+r"(t)); + return t; +} + + +int h(int t) +{ + return f(t) + g(t); +} + +/* { dg-final { scan-ipa-dump "ASM strings are different" "icf" } } */ +/* { dg-final { scan-ipa-dump "Equal symbols: 0" "icf" } } */ +/* { dg-final { cleanup-ipa-dump "icf" } } */