Code optimization: warning for code that hangs
Peter A. Felvegi
petschy@praire-chicken.com
Mon Jun 25 11:42:00 GMT 2012
Hello,
>
> So far so good, but J::F() is strange:
>
> Dump of assembler code for function J::F():
> 0x0000000000400498 <+0>: sub rsp,0x8
> 0x000000000040049c <+4>: mov rax,QWORD PTR [rdi]
> 0x000000000040049f <+7>: mov rax,QWORD PTR [rax]
> 0x00000000004004a2 <+10>: mov rax,QWORD PTR [rax]
> 0x00000000004004a5 <+13>: mov rax,QWORD PTR [rax]
> 0x00000000004004a8 <+16>: mov rax,QWORD PTR [rax]
> 0x00000000004004ab <+19>: mov rax,QWORD PTR [rax]
> 0x00000000004004ae <+22>: mov rax,QWORD PTR [rax]
> 0x00000000004004b1 <+25>: mov rax,QWORD PTR [rax]
> 0x00000000004004b4 <+28>: mov rdi,QWORD PTR [rax]
> 0x00000000004004b7 <+31>: call 0x400498 <J::F()>
> 0x00000000004004bc <+36>: add rsp,0x8
> 0x00000000004004c0 <+40>: ret
> End of assembler dump.
>
> What are those mov rax,QWORD PTR [rax]'s ?
No comments on this part? Shouldn't the optimizer eliminated a few of
those loads?
Regards, Peter
More information about the Gcc
mailing list