[LLVMbugs] [Bug 11837] New: "tail" marked on function with that may touch stack via byval param of caller

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jan 23 11:24:21 PST 2012


             Bug #: 11837
           Summary: "tail" marked on function with that may touch stack
                    via byval param of caller
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: jvoung at google.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 7935
  --> http://llvm.org/bugs/attachment.cgi?id=7935
ll showing issue

In the attached test case, clang marks a call to memcpy "tail" even though one
of the arguments is a pointer that may be pointing at the stack.  The pointer
may be pointing at the stack because it was derived from a "byval" parameter of
the caller.

Attached is the .ll for "SingleSource/UnitTests/byval-alignment.c" from the
llvm test-suite, which shows this (see parameter "y" of function f0 being
funneled to a tail call after a bitcast).

Repro info: This was generated by running with clang -O3 (r148716), on x86-64,
but without "-mllvm -disable-llvm-optzns" on the byval-alignment test.

This seems related to:
Though that bug says it's been fixed...

This is also related to comment #1 in:

Which noticed that: "BasicAA sees that the call to memcpy is a tail-call, and
therefore concludes that it can't possibly touch stack memory."

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