WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
308660
Regression(
302941@main
): inline asm in WTF::opaque() needs to be volatile.
https://bugs.webkit.org/show_bug.cgi?id=308660
Summary
Regression(302941@main): inline asm in WTF::opaque() needs to be volatile.
Mark Lam
Reported
2026-02-25 12:09:25 PST
Otherwise, compiler optimizations may elide or relocate the asm statement. See
https://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/Extended-Asm.html
: ``` If an asm has output operands, GCC assumes for optimization purposes the instruction has no side effects except to change the output operands. This does not mean instructions with a side effect cannot be used, but you must be careful, because the compiler may eliminate them if the output operands aren't used, or move them out of loops, or replace two with one if they constitute a common subexpression. Also, if your instruction does have a side effect on a variable that otherwise appears not to change, the old value of the variable may be reused later if it happens to be found in a register. You can prevent an asm instruction from being deleted by writing the keyword volatile after the asm. For example: #define get_and_set_priority(new) \ ({ int __old; \ asm volatile ("get_and_set_priority %0, %1" \ : "=g" (__old) : "g" (new)); \ __old; }) ```
Attachments
Add attachment
proposed patch, testcase, etc.
Mark Lam
Comment 1
2026-02-25 12:09:48 PST
rdar://171189396
Mark Lam
Comment 2
2026-02-25 12:17:47 PST
Pull request:
https://github.com/WebKit/WebKit/pull/59441
EWS
Comment 3
2026-02-25 16:34:31 PST
Committed
308243@main
(9f672ca021c2): <
https://commits.webkit.org/308243@main
> Reviewed commits have been landed. Closing PR #59441 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug