[PATCH] D15950: [ARM] Fix several state persistence bugs

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 14 06:24:09 PST 2016


psmith added a subscriber: psmith.
psmith added a comment.

I think that there is still some state that is not properly reset. If I use a slightly more complicated test case derived from:
int data = 10;

int func(void)
{

  return data;

}
clang -c -emit-llvm t.c --target=arm-none-eabi -mcpu=arm7tdmi -o t.bc
llvm-dis -o test.ll t.bc
llc -compile-twice -filetype=obj test.ll -o twice.o
Running the pass manager twice changed the output.
Writing the result of the second run to the specified output
To generate the one-run comparison binary, just run without
the compile-twice option

Looking at the object files it looks like the discrepancies are in the mapping symbols.

I think that this is caused by LastMappingSymbols retaining state across passes. In my local build adding LastMappingSymbols.clear() to void ARMELFStreamer::reset() appears to solve the problem.

I can also reproduce the problem with the AARCH64 backend, also mapping symbol related although I haven't attempted to fix that locally. Would you be able to take another look?

Thanks in advance

Peter


Repository:
  rL LLVM

http://reviews.llvm.org/D15950





More information about the llvm-commits mailing list