From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32034 invoked by alias); 1 Jul 2016 11:38:28 -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 29962 invoked by uid 89); 1 Jul 2016 11:38:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MIME_BASE64_BLANKS,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Fred, Deutschland, deutschland, commercial X-HELO: mga03.intel.com Received: from mga03.intel.com (HELO mga03.intel.com) (134.134.136.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 01 Jul 2016 11:38:17 +0000 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP; 01 Jul 2016 04:38:14 -0700 X-ExtLoop1: 1 Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by fmsmga004.fm.intel.com with ESMTP; 01 Jul 2016 04:38:14 -0700 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.117]) by IRSMSX101.ger.corp.intel.com ([169.254.1.155]) with mapi id 14.03.0248.002; Fri, 1 Jul 2016 12:38:13 +0100 From: "Tedeschi, Walfred" To: Yao Qi CC: "palves@redhat.com" , "gdb-patches@sourceware.org" Subject: RE: [PATCH V2 1/1] Fix of default lookup for "this" symbol. Date: Fri, 01 Jul 2016 11:38:00 -0000 Message-ID: References: <1467118304-31635-1-git-send-email-walfred.tedeschi@intel.com> <86eg7dzmm4.fsf@gmail.com> In-Reply-To: <86eg7dzmm4.fsf@gmail.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 X-IsSubscribed: yes X-SW-Source: 2016-07/txt/msg00005.txt.bz2 WWFvLA0KDQpUaGFua3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.com@sourceware.org Fri Jul 01 12:05:58 2016 Return-Path: Delivered-To: listarch-gdb-patches@sources.redhat.com Received: (qmail 50130 invoked by alias); 1 Jul 2016 12:05:56 -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 Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 49505 invoked by uid 89); 1 Jul 2016 12:05:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=exercising, Except X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 01 Jul 2016 12:05:38 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9D784804E3; Fri, 1 Jul 2016 12:05:37 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u61C5aV8019514; Fri, 1 Jul 2016 08:05:36 -0400 Subject: [PATCH] Build gdb.opt/inline-*.exp tests at -O0, rely on __attribute__((always_inline)) (was: Re: [PATCH v3 24/34] Push thread->control.command_interp to the struct thread_fsm) To: Thomas Preudhomme References: <1462538104-19109-25-git-send-email-palves@redhat.com> <8587009.ikB25uYBLk@e108577-lin> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: <20144b4c-11ee-fc84-e3ad-b9992f14ce15@redhat.com> Date: Fri, 01 Jul 2016 12:05:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <8587009.ikB25uYBLk@e108577-lin> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-07/txt/msg00006.txt.bz2 Content-length: 4646 On 07/01/2016 12:02 PM, Thomas Preudhomme wrote: > The new tests added by this patch fail for arm-none-eabi targets because -O2 > leads to instructions to be reordered widely. In this case, the instruction > that follows the first one for line 64 is related to line 70 so the test is > failing. Shouldn't this test be compiled with -Og and probably also -finline- > small-functions -findirect-inlining -fpartial-inlining which relates to > inlining and are included in -O2. Or even just plain -O0. See the commit log below. WDYT? -------------- Subject: [PATCH] Build gdb.opt/inline-*.exp tests at -O0, rely on __attribute__((always_inline)) A test recently added to gdb.opt/inline-cmds.exp fails for arm-none-eabi targets because -O2 leads to instructions to be reordered widely. I guess it might have made sense years ago to enable optimization in these tests, but I fail to see the need for that nowadays. Using -O0 while relying on __attribute__((always_inline)), which is already used in the tests [1] [2], avoids this sort of trouble, while still exercising the inlining-related use cases that are the focus of these tests. I think that nowadays we can safely assume that all compilers we care about support __attribute__((always_inline)) or similar. [1] - Except one spot that missed it. [2] - Note that the .exp files make sure the frames that should have been inlined are indeed inlined, with "info frame". gdb/testsuite/ChangeLog: 2016-07-01 Pedro Alves * gdb.opt/inline-break.exp: Remove optimize=-O2. * gdb.opt/inline-bt.exp: Likewise. * gdb.opt/inline-cmds.exp: Remove optimize=-O2 and add additional_flags=-Winline. * gdb.opt/inline-locals.exp: Likewise. * gdb.opt/inline-markers.c (ATTR): Define. (inlined_fn): Use it. --- gdb/testsuite/gdb.opt/inline-break.exp | 2 +- gdb/testsuite/gdb.opt/inline-bt.exp | 2 +- gdb/testsuite/gdb.opt/inline-cmds.exp | 2 +- gdb/testsuite/gdb.opt/inline-locals.exp | 2 +- gdb/testsuite/gdb.opt/inline-markers.c | 8 +++++++- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/gdb.opt/inline-break.exp b/gdb/testsuite/gdb.opt/inline-break.exp index b2aa22e..ac56b04 100644 --- a/gdb/testsuite/gdb.opt/inline-break.exp +++ b/gdb/testsuite/gdb.opt/inline-break.exp @@ -20,7 +20,7 @@ standard_testfile if { [prepare_for_testing $testfile.exp $testfile $srcfile \ - {debug optimize=-O2 additional_flags=-Winline}] } { + {debug additional_flags=-Winline}] } { return -1 } diff --git a/gdb/testsuite/gdb.opt/inline-bt.exp b/gdb/testsuite/gdb.opt/inline-bt.exp index 63d76e2..13c6993 100644 --- a/gdb/testsuite/gdb.opt/inline-bt.exp +++ b/gdb/testsuite/gdb.opt/inline-bt.exp @@ -17,7 +17,7 @@ standard_testfile .c inline-markers.c if {[prepare_for_testing $testfile.exp $testfile \ [list $srcfile $srcfile2] \ - {debug optimize=-O2 additional_flags=-Winline}]} { + {debug additional_flags=-Winline}]} { return -1 } diff --git a/gdb/testsuite/gdb.opt/inline-cmds.exp b/gdb/testsuite/gdb.opt/inline-cmds.exp index 684f4dd..6c84848 100644 --- a/gdb/testsuite/gdb.opt/inline-cmds.exp +++ b/gdb/testsuite/gdb.opt/inline-cmds.exp @@ -19,7 +19,7 @@ set MIFLAGS "-i=mi" standard_testfile .c inline-markers.c if {[prepare_for_testing $testfile.exp $testfile \ - [list $srcfile $srcfile2] {debug optimize=-O2}]} { + [list $srcfile $srcfile2] {debug additional_flags=-Winline}]} { return -1 } diff --git a/gdb/testsuite/gdb.opt/inline-locals.exp b/gdb/testsuite/gdb.opt/inline-locals.exp index df2253a..36f7ed2 100644 --- a/gdb/testsuite/gdb.opt/inline-locals.exp +++ b/gdb/testsuite/gdb.opt/inline-locals.exp @@ -16,7 +16,7 @@ standard_testfile .c inline-markers.c if {[prepare_for_testing $testfile.exp $testfile \ - [list $srcfile $srcfile2] {debug optimize=-O2}]} { + [list $srcfile $srcfile2] {debug additional_flags=-Winline}]} { return -1 } diff --git a/gdb/testsuite/gdb.opt/inline-markers.c b/gdb/testsuite/gdb.opt/inline-markers.c index cf92e79..41f8a38 100644 --- a/gdb/testsuite/gdb.opt/inline-markers.c +++ b/gdb/testsuite/gdb.opt/inline-markers.c @@ -13,6 +13,12 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#ifdef __GNUC__ +# define ATTR __attribute__((always_inline)) +#else +# define ATTR +#endif + extern int x, y; extern volatile int z; @@ -26,7 +32,7 @@ void marker(void) x += y - z; /* set breakpoint 2 here */ } -inline void inlined_fn(void) +inline ATTR void inlined_fn(void) { x += y + z; } -- 2.5.5