[LLVMdev] AA bug?

Vikram Adve vadve at illinois.edu
Wed Jul 20 20:18:17 PDT 2011

I was reading the code in AliasAnalysis.cpp and happened to notice what looks like a bug. See the line marked by '*' below:

AliasAnalysis::getModRefInfo(const VAArgInst *V, const Location &Loc) {
  // If the va_arg address cannot alias the pointer in question, then the
  // specified memory cannot be accessed by the va_arg.
  if (!alias(getLocation(V), Loc))
    return NoModRef;

  // If the pointer is a pointer to constant memory, then it could not have been
  // modified by this va_arg.
  if (pointsToConstantMemory(Loc))
    return NoModRef;                *************

  // Otherwise, a va_arg reads and writes.
  return ModRef;

************* It looks like that line should be
    return Ref;

I don't have a test case to reproduce this since I was just reading.

Professor, Computer Science
University of Illinois at Urbana-Champaign

More information about the llvm-dev mailing list