------- Comment #4 from ubizjak at gmail dot com  2008-02-26 22:59 -------
(In reply to comment #3)

> That seems too complicated for a simple diagnostics test. Moreover, I couldn't
> find a single example of that in the testsuite. Why not simply?

What about this:

--cut here--
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-Wall" } */

register int * volatile x asm ("ebx"); /* { dg-warning "optimization may
eliminate reads and/or writes to register variables" } */
--cut here--

This will work for all x86 targets. We already have a couple of generic tests
that are tested on x86 only (gcc.dg/register-var-1.c for example), so one more
won't hurt. And it will surely get enough coverage.


-- 


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

Reply via email to