LLVM ERROR : Invalid instruction

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

LLVM ERROR : Invalid instruction

Abhinash Jain
#include <string>
#include <string.h>
#include <iostream>
#include <stdio.h>
using namespace std;

void foo(string str)
{
}
int main()
{
string str="aa";
foo(str);
return 0;
}

1. clang++ -c -emit-llvm foo.cpp -o foo.ll
2. llc -march=cpp -o foo.ll.cpp foo.ll   (at the execution of this command its giving an error as "Invalid Instruction")

May I know why is it failing on step 2. ???
Reply | Threaded
Open this post in threaded view
|

Re: LLVM ERROR : Invalid instruction

Jim Grosbach
Looks like the CPP backend doesn’t know how to deal with exception handling. It’s complaining that it can’t handle a landingpad instruction.

-Jim

On Jul 26, 2013, at 1:49 PM, Abhinash Jain <[hidden email]> wrote:

#include <string>
#include <string.h>
#include <iostream>
#include <stdio.h>
using namespace std;

void foo(string str)
{
}
int main()
{
string str="aa";
foo(str);
return 0;
}

1. clang++ -c -emit-llvm foo.cpp -o foo.ll
2. llc -march=cpp -o foo.ll.cpp foo.ll   (at the execution of this command
its giving an error as "Invalid Instruction")

May I know why is it failing on step 2. ???



--
View this message in context: http://llvm.1065342.n5.nabble.com/LLVM-ERROR-Invalid-instruction-tp59856.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: LLVM ERROR : Invalid instruction

Abhinash Jain
@Jim Grosbach,
 
Is there anyway to resolve it???
Reply | Threaded
Open this post in threaded view
|

Re: LLVM ERROR : Invalid instruction

Stephen Checkoway

On Jul 26, 2013, at 6:48 PM, Abhinash Jain <[hidden email]> wrote:

> Is there anyway to resolve it???


1. Teach the cpp backend how to handle it.
2. Compile with -fno-exceptions to turn off exceptions.

--
Stephen Checkoway





_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: LLVM ERROR : Invalid instruction

Jim Grosbach

On Jul 26, 2013, at 4:03 PM, Stephen Checkoway <[hidden email]> wrote:


On Jul 26, 2013, at 6:48 PM, Abhinash Jain <[hidden email]> wrote:

Is there anyway to resolve it???


1. Teach the cpp backend how to handle it.
2. Compile with -fno-exceptions to turn off exceptions.


Yep.

-- 
Stephen Checkoway





_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev