Compile the following with -O and compile fails with "Error: suffix or operands
invalid for `movq'". No problem is either __volatile__ or -O removed.
Compiles ok with gcc-3.2.3 or gcc-2.96.

Here is the test code:

#define mmx_r2m(op,reg,mem) \
        __asm__ __volatile__ (#op " %%" #reg ", %0" \
                              : "=X" (mem) \
                              : /* nothing */ )

#define movq_r2m(reg,var)       mmx_r2m (movq, reg, var)

void gcc_fulla_bugs(void)
{
        long long sumtop_accs;
        movq_r2m( mm0, *(&sumtop_accs) );
}


-- 
           Summary: asm volatile optimizes to invalid operands
           Product: gcc
           Version: 4.0.1
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jw203198 at hotmail dot com


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

Reply via email to