From patchwork Sat Aug 31 14:30:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 271536 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "www.sourceware.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 9B53F2C00B1 for ; Sun, 1 Sep 2013 00:30:15 +1000 (EST) 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=vofHKCDvzfSe4+im3H0B5Xj2Wq0hlOtoOFVQKq0pmw4g7ftrAgB+k 9tQZMOBuO1e00wU5KieovYJcN4mUhB6npK7x7oomOsbKKFC8g6Ap04LeBemsBAVW FxAA6q0IWK2cTwCCLubXNQtSLCFntEo5/oAVbOlJsYk1+NdUxCIvNk= 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=V7YoeunDuHxYXfNhrkVAiwzn+1U=; b=gHf3iAnja9UCXidqbl3g W+86bgcNJ6jz2PoguOY7uNvQO2dBlizvMUG2yTYhVAIVafvF8Ya/t/BghBSHnA14 ltUqbVzSJToRQEU0x0zsEzp3ZQrXwmXxqfYph0ISGPDbzbyPM2SSDsypcq7JogZJ TtTRVunPAI/q7/cfSBs93kU= Received: (qmail 4608 invoked by alias); 31 Aug 2013 14:30:09 -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 4594 invoked by uid 89); 31 Aug 2013 14:30:09 -0000 Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sat, 31 Aug 2013 14:30:09 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, NO_RELAYS autolearn=ham version=3.3.2 X-HELO: nikam.ms.mff.cuni.cz Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id DB9C75432F0; Sat, 31 Aug 2013 16:30:04 +0200 (CEST) Date: Sat, 31 Aug 2013 16:30:04 +0200 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Fix fork instrumentation for libgcov Message-ID: <20130831143004.GA22772@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Hi, as noticed by Martin Liska, -O0 -fprofile-generate code won't land into __gcov_fork. This is due to early exit from expand_builtin. Fixed and will be comitted as obvious. Honza * builtins.c (expand_builtin): Do not exit early for gcov instrumented functions. * gcc.dg/fork-instrumentation.c: New testcase. Index: builtins.c =================================================================== --- builtins.c (revision 202100) +++ builtins.c (working copy) @@ -5850,6 +5850,13 @@ expand_builtin (tree exp, rtx target, rt set of builtins. */ if (!optimize && !called_as_built_in (fndecl) + && fcode != BUILT_IN_FORK + && fcode != BUILT_IN_EXECL + && fcode != BUILT_IN_EXECV + && fcode != BUILT_IN_EXECLP + && fcode != BUILT_IN_EXECLE + && fcode != BUILT_IN_EXECVP + && fcode != BUILT_IN_EXECVE && fcode != BUILT_IN_ALLOCA && fcode != BUILT_IN_ALLOCA_WITH_ALIGN && fcode != BUILT_IN_FREE) Index: testsuite/gcc.dg/fork-instrumentation.c =================================================================== --- testsuite/gcc.dg/fork-instrumentation.c (revision 0) +++ testsuite/gcc.dg/fork-instrumentation.c (working copy) @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O0 -fprofile-generate" } */ +int fork(void); +t() +{ + fork (); +} +/* { dg-final { scan-assembler "gcov_fork" } } */