From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122817 invoked by alias); 15 Jan 2019 23:07:41 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 122798 invoked by uid 89); 15 Jan 2019 23:07:40 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.9 required=5.0 tests=BAYES_00,BODY_8BITS,GARBLED_BODY,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:980, Simulator, HContent-Transfer-Encoding:8bit X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 15 Jan 2019 23:07:39 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id x0FN7Xx4022503 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 15 Jan 2019 18:07:37 -0500 Received: by simark.ca (Postfix, from userid 112) id 2CD681E7BB; Tue, 15 Jan 2019 18:07:33 -0500 (EST) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 68D971E4C2; Tue, 15 Jan 2019 18:07:31 -0500 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Tue, 15 Jan 2019 23:07:00 -0000 From: Simon Marchi To: =?UTF-8?Q?=D0=9F=D0=B0=D0=B2=D0=B5=D0=BB_=D0=9A=D1=80=D1=8E=D0=BA?= =?UTF-8?Q?=D0=BE=D0=B2?= Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Simulator: prevent inlining in C++ mode In-Reply-To: References: Message-ID: <7d0cf55807aabaf4391662dc5e25b3cf@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg00364.txt.bz2 On 2019-01-11 04:59, Павел Крюков wrote: > Simulator: prevent inlining in C++ mode > > sim-arange.c contains C code and cannot be built with C++ compiler. > Instead, it should be built separately by C compiler w/o inlining. > > sim/common/Changelog: > 2019-01-11 Pavel I. Kryukov > > * sim-inline.h: don't define HAVE_INLINE with __cplusplus > > diff --git a/sim/common/sim-inline.h b/sim/common/sim-inline.h > index b2a3fc3..e9fb5c7 100644 > --- a/sim/common/sim-inline.h > +++ b/sim/common/sim-inline.h > @@ -282,7 +282,7 @@ > > > #ifndef HAVE_INLINE > -#ifdef __GNUC__ > +#if defined(__GNUC__) && !defined(__cplusplus) > #define HAVE_INLINE > #endif > #endif What kind of errors do you get? Would it be possible to modify the code so it compiles both as C and C++? If all this trouble was taken to make these functions inline-able, I asusme that it's because the speedup is significant. Simon