reload question - the compiler fails to find register to spill in a class

2008-01-10 Thread Tomer Benyamini
Hi,

I'm developing a gcc based compiler and in a certain scenario I get the 
following reload crash:
"error: unable to find a register to spill in class 'AB_REGS'"

I looked into it and it looks like it happens when all the AB_REGS registers 
are taken as function arguments, and the prefered class in a certain insn for a 
pseudo register is AB_REGS. This despite the fact that an alternative that 
includes GENERAL_REGS (r) has been chosen for that insn.

Why does reload crash and doesn't try to use other registers from GENERAL_REGS 
class?
What is the correct way to handle this problem?

Thanks,
Tomer


RE: Basic block infrastructure after dbr pass

2008-03-24 Thread Tomer Benyamini
Hi Boris,

The cfg is not updated during the dbr pass (you might have edges to 
non-existing blocks etc.). Furthermore, the BB rules do not apply after the dbr 
pass (you might have labels inside BBs and not only before the bb_note insn or 
jump-insns in the middle of the BB and not at BB_END).

What you might want to do is reconstruct the cfg after the dbr pass:
1. Clear existing edges using clear_edges ()
2. Split the BBs in case there's a label/jump insns in the middle of it (using 
split_block ())
3. Reconstruct edges between bbs using make_edge ()

This would create a new cfg and bb structure.

Hope this helps,
Tomer


-Original Message-
From: Richard Guenther [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 18, 2008 19:47
To: Boris Boesler
Cc: Jim Wilson; GCC
Subject: Re: Basic block infrastructure after dbr pass

On Tue, Mar 18, 2008 at 6:40 PM, Boris Boesler <[EMAIL PROTECTED]> wrote:
> Am 18.03.2008 um 16:21 schrieb Jim Wilson:
>
> > Boris Boesler wrote:
>  >>  The following code generators use FOR_EACH_BB[_REVERSE] in the
> >> target machine dependent reorg pass:
>  >> - bfin
>  >> - frv
>  >> - ia64
>  >> - mt
>  >> - s390
>  >
>  > The very first thing that ia64_reorg does is
>  >   compute_bb_for_insn ();
>
>   For a few seconds I thought you saved my day.
>
>   I'm not talking about BLOCK_FOR_INSN (insn)
>
>   I haven't specified my problem properly? If I traverse basic blocks
> via FOR_EACH_BB (used in compute_bb_for_insn, too) I get insns which
> are not in the insn-stream for(insn = get_insns(), insn; insn =
>  NEXT_INSN(insn)) ..
>
>  B1 ---> B2 --> B3
>  /\  /\ /\
> /  \/  \   /  \
>vv  vv vv
>   i1 -> i2i3 -> i4   i5 -> i6
> | ^
> +-+
>
>   How can I say this? In a first pass I dump each insn as a node in a
> VCG-file, each node is identified by its memory address (I used the
> UID, but insns appear multiple times if they were copied, but UID or
> address makes no difference). In a second pass I dump each basic
> block as a node with edges to the head insn and to the end insn of
> the basic block, which should be emitted in the first pass. But
> sometimes some of the basic blocks have edges to insns which do not
> exits.
>
>  Possible solutions (from OK to horrific):
>  1) These insns are dead code.
>  2) Bug in my output (but I checked it quite often)
>  3) Bug in GCC

You are probably mix-matching functions for use in cfg_layout mode vs. 
non-cfg_layout mode.

Richard.


Adding custom scheduler dependency between 2 insns

2007-11-07 Thread Tomer Benyamini
Hi,

I was wondering if it is possible to create a dependency between 2 insns
through a specific scheduler hook (maybe through
TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK) even though the insns are not
really dependent (not really read-after-write etc.). If it is possible,
what is the best way to do it?

Thanks,
Tomer



RE: Adding custom scheduler dependency between 2 insns

2007-11-07 Thread Tomer Benyamini
Hi Maxim,

Thanks for the prompt response! I'm using gcc 4.2.0, and couldn't locate
sd_add_dep in sched-deps.c. Is add_dependence () an appropriate
equivalent?

Thanks,
Tomer

-Original Message-
From: Maxim Kuvyrkov [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 08, 2007 09:30
To: Tomer Benyamini
Cc: gcc@gcc.gnu.org
Subject: Re: Adding custom scheduler dependency between 2 insns

Tomer Benyamini wrote:
> Hi,
> 
> I was wondering if it is possible to create a dependency between 2
insns
> through a specific scheduler hook (maybe through
> TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK) even though the insns are
not
> really dependent (not really read-after-write etc.). If it is
possible,
> what is the best way to do it?

It sounds to me like you want a dirty hack.  Anyway, call to 
sched-deps.c: sd_add_dep () should be enough.

--
Maxim