[LLVMbugs] [Bug 8072] New: clang passes aliasing storage to sret argument on x86-64

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Sep 3 08:17:11 PDT 2010


           Summary: clang passes aliasing storage to sret argument on
           Product: clang
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: gohman at apple.com
                CC: llvmbugs at cs.uiuc.edu

As discussed in PR6525, the x86-64 ABI now explicitly requires sret arguments
to point to non-aliased memory. GCC and llvm-gcc do this, but clang does not.

Here is a small C testcase which demonstrates the problem:

struct A { long i0; long i1; long i2; };
extern struct A global;
struct A call(struct A *p);
void foo(void) {
  global = call(&global);

Clang emits this LLVM IR:

  tail call void @call(%struct.A* sret @global, %struct.A* @global) nounwind

The sret argument here is clearly aliased.

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