[LLVMbugs] [Bug 10552] Struct Allocation / Return Bug

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Nov 25 00:53:43 PST 2012


http://llvm.org/bugs/show_bug.cgi?id=10552

Duncan Sands <baldrick at free.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #3 from Duncan Sands <baldrick at free.fr> 2012-11-25 02:53:43 CST ---
This was fixed at some point.  What now happens at -O0 is that 6 bytes are
copied out of the alloca using memcpy into a larger 8 byte alloca, and the
larger alloca is used for returning.  (You may object that the original alloca
only holds 5 bytes of memory, but because it has an alignment of 2 it actually
holds 5-bytes-rounded-up-to-alignment = 6 bytes).  The optimizers happily turn
this into decent code at -O1 and better.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list