This is the mail archive of the
mailing list for the GCC project.
inline asm clobbers
- From: David Wohlferd <dw at LimeGreenSocks dot com>
- To: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Wed, 11 Mar 2015 15:58:32 -0700
- Subject: inline asm clobbers
- Authentication-results: sourceware.org; auth=none
Why does gcc allow you to specify clobbers using numbers:
asm ("" : : "r" (var) : "0"); // i386: clobbers eax
How is this better than using register names?
This makes even less sense when you realize that (apparently) the
indices of registers aren't fixed. Which means there is no way to know
which register you have clobbered in order to use it in the template.
Having just seen someone trying (unsuccessfully) to use this, it seems
like there is no practical way you can.
Which makes me wonder why it's there. And whether it still should be.