This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug inline-asm/20202] New: asm("movq %0, %mm0" : : "X"(*a)) generates invalid asm code
- From: "bero at arklinux dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Feb 2005 00:29:19 -0000
- Subject: [Bug inline-asm/20202] New: asm("movq %0, %mm0" : : "X"(*a)) generates invalid asm code
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Compiling the following code results in invalid asm:
#include <stdint.h>
typedef union {
int64_t q;
} __attribute__ ((aligned (8))) mmx_t;
int main(int argc, char **argv)
{
mmx_t a;
mmx_t *b=&a;
__asm__ __volatile__("movq %0, %%mm0" : : "X" (*b)); /* produces
invalid asm code */
}
The equivalent
#include <stdint.h>
typedef union {
int64_t q;
} __attribute__ ((aligned (8))) mmx_t;
int main(int argc, char **argv)
{
mmx_t a;
__asm__ __volatile__("movq %0, %%mm0" : : "X" (a)); /* works */
}
works.
The invalid asm code being generated is "movq %eax,%mm0".
--
Summary: asm("movq %0, %mm0" : : "X"(*a)) generates invalid asm
code
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: inline-asm
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bero at arklinux dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-ark-linux
GCC host triplet: i686-ark-linux
GCC target triplet: i686-ark-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20202