https://gcc.gnu.org/bugzilla/show_bug.cgi?id=34072
--- Comment #5 from Andrew Pinski ---
(In reply to Andrew Pinski from comment #4)
> So we still have an issue for the C++ example with memcpy.
But the code did improve from GCC 6 to GCC 7 though.
From
.cfi_startproc
subl$12,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=34072
Andrew Pinski changed:
What|Removed |Added
Severity|normal |enhancement
Known to work|
--- Comment #2 from pluto at agmk dot net 2007-11-14 11:14 ---
and the c++ testcase with __builtin_memcpy:
template < int N >
unsigned char memcpy_byte( unsigned long long x )
{
unsigned char rv;
__builtin_memcpy( &rv, N + reinterpret_cast< unsigned char* >( &x ),
sizeof
--- Comment #1 from rask at gcc dot gnu dot org 2007-11-14 01:44 ---
With -S -dp it is clear that only byte0 is optimized:
byte0:
movzbl 4(%esp), %eax # 11*movqi_1/3
byte1:
movl4(%esp), %eax # 24*movsi_1/1
movl8(%esp), %edx # 25*movsi_1