Summary: | frstor in assembler inline offsets in memory by 4 | ||
---|---|---|---|
Product: | gcc | Reporter: | stian |
Component: | c | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED INVALID | ||
Severity: | critical | CC: | gcc-bugs, solar |
Priority: | P2 | ||
Version: | 3.3.2 | ||
Target Milestone: | --- | ||
Host: | x86-linux-gnu | Target: | x86-linux-gnu |
Build: | x86-linux-gnu | Known to work: | |
Known to fail: | Last reconfirmed: |
Description
stian
2004-06-09 20:38:55 UTC
Are you saying when you run this program locks up your computer if so this is not a gcc bug. It locks my computer yes, but when I compiled using -S flag and looked at the assembler output, the fsave and frstore is not given the same offset in the stackframe. fsave is -124(%ebp) while frstor is -128(%ebp). Not a gcc bug. *pasting disassembled result* Handler: pushl %ebp movl %esp, %ebp subl $136, %esp leal -120(%ebp), %eax movl %eax, -124(%ebp) #APP fsave -124(%ebp) #NO_APP subl $4, %esp pushl $1 pushl $.LC0 pushl $2 call write addl $16, %esp leal -120(%ebp), %eax movl %eax, -128(%ebp) #APP frstor -128(%ebp) #NO_APP leave ret the frstor and fsave does not appear to feed with the same address if you ask me. So you meen that the offsets to ebp should differ? (the kernel lock is just a side effect of this I believe) You most likely want: __asm__ __volatile__ ("fsave %0\n" : : "m"(*fpubuf)); and not what you have. Likewise for the frstor, other wise you are passing the address of fpubuf. Thanks for the respons. Seems to be harder to get up the eyes of the kernel people, since the floating point exceptions inside that signal handler fucks up the current linux-kernels. Haven't got any respons from any of the kernel developers yet. A bit scary I think. But a big thanks to you atleast for given this some attention. |