Comments (3)
I tried manually executing all compilation steps. I.e. use patmos-clang
to compile to bitcode and patmos-llc
to compile to machine code. When llc
is given the -O0
flag, the above assertion error is thrown. But if it is given -O1
, -O2
, or -O3
the compilation will succeed, but the execution will return the wrong result. E.g. when given the input 10 55
it returns 55
instead of 1050
.
from patmos-llvm.
The same problem is seen when goto breakLoops
is replaced by a return x
. (the programs are equivalent)
from patmos-llvm.
Trying to continue
an outer loop from an inner nested loop also given error. Take the following program, where we emulate continue
using a goto
:
#include <stdio.h>
int init_func(int pre, int inner, int post){
int x = 0, y = 0, z = 0;
outer_loop:
#pragma loopbound min 0 max 9
while(x < pre){
x++;
#pragma loopbound min 0 max 9
for(int i = 0; i < inner; i++){
y++;
if(z >= post){
goto outer_loop; //Continue outer loop
}
}
z++;
}
return (x*10000) + (y*10) + z;
}
int main(){
int pre, inner, post;
scanf("%d %d %d", &pre, &inner, &post);
printf("%d\n", init_func(pre, inner, post));
}
It compiles successfully and when run with the input 1 9 1
it correctly outputs 10091
. But, given the input 1 10 1
we would expect the output 10101
but get 10000
. I.e. only when the second input integer is at the loop bound (10
) does it execute incorrectly.
from patmos-llvm.
Related Issues (19)
- patmos-clang always links libraries HOT 3
- ARM related HOT 6
- singlepath: singlepath crashes when divide is used and compiled from bitcode HOT 3
- patmos-clang: cannot bundle two immediate adds in assembly HOT 2
- Singlepath: unbounded loops produce non-singlepath code
- assembly: invalid `bcopy` parsing HOT 1
- Singlepath: wrong execution when returning from loop
- SinglePath/SPScope breaks build on macOS HOT 10
- Extract Platin into its own repository HOT 2
- Doesn't compile on MacOs HOT 4
- Question: multiply takes a different number of cycles based on input HOT 1
- Function splitter accepts inline assembly blocks larger than subfunction size HOT 1
- Remove MachineModulePass from LLVM HOT 3
- -mpatmos-subfunction-align flag doesn't seem to work HOT 1
- Remove use of '@code' symbol type for subfunctions HOT 1
- Endianess set wrong HOT 4
- patmos-clang crash HOT 2
- Handling unresolved calls in PML HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from patmos-llvm.