-
Notifications
You must be signed in to change notification settings - Fork 303
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
Codegen error with upstream gcc #170
Comments
Seems like you already did 90% of the work, thanks :)... I'll take it from here. |
|
Should be fixed; thanks again for narrowing it down. |
FWIW This issue still exists in: github.com/riscv-software-src/riscv-tools version. |
If you are encountering the error described earlier in this chain you should be able to directly apply the changes posted by @cliffordwolf above to riscv-pk/util/string.c and it should fix it (it worked for me at least). Or find a more updated version that includes the changes (if it is the same problem). HTH |
Sorry for dropping a not completely debugged issue here, but I have to context switch to another task and I wanted to post what I have found so far so other may take over.
I'm building riscv-pk with upstream gcc ("trunk" from git://gcc.gnu.org/git/gcc.git). In gcc commit 98125d0d3 they enabled the
tree-loop-distribute-patterns
optimizer in-O2
, which breaks pk for me.With
tree-loop-distribute-patterns
:And without
tree-loop-distribute-patterns
:Adding the following pragmas to
riscv-pk/util/string.c
fixes the issue for me.Probably all that's missing now is staring at this code for a while to figure out what unintended UB the compiler exploits here, but I'm out of time for now..
The text was updated successfully, but these errors were encountered: