[Bug inline-asm/66631] inability to clobber segment regs makes tls problematic

2018-02-09 Thread stsp at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66631 Stas Sergeev changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug inline-asm/66631] inability to clobber segment regs makes tls problematic

2015-08-12 Thread stsp at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66631 --- Comment #18 from Stas Sergeev --- (In reply to Andy Lutomirski from comment #17) > I'll chime in, possibly uselessly. > > Before Linux 4.1, only CS was saved. (Unless you go *way* back.) In 4.1 > or newer, SS is saved, too. > > In 64-bit

[Bug inline-asm/66631] inability to clobber segment regs makes tls problematic

2015-08-12 Thread luto at mit dot edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66631 Andy Lutomirski changed: What|Removed |Added CC||luto at mit dot edu --- Comment #17 fr

[Bug inline-asm/66631] inability to clobber segment regs makes tls problematic

2015-06-23 Thread stsp at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66631 --- Comment #16 from Stas Sergeev --- Actually, Andrew, do you think this is even TLS specific? No segregs are restored at all (not even DS, I was wrong saying it is), so is it guaranteed, if FS is restored by some other means, that gcc will not

[Bug inline-asm/66631] inability to clobber segment regs makes tls problematic

2015-06-22 Thread stsp at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66631 --- Comment #15 from Stas Sergeev --- (In reply to Andrew Pinski from comment #13) > Those all have pure assembly code to handle this case. No, they actually simply don't use TLS in a handler. That's something I'll be looking into too to save me

[Bug inline-asm/66631] inability to clobber segment regs makes tls problematic

2015-06-22 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66631 --- Comment #13 from Andrew Pinski --- (In reply to Stas Sergeev from comment #11) > (In reply to Andrew Pinski from comment #9) > > Clang is not GCC. Really you should not be using the fs segment register > > for your own use as it is part of t

[Bug inline-asm/66631] inability to clobber segment regs makes tls problematic

2015-06-22 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66631 --- Comment #14 from Andrew Pinski --- (In reply to Stas Sergeev from comment #12) > Note that on x86_64 you can't set FS without a syscall. > I would really hate doing that in asm it seems. Yes because you are setting the TLS segment. Again wh

[Bug inline-asm/66631] inability to clobber segment regs makes tls problematic

2015-06-22 Thread stsp at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66631 --- Comment #12 from Stas Sergeev --- Note that on x86_64 you can't set FS without a syscall. I would really hate doing that in asm it seems.

[Bug inline-asm/66631] inability to clobber segment regs makes tls problematic

2015-06-22 Thread stsp at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66631 --- Comment #11 from Stas Sergeev --- (In reply to Andrew Pinski from comment #9) > Clang is not GCC. Really you should not be using the fs segment register > for your own use as it is part of the ABI that is the TLS segment. Any > other use it

[Bug inline-asm/66631] inability to clobber segment regs makes tls problematic

2015-06-22 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66631 --- Comment #10 from Andrew Pinski --- Also why can't you write your segfault handler in assembly when you fixup the fs segment and then call the C functions?

[Bug inline-asm/66631] inability to clobber segment regs makes tls problematic

2015-06-22 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66631 --- Comment #9 from Andrew Pinski --- (In reply to Stas Sergeev from comment #7) > (In reply to Andrew Pinski from comment #6) > > (In reply to Stas Sergeev from comment #5) > > > (In reply to Andrew Pinski from comment #4) > > > > (In reply to S

[Bug inline-asm/66631] inability to clobber segment regs makes tls problematic

2015-06-22 Thread stsp at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66631 --- Comment #8 from Stas Sergeev --- Note that O0 and O1 are fine. Only O2 gives the problem. So there might be a simple solution somewhere!

[Bug inline-asm/66631] inability to clobber segment regs makes tls problematic

2015-06-22 Thread stsp at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66631 --- Comment #7 from Stas Sergeev --- (In reply to Andrew Pinski from comment #6) > (In reply to Stas Sergeev from comment #5) > > (In reply to Andrew Pinski from comment #4) > > > (In reply to Stas Sergeev from comment #3) > > > > The signal hand

[Bug inline-asm/66631] inability to clobber segment regs makes tls problematic

2015-06-22 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66631 --- Comment #6 from Andrew Pinski --- (In reply to Stas Sergeev from comment #5) > (In reply to Andrew Pinski from comment #4) > > (In reply to Stas Sergeev from comment #3) > > > The signal handler needs to do the following things: > > > 1. Rest

[Bug inline-asm/66631] inability to clobber segment regs makes tls problematic

2015-06-22 Thread stsp at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66631 --- Comment #5 from Stas Sergeev --- (In reply to Andrew Pinski from comment #4) > (In reply to Stas Sergeev from comment #3) > > The signal handler needs to do the following things: > > 1. Restore segment registers (init_handler() func) > > Why

[Bug inline-asm/66631] inability to clobber segment regs makes tls problematic

2015-06-22 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66631 --- Comment #4 from Andrew Pinski --- (In reply to Stas Sergeev from comment #3) > The signal handler needs to do the following things: > 1. Restore segment registers (init_handler() func) Why are you doing this, that is the question I am trying

[Bug inline-asm/66631] inability to clobber segment regs makes tls problematic

2015-06-22 Thread stsp at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66631 --- Comment #3 from Stas Sergeev --- The signal handler needs to do the following things: 1. Restore segment registers (init_handler() func) 2. Increment thread-local var (fault_cnt) 3. Do stuff including reads of fault_cnt var Being thread-loca

[Bug inline-asm/66631] inability to clobber segment regs makes tls problematic

2015-06-22 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66631 --- Comment #2 from Andrew Pinski --- Can you better describe your use case because this is not obvious what you are trying to achieve here.

[Bug inline-asm/66631] inability to clobber segment regs makes tls problematic

2015-06-22 Thread stsp at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66631 --- Comment #1 from Stas Sergeev --- Please note that the shown code was generated with gcc-4.8.2, but inability to clobber segreg with inline asm was tested with gcc-5.1.1. A bit of dissonance here, I can't do both tests with similar gcc. Is th