r/cpp • u/ThadeeusMaximus • 6d ago
How can we get MSVC to actually test their compiler?
It seems like every update to MSVC over the past year has had some sort of massive basic compiler regression, that the team refuses to actually hotfix because regressions are not actually considered problematic. What can we do to change this and actually make regressions fixable without waiting 6+ months? Having "LTS" compilers isn't useful when every LTS compiler has some break in it.
Using older compilers isn't an option, because we're an open source library that people use, and also GitHub Action runners automatically update to the newest compilers and don't make it easy to use old ones.
This is our new one from this time.
102
u/STL MSVC STL Dev 6d ago
Build your code with VS Insiders' MSVC Build Tools Preview and promptly report bugs with self-contained test cases (ideally minimal, but self-contained is sufficient), following https://aka.ms/compilercrash . Don't wait until the general availability release. Fixing stuff during Preview is easiest, and fixes will appear in the next preview in 1-2 weeks. If you wait until GA, then yeah, it's going to be 6 months until the next GA. Or we have to backport the fix in servicing, which we can do, but it might take about a month to ship, and it's very time-consuming due to the paperwork and validation involved, which directly eats at our ability to fix a larger total volume of bugs.
If you have a popular open-source library that's constantly encountering toolset regressions, then we can consider adding it to our "Real World Code" test suite. (RWC is expensive in terms of time and machine resources for us to run, which is why we have thresholds for what we're willing to add.)
7
u/fortsnek274 6d ago
citation needed
But let me provide one: https://developercommunity.visualstudio.com/t/Regression-in-MSVC-1952:-x64-O2-miscom/11185575
Occasionally, you see bugs like that show up, and you just wonder.
48
u/MarkSuckerZerg 6d ago
Last time I reported a fatal bug (not crash, but infinite loop) in MSVC toolchain, I made a mistake of disclosing I have a workaround in the bug report ("if I do 'X' instead of 'Y', it works as expected").
They used that against me and told me it's low prio since there is a workaround. I reported it in 2024 and fix happened sometimes in VS 2026
19
u/mguid65 6d ago
There have been bugs in MSVC I've found in the past that their compiler devs told me would not be fixed, not because they couldn't but because they would break ABI.
43
u/CrasseMaximum 6d ago
Last time I reported a regression it's been fixed the next day. If you provide a proper example reproducing your issue it will likely be fixed quickly.
14
u/holyblackcat 6d ago
As others have said, switch to Clang. We recently switched at work, and got faster binaries and faster compilation. (Fun fact, we found that clang built with clang works faster than clang built with gcc.)
60
u/Zero_Owl 6d ago
We can start by telling exactly what is wrong instead of some general accusations which lead nowhere.
6
u/ack_error 6d ago
I got it down to this min repro, on latest preview (x64 14.52.37032.0)... took forever to dig through all of the template machinery. Looks like some bug between the inliner and autovectorizer.
11
u/jesseschalken 6d ago
This sub is not the MSVC team, use the previous version or clang-cl.
6
u/Dragdu 6d ago
Option 1: Be a big enough library to be in their "OSS test suite" (if that's still a thing, given MS's general demeanor as of late).
Option 2: Have significant social media following so the shitstorm reaches their PMs and they will personally interfere to get your issue fixed.
Option 3: Pay them $$$ for their substandard compiler, so that your bug reports get prioritized.
3
u/ozyx7 6d ago
If you have specific examples, perhaps you could write and provide test cases for them to run?
3
u/eboys 6d ago
MSVC is a compiler I don't take seriously. Switch to clang-cl and forget it
2
u/ImNoRickyBalboa 6d ago
That's embarrassing 😳
2
u/hanotak 6d ago
Switch to CLang.
2
u/robstoon 6d ago
Ever hear the saying fool me once, shame on you, fool me twice, shame on me? MSVC has been fooling people for literally decades. Use a different compiler.
1
u/feverzsj 6d ago
Sooner or later you gonna switch to clang on windows.
1
u/13steinj 6d ago
No, stop using Microsoft products? They can't stop screwing up their own operating system and cloud services, you think they will care about their C++ compiler when internally they're generally Rust and LLM -pilled if you speak to any connections off the record?
Unironically, I think you'll get better results convincing whatever your industry is to invest in using mingw / clangw. Potentially even in switching to Linux. This isn't claiming that you'll get your customers to switch to Linux easily. Just that you'll have difficulty in having MS have their compiler anywhere near the quality of GCC/Clang.
1
u/Zeh_Matt No, no, no, no 6d ago
I would love to know this too, its such an annoyance when the CI suddenly starts failing on vcpkg packages that were perfectly fine before and now one has to wait for the project to either work around the issue and then have someone get it updated on vcpkg OR wait for the compiler fix and then have that also deployed on all runners. I wish they would just drop it and make clang the default.
Edit: The failing library in question is openal-soft.
Edit 2: As of this post the latest commit is https://github.com/kcat/openal-soft/commit/2934c1bb6a2501a7c6af08f297d25884111074be which is just another one of those "MSVC workarounds", its quite pathetic at this point.
1
u/Rob-190 6d ago
I've found Microsoft to be incredibly helpful when I've reported problems. Yes, you do need to be very clear what the problem is and ideally provide an example that shows the issue, which can sometimes take a lot of effort. I don't think people should be complaining. Microsoft give us an amazing compiler, with an IDE that's far better than anything else that's available, and to all intents and purposes, it's FREE.
-1
u/WoodyTheWorker 6d ago
I wonder if they fixed an old bug with const qualifiers, and at this point I'm afraid to ask, and I don't really care anymore.
0
u/[deleted] 6d ago
[deleted] — view deleted comment