* [PATCH] testsuite/gdb.dwarf2: avoid dead code in dw2-inline-with-lexical-scope.c
@ 2021-05-19 12:56 Tankut Baris Aktemur
2021-05-21 15:05 ` Simon Marchi
0 siblings, 1 reply; 2+ messages in thread
From: Tankut Baris Aktemur @ 2021-05-19 12:56 UTC (permalink / raw)
To: gdb-patches
The test in gdb.dwarf2/dw2-inline-with-lexical-scope.c fails with icc.
The reason is, icc did not emit code for a dead statement, which in
turn caused some labels to be collapsed. Fix this by replacing the
dead code with assignment to a global value. The statement itself
does not change the test scenario.
Also fix a whitespacing problem around an assignment operator.
gdb/testsuite/ChangeLog:
2021-05-19 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* gdb.dwarf2/dw2-inline-with-lexical-scope.c (func): Replace
a dead code with an assignment to a global var. Fix a
whitespacing problem around an assignment operator.
---
gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.c b/gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.c
index ef9b71af4e0..c5f42806a22 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.c
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.c
@@ -30,14 +30,14 @@ static void
func ()
{ /* func prologue */
global_num = 42;
- int num= 42;
+ int num = 42;
if (num > 2)
{
asm ("scope_label1: .globl scope_label1");
global_value = num;
int value = num;
asm ("breakpoint_label: .globl breakpoint_label");
- value += 10;
+ global_value += value;
asm ("scope_label2: .globl scope_label2");
}
} /* func end */
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] testsuite/gdb.dwarf2: avoid dead code in dw2-inline-with-lexical-scope.c
2021-05-19 12:56 [PATCH] testsuite/gdb.dwarf2: avoid dead code in dw2-inline-with-lexical-scope.c Tankut Baris Aktemur
@ 2021-05-21 15:05 ` Simon Marchi
0 siblings, 0 replies; 2+ messages in thread
From: Simon Marchi @ 2021-05-21 15:05 UTC (permalink / raw)
To: Tankut Baris Aktemur, gdb-patches
On 2021-05-19 8:56 a.m., Tankut Baris Aktemur via Gdb-patches wrote:
> The test in gdb.dwarf2/dw2-inline-with-lexical-scope.c fails with icc.
> The reason is, icc did not emit code for a dead statement, which in
> turn caused some labels to be collapsed. Fix this by replacing the
> dead code with assignment to a global value. The statement itself
> does not change the test scenario.
>
> Also fix a whitespacing problem around an assignment operator.
LGTM, thanks.
Simon
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-21 15:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-19 12:56 [PATCH] testsuite/gdb.dwarf2: avoid dead code in dw2-inline-with-lexical-scope.c Tankut Baris Aktemur
2021-05-21 15:05 ` Simon Marchi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).