public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58198] New: duplicate codes generated for variant function and base function
@ 2013-08-20 3:28 chihin.ko at oracle dot com
2013-08-20 7:41 ` [Bug c++/58198] " jakub at gcc dot gnu.org
2013-08-20 18:30 ` chihin.ko at oracle dot com
0 siblings, 2 replies; 3+ messages in thread
From: chihin.ko at oracle dot com @ 2013-08-20 3:28 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58198
Bug ID: 58198
Summary: duplicate codes generated for variant function and
base function
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: chihin.ko at oracle dot com
Created attachment 30675
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30675&action=edit
test case
This problem was fixed after g++ 4.4, I file this bug is only for book keeping.
test case was attached.
pirandello 1017> nm a.out | grep mybase
0000000000400528 T _ZN6mybase10mybasefuncEv
000000000040054e T _ZN6mybaseC1Ev <=== base function
000000000040053a T _ZN6mybaseC2Ev <=== variant function
base function (_ZN6mybaseC1Ev) and variant function (_ZN6mybaseC2Ev) should
have same addresses, but they're not.
Use gdb to debug a.out, shows bpt stop in variant function instead of base
function:
(gdb) b mybase::mybase
Breakpoint 1 at 0x400542: file base.cc, line 21. (2 locations)
(gdb) run
Starting program:
/net/benjamin2.us.oracle.com/export/ws/jeanko/dinstall/maxirun/intel-Linux/pirandello-chko/results/Customlist_list.master.maxi/gplus_base.dbx,gcc/a.out
Breakpoint 1, mybase (this=0x7fff1343ed50) at base.cc:21
21 mybaseint = 5555;
(gdb) disassemb $pc
Dump of assembler code for function mybase:
0x000000000040053a <mybase+0>: push %rbp
0x000000000040053b <mybase+1>: mov %rsp,%rbp
0x000000000040053e <mybase+4>: mov %rdi,-0x8(%rbp)
0x0000000000400542 <mybase+8>: mov -0x8(%rbp),%rax
0x0000000000400546 <mybase+12>: movl $0x15b3,(%rax)
0x000000000040054c <mybase+18>: leaveq
0x000000000040054d <mybase+19>: retq
End of assembler dump.
(gdb)
# disassemble base function address shows both functions has exact same codes
(gdb) disassemb 0x40054e
Dump of assembler code for function mybase:
0x000000000040054e <mybase+0>: push %rbp
0x000000000040054f <mybase+1>: mov %rsp,%rbp
0x0000000000400552 <mybase+4>: mov %rdi,-0x8(%rbp)
0x0000000000400556 <mybase+8>: mov -0x8(%rbp),%rax
0x000000000040055a <mybase+12>: movl $0x15b3,(%rax)
0x0000000000400560 <mybase+18>: leaveq
0x0000000000400561 <mybase+19>: retq
End of assembler dump.
(gdb)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/58198] duplicate codes generated for variant function and base function
2013-08-20 3:28 [Bug c++/58198] New: duplicate codes generated for variant function and base function chihin.ko at oracle dot com
@ 2013-08-20 7:41 ` jakub at gcc dot gnu.org
2013-08-20 18:30 ` chihin.ko at oracle dot com
1 sibling, 0 replies; 3+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-08-20 7:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58198
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |jakub at gcc dot gnu.org
Resolution|--- |FIXED
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
For book keeping of what? GCC before 4.7.0 are no longer supported.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/58198] duplicate codes generated for variant function and base function
2013-08-20 3:28 [Bug c++/58198] New: duplicate codes generated for variant function and base function chihin.ko at oracle dot com
2013-08-20 7:41 ` [Bug c++/58198] " jakub at gcc dot gnu.org
@ 2013-08-20 18:30 ` chihin.ko at oracle dot com
1 sibling, 0 replies; 3+ messages in thread
From: chihin.ko at oracle dot com @ 2013-08-20 18:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58198
--- Comment #2 from chihin ko <chihin.ko at oracle dot com> ---
(In reply to Jakub Jelinek from comment #1)
> For book keeping of what? GCC before 4.7.0 are no longer supported.
oracle solstudtio debugger dbx support gnu compiler v4.1 v4.5.2...etc,
this is to show why dbx has problem with variant function.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-08-20 18:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-20 3:28 [Bug c++/58198] New: duplicate codes generated for variant function and base function chihin.ko at oracle dot com
2013-08-20 7:41 ` [Bug c++/58198] " jakub at gcc dot gnu.org
2013-08-20 18:30 ` chihin.ko at oracle dot com
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).