From: ppluzhnikov@google.com (Paul Pluzhnikov)
To: gdb-patches@sourceware.org
Subject: [patch][commit] Fix gdb.cp/cpcompletion.exp failure with GCC-4.4.0
Date: Tue, 10 Feb 2009 00:59:00 -0000 [thread overview]
Message-ID: <20090210005934.610323A6B80@localhost> (raw)
Greetings,
gdb.cp/cpcompletion.exp fails under GCC-4.4.0, because compiler
optimizes out the 'a' variable:
<1><50d>: Abbrev Number: 32 (DW_TAG_subprogram)
<50e> DW_AT_external : 1
<50f> DW_AT_name : (indirect string, offset: 0xcd): main
<513> DW_AT_decl_file : 1
<514> DW_AT_decl_line : 42
<515> DW_AT_type : <33c>
<519> DW_AT_low_pc : 0x400370
<521> DW_AT_high_pc : 0x4003b0
<529> DW_AT_frame_base : 0xfc (location list)
<52d> DW_AT_sibling : <569>
<2><531>: Abbrev Number: 33 (DW_TAG_structure_type)
<532> DW_AT_name : (indirect string, offset: 0x246): <anonymous struct>
<536> DW_AT_byte_size : 1
<537> DW_AT_decl_file : 1
<538> DW_AT_decl_line : 45
<539> DW_AT_sibling : <551>
<3><53d>: Abbrev Number: 34 (DW_TAG_subprogram)
<53e> DW_AT_name : get
<542> DW_AT_decl_file : 1
<543> DW_AT_decl_line : 46
<544> DW_AT_type : <33c>
<548> DW_AT_declaration : 1
<4><549>: Abbrev Number: 6 (DW_TAG_formal_parameter)
<54a> DW_AT_type : <569>
<54e> DW_AT_artificial : 1
<2><551>: Abbrev Number: 35 (DW_TAG_variable)
<552> DW_AT_name : a
<554> DW_AT_decl_file : 1
<555> DW_AT_decl_line : 47
<556> DW_AT_type : <531>
<<<< Missing DW_AT_location
<2><55a>: Abbrev Number: 36 (DW_TAG_variable)
<55b> DW_AT_name : (indirect string, offset: 0xb7): foo1
Committed as obvious.
--
Paul Pluzhnikov
testsuite/ChangeLog:
2009-02-06 Paul Pluzhnikov <ppluzhnikov@google.com>
* gdb.cp/pr9594.cc: Prevent GCC from optimizing 'a' out.
Index: gdb.cp/pr9594.cc
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/pr9594.cc,v
retrieving revision 1.1
diff -u -p -u -r1.1 pr9594.cc
--- gdb.cp/pr9594.cc 3 Feb 2009 01:09:01 -0000 1.1
+++ gdb.cp/pr9594.cc 10 Feb 2009 00:56:59 -0000
@@ -47,5 +47,6 @@ int main ()
} a;
Foo foo1;
foo1.set_foo (42); // Set breakpoint here.
+ a.get(); // Prevent compiler from throwing 'a' away.
return 0;
}
reply other threads:[~2009-02-10 0:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20090210005934.610323A6B80@localhost \
--to=ppluzhnikov@google.com \
--cc=gdb-patches@sourceware.org \
/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