[Bug target/110260] Multiple applications misbehave at runtime when compiled with -march=znver4

2023-06-15 Thread zfigura at codeweavers dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110260

--- Comment #11 from Zebediah Figura  ---
(In reply to Alexander Monakov from comment #10)
> Right, those are different issues. Any chance of a standalone testcase
> extracted from Wine? If you already see a function where stack realignment
> is missing, just give us preprocessed containing source, full gcc command
> line, and output of 'gcc -v', as described on https://gcc.gnu.org/bugs/
> 
> (please open a new bug with that, and mention the new bug # here)

I've filed bug 110273 for the Wine misaligned stack problem.

[Bug target/110260] Multiple applications misbehave at runtime when compiled with -march=znver4

2023-06-15 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110260

--- Comment #10 from Alexander Monakov  ---
Right, those are different issues. Any chance of a standalone testcase
extracted from Wine? If you already see a function where stack realignment is
missing, just give us preprocessed containing source, full gcc command line,
and output of 'gcc -v', as described on https://gcc.gnu.org/bugs/

(please open a new bug with that, and mention the new bug # here)

[Bug target/110260] Multiple applications misbehave at runtime when compiled with -march=znver4

2023-06-15 Thread zfigura at codeweavers dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110260

Zebediah Figura  changed:

   What|Removed |Added

 CC||zfigura at codeweavers dot com

--- Comment #9 from Zebediah Figura  ---
Wine developer here—FWIW, I think these may ultimately be separate issues.

The problem we were seeing with Wine is that, on the i386-w64-mingw32 target,
the stack alignment is supposed to be assumed to be only 4 (versus 16 on ELF or
x86_64 targets), and so any function using SSE/AVX instructions needs to
manually align the stack. In the cases where Wine was crashing, gcc was
generating vmovdqa instructions without actually aligning the stack first,
whereas without the -march=znver4 flag it apparently would align the stack and
then generate SSE movdqa.

[Bug target/110260] Multiple applications misbehave at runtime when compiled with -march=znver4

2023-06-15 Thread chiitoo at gentoo dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110260

--- Comment #8 from Jimi Huotari  ---
Looks like with '-mno-avx512f' the issues go away for me.

As a sidey-note, this seems to also possibly affect KWin desktop effects
(animated ones at least), which don't seem to be doing their thing (haven't
been using them so had not noticed until trying now).  Have not yet confirmed
that that is related though.

[Bug target/110260] Multiple applications misbehave at runtime when compiled with -march=znver4

2023-06-15 Thread chiitoo at gentoo dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110260

Jimi Huotari  changed:

   What|Removed |Added

Summary|Multiple applications   |Multiple applications
   |misbehave when compiled |misbehave at runtime when
   |with -march=znver4  |compiled with -march=znver4

--- Comment #7 from Jimi Huotari  ---
(In reply to Alexander Monakov from comment #6)
> (In reply to Jimi Huotari from comment #0)
> > (By the by, is ADCX a typo of ADX?  I see -madx as an option but only one
> > use of it otherwise, and no -adcx as an option and lots of mentions of it...
> > but perhaps I'm not reading them correct-like.)
> 
> ADX is an x86 extension that adds two new instructions, ADCX and ADOX:
> https://en.wikipedia.org/wiki/Intel_ADX


Ah!  Thank you.


(In reply to Alexander Monakov from comment #4)
> Um, sched1 is not enabled on x86 so -fno-schedule-insns does nothing — you
> probably meant -fno-schedule-insns2?
> 
> Another thing to try is -fstack-reuse=none, as indicated by comment #1.


So far things look no different with either one or both of these set.  I'll
test more as time permits, and see if I can find any better test-cases, and
will also look into those bug reports mentioned here.

In the initial report, being in a bit of a rush, I forgot to actually describe
the issues here (instead of just linking), so I'll do that here at least a bit.

KWin: This one show up so that I'm unable to move any window past the top and
left borders of the screen(s), and the also behave in a weird way when trying
to push them past them, and then resizing them, making the adjustment 'jump' a
lot at once.  This also makes the LXQt panel behave in strange ways when set to
these locations; it will not animate automatic hiding of it, and it acts as if
it's always visible, even when hidden (so if clicking something below it, while
hiding, the click still goes onto the panel even if it's supposed to be
hiding).

Wine: There are issues with stack alignment leading to application crashes
triggered after a change made to the Wine code [1].

1.
https://source.winehq.org/git/wine.git/commitdiff/62173699c38453777c7d5638ed2e779790506b75