This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/20645] New: Complilation success depends on optimization being used
- From: "mikulas at artax dot karlin dot mff dot cuni dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Mar 2005 23:40:29 -0000
- Subject: [Bug c/20645] New: Complilation success depends on optimization being used
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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