This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/49676] New: inefficiency: DW_AT_GNU_call_site_value calculates everything << 32
- From: "jan.kratochvil at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 8 Jul 2011 11:51:32 +0000
- Subject: [Bug debug/49676] New: inefficiency: DW_AT_GNU_call_site_value calculates everything << 32
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49676
Summary: inefficiency: DW_AT_GNU_call_site_value calculates
everything << 32
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: trivial
Priority: P3
Component: debug
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: jan.kratochvil@redhat.com
CC: jakub@redhat.com
Target: x86_64-unknown-linux-gnu
It works but it is a bit size-inefficient/overcomplicated.
extern void d (int);
void __attribute__((noinline, noclone))
self (int i)
{
if (i == 200)
self (i + 1);
else
d (i + 2);
}
-g -O2
gcc (GCC) 4.7.0 20110708 (experimental)
DW_AT_GNU_call_site_value: 26 byte block: f3 1 55 23 2 8 cb f3 1 55 8 20 24 10
80 80 80 80 80 19 2e 28 1 0 16 13 (DW_OP_GNU_entry_value: (DW_OP_reg5
(rdi)); DW_OP_plus_uconst: 2; DW_OP_const1u: 203; DW_OP_GNU_entry_value:
(DW_OP_reg5 (rdi)); DW_OP_const1u: 32; DW_OP_shl; DW_OP_constu: 858993459200;
DW_OP_ne; DW_OP_bra: 1; DW_OP_swap; DW_OP_drop)
this is:
DW_OP_GNU_entry_value: (DW_OP_reg5 (rdi))
DW_OP_plus_uconst: 2
= 202
DW_OP_const1u: 203
DW_OP_GNU_entry_value: (DW_OP_reg5 (rdi))
DW_OP_const1u: 32
32, 200, 203, 202
DW_OP_shl
200 << 32, 203, 202
DW_OP_constu: 858993459200
200 << 32, 200 << 32, 203, 202
DW_OP_ne
DW_OP_bra: 1
DW_OP_swap
DW_OP_drop
858993459200 = 200 << 32
There should not be a need to shl by 32 and calculate it everything << 32.
unrelated: function was inlined by `cmovne' despite there is `noinline'.