-
Notifications
You must be signed in to change notification settings - Fork 151
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
GCC spills function call arguments into unaligned stack, causing a crash #241
Comments
This bug in MSYS seems to be related as well: msys2/MSYS2-packages#1209 |
This looks like it hits the linked GCC PR, yes. However from what I learned about |
This copy ctor for AVX Vector makes GCC allocate aligned stack memory for passing arguments. Refs: gh-241 Signed-off-by: Matthias Kretz <kretz@kde.org>
Define Vector::AsArg to be a const reference. The interleave functions already use AsArg. Refs: gh-241 Signed-off-by: Matthias Kretz <kretz@kde.org>
See original report for details: VcDevel/Vc#241 CCBUG:406209
Define Vector::AsArg to be a const reference. The interleave functions already use AsArg. Refs: VcDevelgh-241 Signed-off-by: Matthias Kretz <kretz@kde.org>
Define Vector::AsArg to be a const reference. The interleave functions already use AsArg. Refs: VcDevelgh-241 Signed-off-by: Matthias Kretz <kretz@kde.org>
Define Vector::AsArg to be a const reference. The interleave functions already use AsArg. Refs: VcDevelgh-241 Signed-off-by: Matthias Kretz <kretz@kde.org>
Hi, all!
I have a weird problem in Krita on Windows. It might be actually not Vc's problem, but GCC, but since I cannot reproduce it in a limited scope, I would like to ask your opinion on that.
Here in Krita we have Vc-optimized code that does blending of colors in 32-bit float color space. Here is the link to the source. There we use Vc::InterleavedMemoryWrapper for reading/writing interleaved pixels into local variables.
The problem happens in line 142, when we try to write pixels back into memory. It looks like GCC tries to de-inline some VC functions, and spills some variables into the stack (afaict, to fit calling conventions). GCC uses vmovaps for that, but the stack is not aligned, therefore the application crashes. Here is the assembly around the line:
I have found out that if I go to
avx\detail.h
and change allstatic inline
intostatic Vc_INTRINSIC
, then the problem goes away (there is no crash, at least in this very place). So it looks like the problem is really in doing the function call.It also looks like there is a related bugreport on GCC's bugzilla:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412
So the questions I would like to ask you:
The text was updated successfully, but these errors were encountered: