public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* regression in simd-4.c on darwin6.1
@ 2002-10-11  9:05 Andreas Tobler
  2002-10-11 23:50 ` David Edelsohn
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Tobler @ 2002-10-11  9:05 UTC (permalink / raw)
  To: GCC

Introduced last night.

Thanks,
Andreas

/Volumes/xufs/gccsrc/gcc/gcc/testsuite/gcc.c-torture/compile/simd-4.c: 
In functi
on `tempf':^M
/Volumes/xufs/gccsrc/gcc/gcc/testsuite/gcc.c-torture/compile/simd-4.c:15: 
error:
  unable to find a register to spill in class `FLOAT_REGS'^M
/Volumes/xufs/gccsrc/gcc/gcc/testsuite/gcc.c-torture/compile/simd-4.c:15: 
error:
  this is the insn:^M
(insn:HI 120 97 129 0 0xdee330 (set (subreg:SF (reg:V4SF 5 r5 [130]) 12)^M
         (plus:SF (subreg:SF (reg:SI 13 r13 [124]) 0)^M
             (subreg:SF (reg:SI 66 ctr [129]) 0))) 169 {*rs6000.md:5157} 
(insn_li
st:REG_DEP_OUTPUT 97 (insn_list 26 (insn_list 16 (nil))))^M
     (expr_list:REG_DEAD (reg:SI 13 r13 [124])^M
         (expr_list:REG_DEAD (reg:SI 66 ctr [129])^M
             (nil))))^M
/Volumes/xufs/gccsrc/gcc/gcc/testsuite/gcc.c-torture/compile/simd-4.c:15: 
intern
al compiler error: in spill_failure, at reload1.c:1916^M
Please submit a full bug report,^M
with preprocessed source if appropriate.^M
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.^M

FAIL: gcc.c-torture/compile/simd-4.c,  -Os


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: regression in simd-4.c on darwin6.1
  2002-10-11  9:05 regression in simd-4.c on darwin6.1 Andreas Tobler
@ 2002-10-11 23:50 ` David Edelsohn
  2002-10-12 18:20   ` Aldy Hernandez
  2002-10-14 18:35   ` Geoff Keating
  0 siblings, 2 replies; 7+ messages in thread
From: David Edelsohn @ 2002-10-11 23:50 UTC (permalink / raw)
  To: Andreas Tobler, Stuart Hastings, Geoff Keating; +Cc: gcc

	This failure occurs on AIX (-O2, -O3, -Os) as well and was
introduced by the cse.c patch from Stuart.  The recent correction to the
patch removing the warning does not affect the failure.

David

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: regression in simd-4.c on darwin6.1
  2002-10-11 23:50 ` David Edelsohn
@ 2002-10-12 18:20   ` Aldy Hernandez
  2002-10-13  6:38     ` Andreas Tobler
  2002-10-14 18:35   ` Geoff Keating
  1 sibling, 1 reply; 7+ messages in thread
From: Aldy Hernandez @ 2002-10-12 18:20 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Andreas Tobler, Stuart Hastings, Geoff Keating, gcc

>>>>> "David" == David Edelsohn <dje@watson.ibm.com> writes:

 > 	This failure occurs on AIX (-O2, -O3, -Os) as well and was
 > introduced by the cse.c patch from Stuart.  The recent correction to the
 > patch removing the warning does not affect the failure.

It fails on linuxppc too.

I thought this patch was tested on darwin?

Aldy

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: regression in simd-4.c on darwin6.1
  2002-10-12 18:20   ` Aldy Hernandez
@ 2002-10-13  6:38     ` Andreas Tobler
  0 siblings, 0 replies; 7+ messages in thread
From: Andreas Tobler @ 2002-10-13  6:38 UTC (permalink / raw)
  To: Aldy Hernandez; +Cc: David Edelsohn, Stuart Hastings, Geoff Keating, gcc

Aldy Hernandez wrote:
>>>>>>"David" == David Edelsohn <dje@watson.ibm.com> writes:
> 
> 
>  > 	This failure occurs on AIX (-O2, -O3, -Os) as well and was
>  > introduced by the cse.c patch from Stuart.  The recent correction to the
>  > patch removing the warning does not affect the failure.
> 
> It fails on linuxppc too.
I can see the same, after a loooong compilation time on my 604/200:

FAIL: gcc.c-torture/compile/simd-4.c,  -O2
FAIL: gcc.c-torture/compile/simd-4.c,  -O3 -fomit-frame-pointer
FAIL: gcc.c-torture/compile/simd-4.c,  -O3 -g
FAIL: gcc.c-torture/compile/simd-4.c,  -Os

/home/andreas/gcc/gcc/testsuite/gcc.c-torture/compile/simd-4.c:15: 
error: unable to find a register to spill in class `FLOAT_REGS'^M
/home/andreas/gcc/gcc/testsuite/gcc.c-torture/compile/simd-4.c:15: 
error: this is the insn:^M
(insn:HI 120 97 129 0 0x3008a1c0 (set (subreg:SF (reg:V4SF 5 r5 [130]) 12)^M
         (plus:SF (subreg:SF (reg:SI 66 ctr [124]) 0)^M
             (subreg:SF (reg:SI 31 r31 [129]) 0))) 168 {*rs6000.md:5157} 
(insn_list:REG_DEP_OUTPUT 97 (insn_list 26 (insn_list 16 (nil))))^M 
(expr_list:REG_DEAD (reg:SI 66 ctr [124])^M        (expr_list:REG_DEAD 
(reg:SI 31 r31 [129])^M
             (nil))))^M
/home/andreas/gcc/gcc/testsuite/gcc.c-torture/compile/simd-4.c:15: 
internal compiler error: in spill_failure, at reload1.c:1916^MPlease 
submit a full bug report,^Mwith preprocessed source if appropriate.^M
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.^M


> 
> I thought this patch was tested on darwin?

Hm, I guess only bootstrapped....


It still fails as of yesterdays cvs.

Thanks,
Andreas

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: regression in simd-4.c on darwin6.1
  2002-10-11 23:50 ` David Edelsohn
  2002-10-12 18:20   ` Aldy Hernandez
@ 2002-10-14 18:35   ` Geoff Keating
  2002-10-15 16:02     ` Richard Henderson
  1 sibling, 1 reply; 7+ messages in thread
From: Geoff Keating @ 2002-10-14 18:35 UTC (permalink / raw)
  To: dje; +Cc: toa, stuart, gcc

> Cc: gcc@gcc.gnu.org
> Date: Fri, 11 Oct 2002 21:51:06 -0400
> From: David Edelsohn <dje@watson.ibm.com>

> 	This failure occurs on AIX (-O2, -O3, -Os) as well and was
> introduced by the cse.c patch from Stuart.  The recent correction to the
> patch removing the warning does not affect the failure.

On Darwin, it happens only at -Os, and it seems that the patch is
doing the right thing.  It's just that the patch changes the insn
sequence which changes register allocation.

The problematic instruction is:

(insn:HI 120 97 129 0 0xe24330 (set (subreg:SF (reg:V4SF 130) 12)
        (plus:SF (subreg:SF (reg:SI 124) 0)
            (subreg:SF (reg:SI 129) 0))) 169 {*rs6000.md:5157}
        (insn_list:REG_DEP_OUTPUT 97 (insn_list 26 (insn_list 16 (nil))))
    (expr_list:REG_DEAD (reg:SI 124)
        (expr_list:REG_DEAD (reg:SI 129)
            (nil))))

Reg-alloc can't put any of these into FP registers, because neither
vector modes nor SImode can go into FP registers.  So it picks integer
registers for r130 and r124, which is reasonable.

Less reasonably, r129 gets CTR, possibly because REGISTER_MOVE_COST
claims that it costs the same to move from CTR to a FP register as it
costs to move from a GPR to a FP register, which is not the case.

The insn gets these reloads:

Reload 0: FLOAT_REGS, RELOAD_FOR_OUTPUT (opnum = 0)
        reload_out_reg: (subreg:SF (reg:V4SF 5 r5 [130]) 12)
Reload 1: reload_in (SF) = (reg:SF 13 r13)
        FLOAT_REGS, RELOAD_FOR_INPUT (opnum = 1), can't combine
        reload_in_reg: (subreg:SF (reg:SI 13 r13 [124]) 0)
Reload 2: GENERAL_REGS, RELOAD_FOR_OTHER_ADDRESS (opnum = 2), can't
        combine, secondary_reload_p
Reload 3: reload_in (SI) = (reg:SI 66 ctr [129])
        reload_out (SF) = (reg:SF 8 r8)
        FLOAT_REGS, RELOAD_OTHER (opnum = 2)
        reload_in_reg: (reg:SI 66 ctr [129])
        reload_out_reg: (subreg:SF (reg:V4SF 5 r5 [130]) 12)
        secondary_in_reload = 2

The reload that fails is the last one.  It is asking for a SImode
reload into FLOAT_REGS.  This is impossible.  If it was asking for a
SFmode reload from CTR, that's impossible too.

The underlying problem is that reload can't cope with moves where
a mode change must happen in a secondary reload.  The correct sequence
here is like

(set GENERAL_REGS:SI COUNT_REGS:SI)
(set MEM:SI GENERAL_REGS:SI)  // or possibly SF with an appropriate SUBREG
(set FLOAT_REGS:SF MEM:SF)

A simple testcase which shows the problem (no vectors, breaks at -O0,
with or without Stuart's patch) is:

typedef union {
  float f;
  int i;
} fi;

int test(void)
{ 
  register fi a asm ("ctr");
  fi b, c;

  asm ("" : "=c" (a.i));
  asm ("" : "=r" (b.i));
  c.f = a.f + b.f;
  return c.i;
}

Entertainingly, if you make "c" be in CTR rather than "a", you get a
different failure that's probably a different bug.

-- 
- Geoffrey Keating <geoffk@geoffk.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: regression in simd-4.c on darwin6.1
  2002-10-14 18:35   ` Geoff Keating
@ 2002-10-15 16:02     ` Richard Henderson
  2002-10-15 18:32       ` Geoff Keating
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Henderson @ 2002-10-15 16:02 UTC (permalink / raw)
  To: Geoff Keating; +Cc: dje, toa, stuart, gcc

On Mon, Oct 14, 2002 at 04:29:29PM -0700, Geoff Keating wrote:
> The underlying problem is that reload can't cope with moves where
> a mode change must happen in a secondary reload.

See if http://gcc.gnu.org/ml/gcc-patches/2002-10/msg00633.html helps.


r~

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: regression in simd-4.c on darwin6.1
  2002-10-15 16:02     ` Richard Henderson
@ 2002-10-15 18:32       ` Geoff Keating
  0 siblings, 0 replies; 7+ messages in thread
From: Geoff Keating @ 2002-10-15 18:32 UTC (permalink / raw)
  To: rth; +Cc: dje, toa, stuart, gcc

> Date: Tue, 15 Oct 2002 15:19:12 -0700
> From: Richard Henderson <rth@redhat.com>
> Cc: dje@watson.ibm.com, toa@pop.agri.ch, stuart@apple.com, gcc@gcc.gnu.org

> On Mon, Oct 14, 2002 at 04:29:29PM -0700, Geoff Keating wrote:
> > The underlying problem is that reload can't cope with moves where
> > a mode change must happen in a secondary reload.
> 
> See if http://gcc.gnu.org/ml/gcc-patches/2002-10/msg00633.html helps.

I'm pretty sure that patch doesn't affect this problem.

-- 
- Geoffrey Keating <geoffk@geoffk.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-10-15 23:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-11  9:05 regression in simd-4.c on darwin6.1 Andreas Tobler
2002-10-11 23:50 ` David Edelsohn
2002-10-12 18:20   ` Aldy Hernandez
2002-10-13  6:38     ` Andreas Tobler
2002-10-14 18:35   ` Geoff Keating
2002-10-15 16:02     ` Richard Henderson
2002-10-15 18:32       ` Geoff Keating

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).