This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: fix pr21419


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]