| Summary: | [PATCH] x86 regtest: fix clobber lists in generated asm statements | ||
|---|---|---|---|
| Product: | [Developer tools] valgrind | Reporter: | notasas |
| Component: | general | Assignee: | Paul Floyd <pjfloyd> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | pjfloyd |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | patch | ||
Done. commit 8b3d0828451f8e69e0eaf3807ffbe502aecda428 (HEAD -> master, origin/master, origin/HEAD, bug481131) Author: Gra??vydas Ignotas <notasas@gmail.com> Date: Fri Feb 9 19:02:23 2024 +0200 x86 regtest: fix clobber lists in generated asm statements Must add result registers also, or else code like this is generated: asm( "fsave %3\n" "movl %2, %%eax\n" "cdq\n" "movl %%edx, %0\n" "movl %%eax, %1\n" "frstor %3\n" "cld\n" : "=m" (result0), "=m" (result1) : "m" (preset0), "m" (state[0]) : "eax" ); This crashes on my machine because gcc places some pointer in %%edx. |
Created attachment 165704 [details] patch Must add result registers also, or else code like this is generated: asm( "fsave %3\n" "movl %2, %%eax\n" "cdq\n" "movl %%edx, %0\n" "movl %%eax, %1\n" "frstor %3\n" "cld\n" : "=m" (result0), "=m" (result1) : "m" (preset0), "m" (state[0]) : "eax" ); This crashes on my machine because gcc places some pointer in %%edx.