[LLVMdev] llvm-mc problem after a pass

Jim Grosbach grosbach at apple.com
Wed Jun 13 10:53:02 PDT 2012


Something is adding a bogus comment string. Specifically "   # %case^M18   ", where "^M" is a single ctrl-M character.

The ^M is seen by the asm parser as an end-of-line, so the '18' is a new token at the start of a line, not part of the comment. Is your pass perhaps using label names which might include literal "^M" characters?

-Jim

On Jun 13, 2012, at 5:51 AM, Rinaldini Julien <julien.rinaldini at heig-vd.ch> wrote:

> Hi,
> 
> I'm having some problem with llvm-mc on a program after applying a pass:
> 
> ../../../build/Release+Asserts/bin/clang -emit-llvm  -c -I./testprof/ -I./src/headers/ -I../libtommath-0.42.0/ -Wall -Wsign-compare -W -Wshadow -Wno-unused-parameter -DLTC_SOURCE -O0 -DLTC_NO_ASM -DUSE_LTM -DLTM_DESC -o src/pk/asn1/der/sequence/der_encode_sequence_ex.bc src/pk/asn1/der/sequence/der_encode_sequence_ex.c
> ../../../build/Release+Asserts/bin/opt -reg2mem -load ../../../build/Release+Asserts/lib/LLVMobfuscation.so -flattening src/pk/asn1/der/sequence/der_encode_sequence_ex.bc -o src/pk/asn1/der/sequence/der_encode_sequence_ex.bc -stats
> ===-------------------------------------------------------------------------===
>                          ... Statistics Collected ...
> ===-------------------------------------------------------------------------===
> 
> 9 break-crit-edges - Number of blocks inserted
> 1 flattening       - Functions flattened
> 
> ../../../build/Release+Asserts/bin/llc src/pk/asn1/der/sequence/der_encode_sequence_ex.bc -o src/pk/asn1/der/sequence/der_encode_sequence_ex.s
> ../../../build/Release+Asserts/bin/llvm-mc -filetype=obj src/pk/asn1/der/sequence/der_encode_sequence_ex.s -o src/pk/asn1/der/sequence/der_encode_sequence_ex.o
> src/pk/asn1/der/sequence/der_encode_sequence_ex.s:989:3: error: unexpected token at start of statement
> 18
>  ^
> make: *** [src/pk/asn1/der/sequence/der_encode_sequence_ex.o] Error 1
> ../../../build/Release+Asserts/bin/clang -emit-llvm  -c -I./testprof/ -I./src/headers/ -I../libtommath-0.42.0/ -Wall -Wsign-compare -W -Wshadow -Wno-unused-parameter -DLTC_SOURCE -O0 -DLTC_NO_ASM -DUSE_LTM -DLTM_DESC -o src/pk/asn1/der/sequence/der_encode_sequence_ex.bc src/pk/asn1/der/sequence/der_encode_sequence_ex.c
> ../../../build/Release+Asserts/bin/opt -reg2mem -load ../../../build/Release+Asserts/lib/LLVMobfuscation.so -flattening src/pk/asn1/der/sequence/der_encode_sequence_ex.bc -o src/pk/asn1/der/sequence/der_encode_sequence_ex.bc -stats
> ===-------------------------------------------------------------------------===
>                          ... Statistics Collected ...
> ===-------------------------------------------------------------------------===
> 
> 9 break-crit-edges - Number of blocks inserted
> 1 flattening       - Functions flattened
> 
> ../../../build/Release+Asserts/bin/llc src/pk/asn1/der/sequence/der_encode_sequence_ex.bc -o src/pk/asn1/der/sequence/der_encode_sequence_ex.s
> ../../../build/Release+Asserts/bin/llvm-mc -filetype=obj src/pk/asn1/der/sequence/der_encode_sequence_ex.s -o src/pk/asn1/der/sequence/der_encode_sequence_ex.o
> src/pk/asn1/der/sequence/der_encode_sequence_ex.s:989:3: error: unexpected token at start of statement
> 18
>  ^
> make: *** [src/pk/asn1/der/sequence/der_encode_sequence_ex.o] Error 1
> 
> 
> It is possible that the PassVerifier validate my pass but it fail in llvm-mc? (and why it try to compile 2 times the same file?)
> Any idea?
> 
> 
> Thx,
> Cheers
> 
> ps: I've attached the assembly source file and the bc file <der_encode_sequence_ex.s><der_encode_sequence_ex.bc>_______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list