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

32-bit-only misoptimization of printf calls on Windows #62762

Closed
CaseyCarter opened this issue May 17, 2023 · 1 comment
Closed

32-bit-only misoptimization of printf calls on Windows #62762

CaseyCarter opened this issue May 17, 2023 · 1 comment

Comments

@CaseyCarter
Copy link
Member

This program:

#include <stdio.h>
#include <stdlib.h>

int main() {
    for (int i = 0; i < 32; ++i) {
        printf("%u ", rand());
    }
    printf("\n");
}

prints 32 copies of the same integer value when compiled with optimization in an x86 Visual Studio 2022 17.7 Preview 1 command prompt (clang -O1 repro.c -o repro.exe). Note that this is the first VS preview to include Clang 16, specifically LLVM-16.0.1. Clang 15.0.1 included in the box with VS 2022 17.6 correctly compiles the program with and without optimization targeting either x64 or x86.

@CaseyCarter CaseyCarter added clang Clang issues not falling into any other category regression platform:win32 labels May 17, 2023
@CaseyCarter
Copy link
Member Author

Bah, false alarm: whatever the issue is, it's fixed in 16.0.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants