This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Bug inline-asm/36639] New: pointer referenced in asm statement not regarded as VUSE


This is correct as you are just using the address and not the contents itself. This is how inline-asm is documented to work also.

-- Andrew Pinski

Sent from my iPhone

On Jun 25, 2008, at 19:08, "aoliva at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org > wrote:

This is originally derived from code from Linux, in which the physical address
of a structure is passed to an asm statement as an integral type, causing the
initializer of the structure to be optimized away.


int main() { int i = 0x12345678; long j = (long)&i; asm ("# %0" : : "r" (j)); }

int main() { int i = 0x12345678; void *j = &i; asm ("#" : : "p" (j)); }

At the very least in the second case above, the compiler should mark the asm
statement as a VUSE of i. Arguably, it should do so in the former case as
well, like it does for pointers passed to function calls as integral types.



--
Summary: pointer referenced in asm statement not regarded as VUSE
Product: gcc
Version: 4.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: inline-asm
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: aoliva at gcc dot gnu dot org
GCC build triplet: *-*-*
GCC host triplet: *-*-*
GCC target triplet: *-*-*



http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36639




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]