Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong code(armv6) generated for armv5 #28981

Closed
kraj opened this issue Jul 19, 2016 · 10 comments
Closed

wrong code(armv6) generated for armv5 #28981

kraj opened this issue Jul 19, 2016 · 10 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla clang:codegen

Comments

@kraj
Copy link
Contributor

kraj commented Jul 19, 2016

Bugzilla Link 28607
Resolution FIXED
Resolved on Aug 02, 2016 05:26
Version 3.9
OS Linux
Blocks #28974
Attachments test case
CC @rengolin

Extended Description

When attached program is compiled it generated ssat instruction which is armv6 instruction. Its not caught by internal assembler either. Only GNU assembler is able to flag it.

arm-oe-linux-musleabi-clang --sysroot=/mnt/oe/openembedded-core/build1/tmp-musl/sysroots/qemuarm -march=armv5e -marm -mlittle-endian -no-integrated-as a.c -c -O2

@kraj
Copy link
Contributor Author

kraj commented Jul 19, 2016

assigned to @rengolin

@kraj
Copy link
Contributor Author

kraj commented Jul 19, 2016

error message is

/tmp/kraj02/a-6653ef.s: Assembler messages:
/tmp/kraj02/a-6653ef.s:50: Error: selected processor does not support ssat r5,#16,r5 in ARM mode
clang-3.9: error: assembler command failed with exit code 1 (use -v to see invocation)

This is happening in few packages on Linux
gmp/alsa-lib/orc/mesa which are failing with exact same error. armv6 and armv7 works ok.

@kraj
Copy link
Contributor Author

kraj commented Jul 19, 2016

here are detailed error messages from packages

http://errors.yoctoproject.org/Errors/Build/18430/

@rengolin
Copy link
Member

Hi Khem,

I'm not getting the SSAT instructions, can you provide the output of:

arm-oe-linux-musleabi-clang --sysroot=/mnt/oe/openembedded-core/build1/tmp-musl/sysroots/qemuarm -march=armv5e -marm -mlittle-endian -S -emit-llvm a.c -O2

thanks,
--renato

@rengolin
Copy link
Member

Btw, the fix should be simple, regardless of you IR. I'm working on it.

@kraj
Copy link
Contributor Author

kraj commented Jul 19, 2016

I have able to reproduce it with

./tmp-musl/sysroots/x86_64-linux/usr/bin/clang -target armv5e-linux -march=armv5e -marm -mlittle-endian -no-integrated-as ~/a.c -S -O2

as well. The key is -no-integrated-as and -O2, I am on 3.9 branch as of yesterday.
but I have seen it on master too.

@kraj
Copy link
Contributor Author

kraj commented Jul 19, 2016

ll IR

@rengolin
Copy link
Member

Should be fixed in r276701. This is simple and important enough to go back into 3.9. I'll back-port it.

@rengolin
Copy link
Member

rengolin commented Aug 2, 2016

Backported to 3.9 branch, will appear in RC2.

@smithp35
Copy link
Collaborator

mentioned in issue llvm/llvm-bugzilla-archive#39947

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang:codegen
Projects
None yet
Development

No branches or pull requests

3 participants