On Thu, Sep 10, 2026 at 07:00:57PM +0800, H.J. Lu wrote:
> On Thu, Sep 10, 2026 at 6:44 PM H.J. Lu <[email protected]> wrote:
> >
> > On Thu, Sep 10, 2026 at 5:28 PM Stefan Schulze Frielinghaus
> > <[email protected]> wrote:
> > >
> > > On Thu, Sep 10, 2026 at 05:00:03PM +0800, H.J. Lu wrote:
> > > > On Thu, Sep 10, 2026 at 4:25 PM Stefan Schulze Frielinghaus
> > > > <[email protected]> wrote:
> > > > >
> > > > > From: Stefan Schulze Frielinghaus <[email protected]>
> > > > >
> > > > > Initially asm-hard-reg-2.c was intended to be considered only on 
> > > > > 64-bit
> > > > > x86.  Commit r16-3110 restricted this to { ! ia32 } which still 
> > > > > includes
> > > > > the test for i?86 ILP32 for which we get "warning: unsupported size 
> > > > > for
> > > >
> > > > I couldn't reproduce this.  I got
> > > >
> > > > UNSUPPORTED: gcc.dg/asm-hard-reg-2.c
> > > >
> > > > for Linux/i686.   How did you test for Linux/i686?
> > >
> > > My typical workflow is to use crosstool-ng in order to come up with a
> > > sysroot for my cross.  I used configuration i686-ubuntu16.04-linux-gnu
> > > from crosstool-ng in order to build gcc with
> > > --target=i686-ubuntu16.04-linux-gnu --with-build-sysroot=$SYSROOT_DIR
> > >
> > > $ make check-gcc RUNTESTFLAGS="dg.exp=asm-hard-reg-2.c"
> > > ...
> > > FAIL: gcc.dg/asm-hard-reg-2.c (test for excess errors)
> > >
> > > Log file contains:
> > > Target is i686-ubuntu16.04-linux-gnu
> > > ...
> > > FAIL: gcc.dg/asm-hard-reg-2.c (test for excess errors)
> > > Excess errors:
> > > /devel/gcc/src/gcc/testsuite/gcc.dg/asm-hard-reg-2.c:24:27: error: 
> > > expected '(' before 'GPR'
> > > /devel/gcc/src/gcc/testsuite/gcc.dg/asm-hard-reg-2.c:31:27: error: 
> > > expected '(' before 'GPR'
> > >
> > > So the test is still run for me.  If #define GPR is moved outside of the
> > > if x86_64, then I get
> > >
> > > FAIL: gcc.dg/asm-hard-reg-2.c (test for excess errors)
> > > Excess errors:
> > > /devel/gcc/src/gcc/testsuite/gcc.dg/asm-hard-reg-2.c:27:1: warning: 
> > > unsupported size for integer register
> > > /devel/gcc/src/gcc/testsuite/gcc.dg/asm-hard-reg-2.c:34:1: warning: 
> > > unsupported size for integer register
> > >
> > > Maybe my cross setup is broken then?
> >
> > { ! ia32 } works with native compiler, but not with cross compiler.
> >
> 
> The "target" directive doesn't work correctly for cross compilers.
> "target lp64" works by accident here since it always returns false for
> cross compilers.

Uhh, I see.  In that case I remove the x86 part from this patch.  I will
keep this in mind as well as what Rainer said and stick with { x86 && {
! ia32 } } in case of future tests.  Cross compiling is an art on its
own.  Thank you very much for pointing this out!

Cheers,
Stefan

Reply via email to