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

problem:when i run a sample program #55

Open
weizixangzone opened this issue May 18, 2015 · 3 comments
Open

problem:when i run a sample program #55

weizixangzone opened this issue May 18, 2015 · 3 comments
Assignees
Labels

Comments

@weizixangzone
Copy link

Hi,when i write a sample program:

include<stdio.h>

int main()
{
printf("hello,world!\n");
return 0 ;
}
I used the cmd “arm-linux-gcc test.c -o test1
Then i ran it with: ./fracture-cl -mattr=v6 ~/test1
sym .text
dec 0x83d0 (the main 's symbol address )
and the result is :
BB#0: derived from LLVM BB %"$a+0"
%R12 = MOVr %SP, pred:14, pred:%noreg, opt:%noreg; dbg::33744
%SP<def,tied1> = STMDB_UPD %SP, pred:14, pred:%noreg, %R11, %R12, %LR, %PC; mem:ST4 dbg::33748
%R11 = SUBri %R12, 4, pred:14, pred:%noreg, opt:%noreg; dbg::33752
%R0 = LDRi12 %PC, 12, pred:14, pred:%noreg; mem:LD4 dbg::33756
BL -292, %LR, %SP; dbg::33760
%R3 = MOVi 0, pred:14, pred:%noreg, opt:%noreg; dbg::33764
%R0 = MOVr %R3, pred:14, pred:%noreg, opt:%noreg; dbg::33768
LDMIA %SP, pred:14, pred:%noreg, %R11, %SP, %PC; mem:LD4 dbg::33772
fracture-cl: ValueTypes.cpp:183: llvm::Type llvm::EVT::getTypeForEVT(llvm::LLVMContext &) const: Assertion `isExtended() && "Type is not extended!"' failed.
0 fracture-cl 0x0000000001bafeae llvm::sys::PrintStackTrace(IO_FILE) + 46
1 fracture-cl 0x0000000001bb018b
2 fracture-cl 0x0000000001bb18ae
3 libpthread.so.0 0x00007fee13e2d340
4 libc.so.6 0x00007fee12e41cc9 gsignal + 57
5 libc.so.6 0x00007fee12e450d8 abort + 328
6 libc.so.6 0x00007fee12e3ab86
7 libc.so.6 0x00007fee12e3ac32
8 fracture-cl 0x0000000001ab0fbe llvm::EVT::getTypeForEVT(llvm::LLVMContext&) const + 174
9 fracture-cl 0x00000000011c2767 llvm::SelectionDAG::getEVTAlignment(llvm::EVT) const + 135
10 fracture-cl 0x00000000011e3a17 llvm::SelectionDAG::getLoad(llvm::ISD::MemIndexedMode, llvm::ISD::LoadExtType, llvm::EVT, llvm::SDLoc, llvm::SDValue, llvm::SDValue, llvm::SDValue, llvm::MachinePointerInfo, llvm::EVT, bool, bool, bool, unsigned int, llvm::MDNode const
, llvm::MDNode const_) + 359
11 fracture-cl 0x00000000011e4cb8 llvm::SelectionDAG::getLoad(llvm::EVT, llvm::SDLoc, llvm::SDValue, llvm::SDValue, llvm::MachinePointerInfo, bool, bool, bool, unsigned int, llvm::MDNode const_, llvm::MDNode const_) + 456
12 fracture-cl 0x0000000000739cfe fracture::ARMInvISelDAG::InvLoadOrStoreMultiple(llvm::SDNode_, bool, bool, bool, bool) + 2174
13 fracture-cl 0x0000000000738cc8 fracture::ARMInvISelDAG::Transmogrify(llvm::SDNode_) + 7224
14 fracture-cl 0x00000000006f5e5b fracture::Decompiler::decompileBasicBlock(llvm::MachineBasicBlock_, llvm::Function_) + 811
15 fracture-cl 0x00000000006f4f89 fracture::Decompiler::decompileFunction(unsigned int) + 937
16 fracture-cl 0x00000000006f46ed fracture::Decompiler::decompile(unsigned int) + 77
17 fracture-cl 0x00000000006d6298
18 fracture-cl 0x00000000006f4195 CmdExprAST::Codegen() + 373
19 fracture-cl 0x00000000006ef6b2 Commands::handleCommandLine() + 130
20 fracture-cl 0x00000000006ef762 Commands::runShell(std::string) + 162
21 fracture-cl 0x00000000006d4dfd main + 1197
22 libc.so.6 0x00007fee12e2cec5 __libc_start_main + 245
23 fracture-cl 0x00000000006d2999
Stack dump:
0. Program arguments: ./fracture-cl -mattr=v6 /home/wy/test1
Aborted (core dumped)

@rtc-draper
Copy link
Collaborator

Looks like the instruction is being decoded but the Ld instruction being generated is using a bad type.

Thanks for the bug report!

@weizixangzone
Copy link
Author

i found this BUG is ARM cross-compiler version's problem.i tried the ARM cross-compiler 4.4.3, the problem is solved. thank you so much for your reply .

@rtc-draper
Copy link
Collaborator

I think the version of the compiler is not producing the instruction that has the bug. I'm going to leave this open so we can check when we get the opportunity.

Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants