Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Pedro Alves <palves@redhat.com>, Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [committed][gdb/testsuite] Add test-case gdb.dwarf2/break-inline-psymtab.exp
Date: Thu, 2 Apr 2020 17:14:16 +0200	[thread overview]
Message-ID: <41f0adf0-878f-25b0-ec85-e05cc3ce8fb5@suse.de> (raw)
In-Reply-To: <0fd8fe6f-be5f-3895-f67a-744bcc456ca6@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 450 bytes --]

On 02-04-2020 16:24, Pedro Alves wrote:
> On 3/18/20 1:48 PM, Tom de Vries wrote:
>> +set sources [list $srcfile $srcfile2]
>> +set opts {debug optimize=-O2}
>> +if { [prepare_for_testing "failed to prepare" ${testfile} $sources $opts] } {
>> +    return -1
>> +}
> 
> Is that -O2 needed to force inlining?
> 
> -O0 and __attribute__((always_inline)) would be better for that.
> 

Ack, thanks for noticing, fixed in commit below, committed.

- Tom



[-- Attachment #2: 0001-gdb-testsuite-Don-t-use-O2-for-inlining-in-break-inline-psymtab.exp.patch --]
[-- Type: text/x-patch, Size: 1717 bytes --]

[gdb/testsuite] Don't use O2 for inlining in break-inline-psymtab.exp

In test-case gdb.dwarf2/break-inline-psymtab.exp we use O2 to enable inlining
of bar into foo in break-inline-psymtab-2.c.

Instead, enforce inlining using __attribute__((always_inline)), to avoid any
optimization-related test issues.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-04-02  Tom de Vries  <tdevries@suse.de>

	* gdb.dwarf2/break-inline-psymtab-2.c (bar): Add
	__attribute__((always_inline)).
	* gdb.dwarf2/break-inline-psymtab.exp: Don't use -O2.

---
 gdb/testsuite/gdb.dwarf2/break-inline-psymtab-2.c | 2 +-
 gdb/testsuite/gdb.dwarf2/break-inline-psymtab.exp | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/gdb/testsuite/gdb.dwarf2/break-inline-psymtab-2.c b/gdb/testsuite/gdb.dwarf2/break-inline-psymtab-2.c
index 38c69336f2..b7fe485b3a 100644
--- a/gdb/testsuite/gdb.dwarf2/break-inline-psymtab-2.c
+++ b/gdb/testsuite/gdb.dwarf2/break-inline-psymtab-2.c
@@ -19,7 +19,7 @@ extern int foo (void);
 
 int a;
 
-static inline int
+static inline int __attribute__((always_inline))
 bar (void)
 {
   a = 2;
diff --git a/gdb/testsuite/gdb.dwarf2/break-inline-psymtab.exp b/gdb/testsuite/gdb.dwarf2/break-inline-psymtab.exp
index adbe8620aa..344d7da0d5 100644
--- a/gdb/testsuite/gdb.dwarf2/break-inline-psymtab.exp
+++ b/gdb/testsuite/gdb.dwarf2/break-inline-psymtab.exp
@@ -16,8 +16,7 @@
 standard_testfile break-inline-psymtab.c break-inline-psymtab-2.c
 
 set sources [list $srcfile $srcfile2]
-set opts {debug optimize=-O2}
-if { [prepare_for_testing "failed to prepare" ${testfile} $sources $opts] } {
+if { [prepare_for_testing "failed to prepare" ${testfile} $sources] } {
     return -1
 }
 

  reply	other threads:[~2020-04-02 15:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-09 14:52 [PATCH][gdb/symtab] Fix check-psymtab failure for inline function Tom de Vries
2020-03-11  0:08 ` Tom Tromey
2020-03-18 13:48   ` [committed][gdb/testsuite] Add test-case gdb.dwarf2/break-inline-psymtab.exp Tom de Vries
2020-04-02 14:24     ` Pedro Alves
2020-04-02 15:14       ` Tom de Vries [this message]
2020-03-18 15:58   ` [PATCH][gdb/symtab] Fix check-psymtab failure for inline function Tom de Vries
2020-04-02  8:46     ` [PING][PATCH][gdb/symtab] " Tom de Vries
2020-04-06 20:40     ` [PATCH][gdb/symtab] " Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41f0adf0-878f-25b0-ec85-e05cc3ce8fb5@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox