-
Notifications
You must be signed in to change notification settings - Fork 215
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
[NFC] W/A GCC maybe-uninitialized warning #2588
Conversation
Signed-off-by: Sidorov, Dmitry <dmitry.sidorov@intel.com>
lib/SPIRV/SPIRVWriter.cpp
Outdated
@@ -4385,9 +4385,12 @@ SPIRVValue *LLVMToSPIRVBase::transIntrinsicInst(IntrinsicInst *II, | |||
Extracts[Idx] = BM->addVectorExtractDynamicInst( | |||
VecSVal, BM->addIntegerConstant(I32STy, Idx), BB); | |||
} | |||
assert(Extracts[0] && "Uninitialized Extracts of vector reduce lowering"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or should it be check for vecsize? Technically possible nullptr is also an initialization
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Best to check that VecSize > 0
indeed, but we have to do that with an if
; assertions won't help in release builds.
Signed-off-by: Sidorov, Dmitry <dmitry.sidorov@intel.com>
New patch new GCC warning. @svenvh I expect even more as for out-of-tree build of LLVM GCC won't see LLVM sources to make a correct judgment. Would it makes sense to disable this warning? On the other hand fixing them all would enhance the code base in a sense of not trusting LLVM's API outputs. |
I'm quite surprised why this is suddenly happening; both the failing builds and the last passing build report "The CXX compiler identification is GNU 9.4.0". If it's not too much effort, it would be nice to fix all of the warnings. On your latest patch the build made it to 88% so hopefully it's not much more to fix. |
Me too. Locally I'm building out-of-tree as well, but I don't see any warnings. |
I can reproduce something locally at least, with GCC 9.4.0 and Funny enough I'm only getting the DenseMap warnings; not the warning that you're fixing with this PR. |
Perhaps it's an issue with older gcc versions. Let's see what happens with #2589 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can merge this now and decide how to proceed with the remaining failures perhaps.
No description provided.