This is an archive of the discontinued LLVM Phabricator instance.

Fix Android clear_cache ASM
ClosedPublic

Authored by angelsl on Oct 27 2015, 6:35 AM.

Diff Detail

Event Timeline

angelsl updated this revision to Diff 38537.Oct 27 2015, 6:35 AM
angelsl retitled this revision from to Fix Android clear_cache ASM.
angelsl updated this object.
angelsl added a reviewer: compnerd.
angelsl added subscribers: llvm-commits, compnerd.
compnerd edited edge metadata.Oct 27 2015, 8:01 AM

This seems incorrect. There is an argument to the call. Why do you think that this change is needed?

This seems incorrect. There is an argument to the call. Why do you think that this change is needed?

.../build/src/compiler-rt/lib/builtins/clear_cache.c: In function '__clear_cache':
.../build/src/compiler-rt/lib/builtins/clear_cache.c:106:9: error: asm-specifier for variable 'start_reg' conflicts with asm clobber list
         __asm __volatile("svc 0x0" : "=r"(start_reg)
         ^
.../build/src/compiler-rt/lib/builtins/clear_cache.c:106:9: error: asm-specifier for variable 'start_reg' conflicts with asm clobber list
.../build/obj/arm-linux-androideabi/rt/compiler-rt/triple/builtins/armv7/SubDir.lib__builtins/clear_cache.o] Error 1

I believe the compiler takes into account r0 being changed/clobbered, since it's already in the output register list.

Ah, wrapping on a phone made it look like you were modifying the input parameters, not the clobbers list. What are you seeing that error with? Ive not seen it with clang nor gcc.

Ah, wrapping on a phone made it look like you were modifying the input parameters, not the clobbers list. What are you seeing that error with? Ive not seen it with clang nor gcc.

GCC 4.8 in the Android NDK.

The person who made this change reportedly made it after it failed on Clang too. Not sure exactly. I'll try with Clang.

Clang 3.7 compiles the version GCC rejects fine.

But even with the clobber list removed, the output assembly is identical.

Would appreciate if someone took a look at this. Thanks.

Would appreciate it if someone reviewed this.

angelsl added a subscriber: samsonov.
compnerd accepted this revision.Feb 24 2016, 8:04 PM
compnerd edited edge metadata.

Seems that gcc 5.3.0 also will warn about this. Since this shouldn't effect the output, I think that this should be safe enough to merge.

This revision is now accepted and ready to land.Feb 24 2016, 8:04 PM

Please help me commit this. Thanks.

compnerd closed this revision.Feb 24 2016, 8:09 PM

SVN r261821.