This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug inline-asm/36639] New: pointer referenced in asm statement not regarded as VUSE
- From: "aoliva at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Jun 2008 02:08:44 -0000
- Subject: [Bug inline-asm/36639] New: pointer referenced in asm statement not regarded as VUSE
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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