bafd12cb22
The attached patch changes the code generated for std::optional<std::array<int,1024>>f(){return{};} from movq $0, (%rdi) movq %rdi, %r8 leaq 8(%rdi), %rdi xorl %eax, %eax movq $0, 4084(%rdi) movq %r8, %rcx andq $-8, %rdi subq %rdi, %rcx addl $4100, %ecx shrl $3, %ecx rep stosq movq %r8, %rax or with different tuning subq $8, %rsp movl $4100, %edx xorl %esi, %esi call memset addq $8, %rsp to the much shorter movb $0, 4096(%rdi) movq %rdi, %rax i.e. the same as the nullopt constructor. The constructor was already non-trivial, so we don't lose that. It passes the testsuite without regression, but there is no new testcase to verify the better codegen. libstdc++-v3/ChangeLog: * include/std/optional (optional()): Explicitly define it. |
||
---|---|---|
.. | ||
config | ||
doc | ||
include | ||
libsupc++ | ||
po | ||
python | ||
scripts | ||
src | ||
testsuite | ||
acinclude.m4 | ||
aclocal.m4 | ||
ChangeLog | ||
ChangeLog-1998 | ||
ChangeLog-1999 | ||
ChangeLog-2000 | ||
ChangeLog-2001 | ||
ChangeLog-2002 | ||
ChangeLog-2003 | ||
ChangeLog-2004 | ||
ChangeLog-2005 | ||
ChangeLog-2006 | ||
ChangeLog-2007 | ||
ChangeLog-2008 | ||
ChangeLog-2009 | ||
ChangeLog-2010 | ||
ChangeLog-2011 | ||
ChangeLog-2012 | ||
ChangeLog-2013 | ||
ChangeLog-2014 | ||
ChangeLog-2015 | ||
ChangeLog-2016 | ||
ChangeLog-2017 | ||
ChangeLog-2018 | ||
ChangeLog-2019 | ||
config.h.in | ||
configure | ||
configure.ac | ||
configure.host | ||
crossconfig.m4 | ||
fragment.am | ||
linkage.m4 | ||
Makefile.am | ||
Makefile.in | ||
README |
file: libstdc++-v3/README New users may wish to point their web browsers to the file index.html in the 'doc/html' subdirectory. It contains brief building instructions and notes on how to configure the library in interesting ways.