[llvm] r208689 - ARMEB: Fix byte order of EH frame unwinding instructions
Christian Pirker
cpirker at a-bix.com
Tue May 13 09:59:18 PDT 2014
Hi Rafael,
I gave a modified test file to Aaron to test it on his windows
environment and it passed.
Therefore I committed the patch again as r208711.
Thanks,
Christian
On 05/13/14 17:27, Rafael EspĂndola wrote:
> I reverted in r208704.
>
> On 13 May 2014 10:38, Timur Iskhodzhanov <timurrrr at google.com> wrote:
>> On ARM bot too
>> http://lab.llvm.org:8011/builders/clang-native-arm-cortex-a9/builds/18388
>>
>>
>> 2014-05-13 16:59 GMT+04:00 Aaron Ballman <aaron at aaronballman.com>:
>>
>>> This test is currently failing for me on Windows (MSVC built).
>>>
>>> 20> FAIL: LLVM :: CodeGen/ARM/big-endian-eh-unwind.ll (936 of 10743)
>>> 20> ******************** TEST 'LLVM ::
>>> CodeGen/ARM/big-endian-eh-unwind.ll' FAILED ********************
>>> 20> Script:
>>> 20> --
>>> 20> E:/llvm/2013/Debug/bin\llc.EXE -march armeb -mattr v7 -filetype
>>> obj -o - E:\llvm\llvm\test\CodeGen\ARM\big-endian-eh-unwind.ll |
>>> E:/llvm/2013/Debug/bin\llvm-objdump.EXE -s - |
>>> E:/llvm/2013/Debug/bin\FileCheck.EXE
>>> E:\llvm\llvm\test\CodeGen\ARM\big-endian-eh-unwind.ll
>>> 20> --
>>> 20> Exit Code: 2
>>> 20>
>>> 20> Command Output (stdout):
>>> 20> --
>>> 20> Command 0: "E:/llvm/2013/Debug/bin\llc.EXE" "-march" "armeb"
>>> "-mattr" "v7" "-filetype" "obj" "-o" "-"
>>> "E:\llvm\llvm\test\CodeGen\ARM\big-endian-eh-unwind.ll"
>>> 20> Command 0 Result: 1
>>> 20> Command 0 Output:
>>> 20>
>>> 20>
>>> 20> Command 0 Stderr:
>>> 20>CUSTOMBUILD : LLVM error : CPU: 'generic' does not support ARM mode
>>> execution!
>>> 20>
>>> 20> Stack dump:
>>> 20>
>>> 20> 0. Program arguments: E:/llvm/2013/Debug/bin\llc.EXE -march armeb
>>> -mattr v7 -filetype obj -o -
>>> E:\llvm\llvm\test\CodeGen\ARM\big-endian-eh-unwind.ll
>>> 20>
>>> 20>
>>> 20>
>>> 20> Command 1: "E:/llvm/2013/Debug/bin\llvm-objdump.EXE" "-s" "-"
>>> 20> Command 1 Result: 0
>>> 20> Command 1 Output:
>>> 20>
>>> 20>
>>> 20> Command 1 Stderr:
>>> 20> E:/llvm/2013/Debug/bin\llvm-objdump.EXE: '-': The file was not
>>> recognized as a valid object file.
>>> 20>
>>> 20>
>>> 20>
>>> 20> Command 2: "E:/llvm/2013/Debug/bin\FileCheck.EXE"
>>> "E:\llvm\llvm\test\CodeGen\ARM\big-endian-eh-unwind.ll"
>>> 20> Command 2 Result: 2
>>> 20> Command 2 Output:
>>> 20>
>>> 20>
>>> 20> Command 2 Stderr:
>>> 20>CUSTOMBUILD : FileCheck error : '-' is empty.
>>> 20>
>>> 20>
>>> 20>
>>> 20>
>>> 20> --
>>> 20>
>>> 20> ********************
>>>
>>> ~Aaron
>>>
>>> On Tue, May 13, 2014 at 7:41 AM, Christian Pirker <cpirker at a-bix.com>
>>> wrote:
>>>> Author: cpirker
>>>> Date: Tue May 13 06:41:49 2014
>>>> New Revision: 208689
>>>>
>>>> URL: http://llvm.org/viewvc/llvm-project?rev=208689&view=rev
>>>> Log:
>>>> ARMEB: Fix byte order of EH frame unwinding instructions
>>>>
>>>> Added:
>>>> llvm/trunk/test/CodeGen/ARM/big-endian-eh-unwind.ll
>>>> Modified:
>>>> llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
>>>>
>>>> Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
>>>> URL:
>>>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp?rev=208689&r1=208688&r2=208689&view=diff
>>>>
>>>> ==============================================================================
>>>> --- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp (original)
>>>> +++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp Tue May 13
>>>> 06:41:49 2014
>>>> @@ -1137,8 +1137,11 @@ void ARMELFStreamer::emitFnEnd() {
>>>> "Compact model must use __aeabi_cpp_unwind_pr0 as
>>>> personality");
>>>> assert(Opcodes.size() == 4u &&
>>>> "Unwind opcode size for __aeabi_cpp_unwind_pr0 must be equal
>>>> to 4");
>>>> - EmitBytes(StringRef(reinterpret_cast<const char*>(Opcodes.data()),
>>>> - Opcodes.size()));
>>>> + uint64_t Intval = Opcodes[0] |
>>>> + Opcodes[1] << 8 |
>>>> + Opcodes[2] << 16 |
>>>> + Opcodes[3] << 24;
>>>> + EmitIntValue(Intval, Opcodes.size());
>>>> }
>>>>
>>>> // Switch to the section containing FnStart
>>>> @@ -1210,8 +1213,15 @@ void ARMELFStreamer::FlushUnwindOpcodes(
>>>> }
>>>>
>>>> // Emit unwind opcodes
>>>> - EmitBytes(StringRef(reinterpret_cast<const char *>(Opcodes.data()),
>>>> - Opcodes.size()));
>>>> + assert((Opcodes.size() % 4) == 0 &&
>>>> + "Unwind opcode size for __aeabi_cpp_unwind_pr0 must be
>>>> multiple of 4");
>>>> + for (unsigned I = 0; I != Opcodes.size(); I += 4) {
>>>> + uint64_t Intval = Opcodes[I] |
>>>> + Opcodes[I + 1] << 8 |
>>>> + Opcodes[I + 2] << 16 |
>>>> + Opcodes[I + 3] << 24;
>>>> + EmitIntValue(Intval, 4);
>>>> + }
>>>>
>>>> // According to ARM EHABI section 9.2, if the
>>>> __aeabi_unwind_cpp_pr1() or
>>>> // __aeabi_unwind_cpp_pr2() is used, then the handler data must be
>>>> emitted
>>>>
>>>> Added: llvm/trunk/test/CodeGen/ARM/big-endian-eh-unwind.ll
>>>> URL:
>>>> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/big-endian-eh-unwind.ll?rev=208689&view=auto
>>>>
>>>> ==============================================================================
>>>> --- llvm/trunk/test/CodeGen/ARM/big-endian-eh-unwind.ll (added)
>>>> +++ llvm/trunk/test/CodeGen/ARM/big-endian-eh-unwind.ll Tue May 13
>>>> 06:41:49 2014
>>>> @@ -0,0 +1,73 @@
>>>> +; RUN: llc -march armeb -mattr v7 -filetype obj -o - %s | llvm-objdump
>>>> -s - | FileCheck %s
>>>> +
>>>> +; ARM EHABI for big endian
>>>> +; This test case checks whether frame unwinding instructions are laid
>>>> out in big endian format.
>>>> +;
>>>> +; This is the LLVM assembly generated from following C++ code:
>>>> +;
>>>> +; extern void foo(int);
>>>> +; void test(int a, int b) {
>>>> +; try {
>>>> +; foo(a);
>>>> +; } catch (...) {
>>>> +; foo(b);
>>>> +; }
>>>> +;}
>>>> +
>>>> +define void @_Z4testii(i32 %a, i32 %b) #0 {
>>>> +entry:
>>>> + invoke void @_Z3fooi(i32 %a)
>>>> + to label %try.cont unwind label %lpad
>>>> +
>>>> +lpad: ; preds = %entry
>>>> + %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)*
>>>> @__gxx_personality_v0 to i8*)
>>>> + catch i8* null
>>>> + %1 = extractvalue { i8*, i32 } %0, 0
>>>> + %2 = tail call i8* @__cxa_begin_catch(i8* %1) #2
>>>> + invoke void @_Z3fooi(i32 %b)
>>>> + to label %invoke.cont2 unwind label %lpad1
>>>> +
>>>> +invoke.cont2: ; preds = %lpad
>>>> + tail call void @__cxa_end_catch()
>>>> + br label %try.cont
>>>> +
>>>> +try.cont: ; preds = %entry,
>>>> %invoke.cont2
>>>> + ret void
>>>> +
>>>> +lpad1: ; preds = %lpad
>>>> + %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)*
>>>> @__gxx_personality_v0 to i8*)
>>>> + cleanup
>>>> + invoke void @__cxa_end_catch()
>>>> + to label %eh.resume unwind label %terminate.lpad
>>>> +
>>>> +eh.resume: ; preds = %lpad1
>>>> + resume { i8*, i32 } %3
>>>> +
>>>> +terminate.lpad: ; preds = %lpad1
>>>> + %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)*
>>>> @__gxx_personality_v0 to i8*)
>>>> + catch i8* null
>>>> + %5 = extractvalue { i8*, i32 } %4, 0
>>>> + tail call void @__clang_call_terminate(i8* %5) #3
>>>> + unreachable
>>>> +}
>>>> +
>>>> +declare void @_Z3fooi(i32) #0
>>>> +
>>>> +declare i32 @__gxx_personality_v0(...)
>>>> +
>>>> +declare i8* @__cxa_begin_catch(i8*)
>>>> +
>>>> +declare void @__cxa_end_catch()
>>>> +
>>>> +; Function Attrs: noinline noreturn nounwind
>>>> +define linkonce_odr hidden void @__clang_call_terminate(i8*) #1 {
>>>> + %2 = tail call i8* @__cxa_begin_catch(i8* %0) #2
>>>> + tail call void @_ZSt9terminatev() #3
>>>> + unreachable
>>>> +}
>>>> +
>>>> +declare void @_ZSt9terminatev()
>>>> +
>>>> +; CHECK-LABEL: Contents of section .ARM.extab:
>>>> +; CHECK-NEXT: 0000 00000000 00b0b0b0
>>>> +
>>>>
>>>>
>>>> _______________________________________________
>>>> llvm-commits mailing list
>>>> llvm-commits at cs.uiuc.edu
>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
More information about the llvm-commits
mailing list