{"action":"created","issue":{"url":"https://api.github.com/repos/avr-llvm/llvm/issues/150","labels_url":"https://api.github.com/repos/avr-llvm/llvm/issues/150/labels{/name}","comments_url":"https://api.github.com/repos/avr-llvm/llvm/issues/150/comments","events_url":"https://api.github.com/repos/avr-llvm/llvm/issues/150/events","html_url":"https://github.com/avr-llvm/llvm/issues/150","id":100411114,"number":150,"title":"sbiw, adiw require a CPU feature not currently enabled","user":{"login":"seanmkauffman","id":11034033,"avatar_url":"https://avatars.githubusercontent.com/u/11034033?v=3","gravatar_id":"","url":"https://api.github.com/users/seanmkauffman","html_url":"https://github.com/seanmkauffman","followers_url":"https://api.github.com/users/seanmkauffman/followers","following_url":"https://api.github.com/users/seanmkauffman/following{/other_user}","gists_url":"https://api.github.com/users/seanmkauffman/gists{/gist_id}","starred_url":"https://api.github.com/users/seanmkauffman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanmkauffman/subscriptions","organizations_url":"https://api.github.com/users/seanmkauffman/orgs","repos_url":"https://api.github.com/users/seanmkauffman/repos","events_url":"https://api.github.com/users/seanmkauffman/events{/privacy}","received_events_url":"https://api.github.com/users/seanmkauffman/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"dylanmckay","id":7722159,"avatar_url":"https://avatars.githubusercontent.com/u/7722159?v=3","gravatar_id":"","url":"https://api.github.com/users/dylanmckay","html_url":"https://github.com/dylanmckay","followers_url":"https://api.github.com/users/dylanmckay/followers","following_url":"https://api.github.com/users/dylanmckay/following{/other_user}","gists_url":"https://api.github.com/users/dylanmckay/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanmckay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanmckay/subscriptions","organizations_url":"https://api.github.com/users/dylanmckay/orgs","repos_url":"https://api.github.com/users/dylanmckay/repos","events_url":"https://api.github.com/users/dylanmckay/events{/privacy}","received_events_url":"https://api.github.com/users/dylanmckay/received_events","type":"User","site_admin":false},"milestone":null,"comments":9,"created_at":"2015-08-11T21:02:05Z","updated_at":"2015-08-18T11:31:11Z","closed_at":"2015-08-18T02:53:46Z","body":"I built the latest version of AVR LLVM, which has come a long way in the last couple of months, but I'm running into an issue compiling to object code with a source file I'm using.\r\n\r\nI can generate assembly from the file using the AVR LLVM backend, but I can't reduce it to object code using the AVR LLVM tools.  If I try to go directly from the IR, I get a very unhelpful `LLVM ERROR: expected relocatable expression` with no indication of what is causing it.  If I try to use llvm-mc to assemble the .s file, I get errors about sbiw and adiw requiring a CPU feature not currently enabled.\r\n\r\n```\r\n$ ~/workspace/avr-work/bin/clang -O0 --target=avr-none-none -emit-llvm -I/usr/avr/include/ -S aes.c -o aes.ll\r\n$ ~/workspace/avr-work/bin/llc -mtriple=avr-none -mcpu=atmega2560 -filetype=obj aes.ll -o aes.o \r\nLLVM ERROR: expected relocatable expression\r\n $ ~/workspace/avr-work/bin/llc -mtriple=avr-none -mcpu=atmega2560 -filetype=asm aes.ll -o aes.s\r\n $ ~/workspace/avr-work/bin/llvm-mc -triple=avr-none -mcpu=atmega2560 -filetype=obj aes.s -o aes.o\r\naes.s:22:2: error: instruction requires a CPU feature not currently enabled\r\n        sbiw    r28, 24\r\n        ^\r\naes.s:243:2: error: instruction requires a CPU feature not currently enabled\r\n        adiw    r28, 24\r\n        ^\r\naes.s:1507:2: error: instruction requires a CPU feature not currently enabled\r\n        sbiw    r30, 32\r\n        ^\r\naes.s:1938:2: error: instruction requires a CPU feature not currently enabled\r\n        sbiw    r30, 32\r\n        ^\r\naes.s:2088:2: error: instruction requires a CPU feature not currently enabled\r\n        sbiw    r28, 42\r\n        ^\r\naes.s:7258:2: error: instruction requires a CPU feature not currently enabled\r\n        adiw    r28, 42\r\n        ^\r\naes.s:7287:2: error: instruction requires a CPU feature not currently enabled\r\n        sbiw    r28, 42\r\n        ^\r\naes.s:12457:2: error: instruction requires a CPU feature not currently enabled\r\n        adiw    r28, 42\r\n        ^\r\n```\r\n\r\n(note I'm glossing over some warnings generated by clang, but those are related to the program, not to this project)\r\n\r\nI'm opening this issue in the hopes that this problem is not enormously complicated to solve.  I'd love to provide more information for debugging purposes.  I'm really not sure how to isolate this into a simpler test case.  [The source file in question can be found here](https://github.com/embecosm/mibench/blob/master/security/rijndael/aes.c)"},"comment":{"url":"https://api.github.com/repos/avr-llvm/llvm/issues/comments/132181507","html_url":"https://github.com/avr-llvm/llvm/issues/150#issuecomment-132181507","issue_url":"https://api.github.com/repos/avr-llvm/llvm/issues/150","id":132181507,"user":{"login":"agnat","id":137545,"avatar_url":"https://avatars.githubusercontent.com/u/137545?v=3","gravatar_id":"","url":"https://api.github.com/users/agnat","html_url":"https://github.com/agnat","followers_url":"https://api.github.com/users/agnat/followers","following_url":"https://api.github.com/users/agnat/following{/other_user}","gists_url":"https://api.github.com/users/agnat/gists{/gist_id}","starred_url":"https://api.github.com/users/agnat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agnat/subscriptions","organizations_url":"https://api.github.com/users/agnat/orgs","repos_url":"https://api.github.com/users/agnat/repos","events_url":"https://api.github.com/users/agnat/events{/privacy}","received_events_url":"https://api.github.com/users/agnat/received_events","type":"User","site_admin":false},"created_at":"2015-08-18T11:31:11Z","updated_at":"2015-08-18T11:31:11Z","body":"Hehe... use branches... like _always_ ;)\r\n\r\n> Feel free to review the commit however :)\r\n\r\nWow. I'll give it a read. :)"}}