yaxunl marked an inline comment as done.
yaxunl added inline comments.

================
Comment at: lib/CodeGen/CGDecl.cpp:1375
+    Loc = Address(EmitCastToVoidPtrInAllocaAddrSpace(Loc.getPointer()),
+                  Loc.getAlignment());
 
----------------
rjmccall wrote:
> I don't understand why a patch about string literals is changing auto 
> variable emission.
It is a bug about alloca revealed by the lit test


```
char l_array[] = "l_array";

```
Loc contains the alloca casted to default address space, therefore it needs to 
be casted back to alloca address space here, otherwise CreateBitCast returns 
invalid bitcast. Unlike lifetime.start, memcpy does not require alloca address 
space, so an alternative fix is to let BP take address space of Loc.


https://reviews.llvm.org/D46643



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to