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

Fix problems with GCC optimization and cMake #73

Merged
merged 4 commits into from
Jan 9, 2023

Conversation

Xeratec
Copy link
Member

@Xeratec Xeratec commented Dec 10, 2022

Changelog

I noticed that GCCs tree-loop-distribute-patterns optimization can lead to infinite loops and stack overflows. This was tested with banshee simulations.

Further, the custom memcpy and memset implementation in software/runtime/string.c is sometimes swapped out with the GCC built-in function. However, this tends to lead to cause some bytes not to be copied if the number of bytes is at multiple of 4.

Finally, when using cMake with GCC, the configuration steps can fail because install/riscv-gcc/riscv32-unknown-elf/lib/riscv.ld is missing.

Fixed

  • After building GCC, copy riscv.ld required for cMake to install folder
  • Disable GCC tree-loop-distribute-patterns optimizations causing stack overflows
  • Disable problematic GCC memset and memcpy built-in functions

Checklist

  • Automated tests pass
  • Changelog updated
  • Code style guideline is observed

Xeratec and others added 3 commits December 28, 2022 18:04
- Copy missing riscv.ld file to gcc riscv32-unknown-elf library folder
  This is required for cMake to successfully perform the auto configuration
- Disabled tree-loop-distribute-patterns, builtin-memcpy, builtin-memset
@Xeratec Xeratec requested a review from suehtamacv December 30, 2022 15:22
Copy link
Member

@SamuelRiedel SamuelRiedel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

@SamuelRiedel SamuelRiedel merged commit 3f00262 into pulp-platform:main Jan 9, 2023
@Xeratec Xeratec deleted the fix/make branch January 11, 2023 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants