This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Don't change the same inputs several times in match_asm_constraints_1 (PR inline-asm/35160)
On Tue, 12 Feb 2008, Richard Guenther wrote:
> On Feb 12, 2008 4:44 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> > --- gcc/testsuite/gcc.target/i386/pr35160.c.jj 2008-02-12 11:04:48.000000000 +0100
> > +++ gcc/testsuite/gcc.target/i386/pr35160.c 2008-02-12 11:04:23.000000000 +0100
> > @@ -0,0 +1,31 @@
> > +/* PR inline-asm/35160 */
> > +/* { dg-do run } */
> > +/* { dg-options "-O2" } */
> > +
> > +extern void abort (void);
> > +
> > +void
> > +__attribute__((noinline))
> > +foo (unsigned int *y)
> > +{
> > + unsigned int c0, c1, c2, d0, d1, d2;
> > + d0 = 0; d1 = 0; d2 = 0; c0 = c1 = c2 = 0;
> > +
> > + __asm__ ("movl $7, %k0; movl $8, %k1; movl $9, %k2"
> > + : "+r" (d0), "+r" (d1), "+r" (d2));
> > + __asm__ ("movl %3, %0; movl %4, %1; movl %5, %2"
> > + : "+r" (c0), "+r" (c1), "+r" (c2), "+r" (d0), "+r" (d1), "+r" (d2));
> > + y[0] = c0;
> > + y[1] = c1;
> > + y[2] = c2;
> > +}
> > +
> > +int
> > +main (void)
> > +{
> > + unsigned int y[3];
> > + foo (y);
> > + if (y[0] != 7 || y[1] != 8 || y[2] != 9)
> > + abort ();
> > + return 0;
> > +}
Hi Jakub,
I'm seeing an error with -fpic from your new testcase:
http://gcc.gnu.org/ml/gcc-testresults/2008-02/msg00876.html
.../gcc.target/i386/pr35160.c:16: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
.../gcc.target/i386/pr35160.c:14: error: 'asm' operand has impossible constraints
.../gcc.target/i386/pr35160.c:16: error: 'asm' operand has impossible constraints
Would you please adjust the test to work with -fpic, or if appropriate use
the "dg-require-effective-target nonpic" command?
Thanks,
--Kaveh
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu