When this function is compiled with -O, it works. When it's compiled without -O,
it reports error "error: can't find a register in class `GENERAL_REGS' while
reloading `asm'".

I think that syntactic corectness of language shouldn't depend on optimization
flags --- it should either report error in both cases or always succeed.

void f(char *p)
{
        asm volatile
(""::"m"(p[0]),"m"(p[0]),"m"(p[0]),"m"(p[0]),"m"(p[0]),"m"(p[0]),"m"(p[0]),"m"(p[0]));
}

-- 
           Summary: Complilation success depends on optimization being used
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mikulas at artax dot karlin dot mff dot cuni dot cz
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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

Reply via email to