From patchwork Fri Oct 11 23:21:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Glisse X-Patchwork-Id: 282956 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 did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7DF0C2C0339 for ; Sat, 12 Oct 2013 10:22:05 +1100 (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:cc:subject:in-reply-to:message-id:references :mime-version:content-type; q=dns; s=default; b=lww9GaYdRZrqCpX3 YB8H+awUFedTkPmnieDqeBnkAwcxK8xjVi9c7K0jsxAJFmzyoC9Obk3HqZtkV+sM ORUgB1CjdXv5b8X/kozSlLH4Gv/N1baZpzsWQpEeOikl3FmPKPfY0342NRdL/Ljo Bgg7i/6JPw3gTT3A5mYQ1ei13i8= 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:cc:subject:in-reply-to:message-id:references :mime-version:content-type; s=default; bh=wqLBRQJtPM+8wQx3ikqnIv g1vd0=; b=c/R/uZXtdhELwdDW51Z+lAqmoqryhMWaI0JyE9t9iKJI32OKY3nHwl 4i1icqm0IsWlEHZUbVLKqPZFTf3mqFhG0Jx+FEeW/lThA7QdJNInXWuTZHzMTKdl 2ZtXndagdvdaKZj5SLtOEiCjhAMNdrCt72KCNFy1Bq5BKP/IyZHi0= Received: (qmail 621 invoked by alias); 11 Oct 2013 23:21:59 -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 607 invoked by uid 89); 11 Oct 2013 23:21:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail3-relais-sop.national.inria.fr Received: from mail3-relais-sop.national.inria.fr (HELO mail3-relais-sop.national.inria.fr) (192.134.164.104) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Fri, 11 Oct 2013 23:21:58 +0000 Received: from stedding.saclay.inria.fr ([193.55.250.194]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 12 Oct 2013 01:21:54 +0200 Received: from glisse (helo=localhost) by stedding.saclay.inria.fr with local-esmtp (Exim 4.80) (envelope-from ) id 1VUm1q-0008Sh-LE; Sat, 12 Oct 2013 01:21:54 +0200 Date: Sat, 12 Oct 2013 01:21:54 +0200 (CEST) From: Marc Glisse To: DJ Delorie cc: gcc-patches@gcc.gnu.org Subject: Re: Apply attribute returns_nonnull in libiberty In-Reply-To: <201310112046.r9BKk4VF008796@greed.delorie.com> Message-ID: References: <201310111830.r9BIUDTR021438@greed.delorie.com> <201310112046.r9BKk4VF008796@greed.delorie.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 The gcc-specific part now. Bootstrap+testsuite on x86_64-unknown-linux-gnu together with the libiberty patch (well, libgomp.graphite/force-parallel-4.c failed, but that randomly happens). 2013-10-12 Marc Glisse PR tree-optimization/58689 * system.h (concat, reconcat, choose_temp_base, xmalloc, xrealloc, xcalloc, xstrdup, xstrndup, xmemdup, pex_init): Mark with attribute returns_nonnull. Index: gcc/system.h =================================================================== --- gcc/system.h (revision 203463) +++ gcc/system.h (working copy) @@ -645,20 +645,40 @@ extern int vsnprintf (char *, size_t, co #endif /* Do not introduce a gmp.h dependency on the build system. */ #ifndef GENERATOR_FILE #include #endif /* Get libiberty declarations. */ #include "libiberty.h" +/* Add attributes that libiberty doesn't want to add globally. */ +#if GCC_VERSION >= 4009 +# ifdef __cplusplus +extern "C" { +# endif +__typeof (concat) concat ATTRIBUTE_RETURNS_NONNULL; +__typeof (reconcat) reconcat ATTRIBUTE_RETURNS_NONNULL; +__typeof (choose_temp_base) choose_temp_base ATTRIBUTE_RETURNS_NONNULL; +__typeof (xmalloc) xmalloc ATTRIBUTE_RETURNS_NONNULL; +__typeof (xrealloc) xrealloc ATTRIBUTE_RETURNS_NONNULL; +__typeof (xcalloc) xcalloc ATTRIBUTE_RETURNS_NONNULL; +__typeof (xstrdup) xstrdup ATTRIBUTE_RETURNS_NONNULL; +__typeof (xstrndup) xstrndup ATTRIBUTE_RETURNS_NONNULL; +__typeof (xmemdup) xmemdup ATTRIBUTE_RETURNS_NONNULL; +__typeof (pex_init) pex_init ATTRIBUTE_RETURNS_NONNULL; +# ifdef __cplusplus +} +# endif +#endif + #undef FFS /* Some systems predefine this symbol; don't let it interfere. */ #undef FLOAT /* Likewise. */ #undef ABS /* Likewise. */ #undef PC /* Likewise. */ /* Provide a default for the HOST_BIT_BUCKET. This suffices for POSIX-like hosts. */ #ifndef HOST_BIT_BUCKET #define HOST_BIT_BUCKET "/dev/null"