We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
the following code segfaults on any optimization level besides -O0:
#include "stdio.h" int main() { printf("enter1\n"); unsigned int i, sum = 0; for (i = 10; i >= 0; --i) { sum += i; } printf("sum = %u\n", sum); }
repro:
~ $ clang --version Ubuntu clang version 14.0.0-1ubuntu1.1 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin ~ $ clang -O1 bug.c -o bug && ./bug enter1 Segmentation fault (core dumped)
probably related: #60622
The text was updated successfully, but these errors were encountered:
note that with the first print statement removed, the program simply terminates without doing anything.
#include "stdio.h" int main() { unsigned int i, sum = 0; for (i = 10; i >= 0; --i) { sum += i; } printf("sum = %u\n", sum); }
Sorry, something went wrong.
Could you please try 19 or main branch? https://godbolt.org should be helpful.
main
Only most recent release is maintained.
same behavior. i've included IR output to help
https://godbolt.org/z/1WjPKrf7h
Non-trivial infinite loops are UB: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2809r3.html If you want the infinite loop behaves as is (i.e., get stuck without segfaults), please use the trivial form: https://godbolt.org/z/K8rxrEPrM
No branches or pull requests
the following code segfaults on any optimization level besides -O0:
repro:
probably related: #60622
The text was updated successfully, but these errors were encountered: