This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: fix pr21419
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 25 Sep 2005 14:44:54 +0200
- Subject: Re: fix pr21419
- References: <433699C1.4060405@lu.unisi.ch>
Paolo Bonzini wrote:
This fixes PR21419 by checking that read-only expressions are not given
as outputs for an asm statement. The gimplifier was already performed
consistency tests on asm statements, so this looked like a good place to
make this check.
Sorry for following up. I just found PR21420, so I propose checking in
this testcase instead.
/* { dg-do compile } */
const int i = 0;
void f(void)
{
__asm__ __volatile__ ("" : "=m" (i)); /* { dg-error "invalid lvalue" } */
}
void g(const int set)
{
__asm__ __volatile__ ("" : "=r" (set)); /* { dg-error "invalid
lvalue" } */
}
Paolo