[LLVMdev] New strict-aliasing warning?

Hal Finkel hfinkel at anl.gov
Sat Dec 3 13:16:00 PST 2011

When compiling trunk using gcc 4.1.2 on linux/ppc64, I now see a warning
that I don't remember seeing previously:

llvm[2]: Compiling InlineSpiller.cpp for Release+Asserts build
/src/llvm-trunk-dev/include/llvm/ADT/PointerIntPair.h: In member
function ‘const PointerTy* llvm::PointerIntPair<PointerTy, IntBits,
IntType, PtrTraits>::getAddrOfPointer() const [with PointerTy = void*,
unsigned int IntBits = 1u, IntType = bool, PtrTraits =
llvm::SmallVector<llvm::VNInfo*, 4u>*>]’:
/src/llvm-trunk-dev/include/llvm/ADT/PointerUnion.h:153:   instantiated
from ‘const PT1* llvm::PointerUnion<PT1, PT2>::getAddrOf() const [with T
= llvm::VNInfo*, PT1 = llvm::VNInfo*, PT2 =
llvm::SmallVector<llvm::VNInfo*, 4u>*]’
/src/llvm-trunk-dev/include/llvm/ADT/TinyPtrVector.h:63:   instantiated
from ‘const EltTy* llvm::TinyPtrVector<EltTy>::begin() const [with EltTy
= llvm::VNInfo*]’
/src/llvm-trunk-dev/lib/CodeGen/InlineSpiller.cpp:382:   instantiated
from here
/src/llvm-trunk-dev/include/llvm/ADT/PointerIntPair.h:98: warning:
dereferencing type-punned pointer will break strict-aliasing rules

I think that this might be indicating some kind of problem because I am
also currently seeing a crash in InlineSpiller on linux/ppc64. I am not
yet sure if the crash and this warning are related. Does anyone know why
this warning has appeared?

Thanks again,

Hal Finkel
Postdoctoral Appointee
Leadership Computing Facility
Argonne National Laboratory

More information about the llvm-dev mailing list