Re: Dlxcc, and register allocation

Michael Meissner <>
19 Jun 1998 10:31:40 -0400

          From comp.compilers

Related articles
Dlxcc, and register allocation (William C. Kreahling) (1998-06-18)
Re: Dlxcc, and register allocation (Michael Meissner) (1998-06-19)
| List of all articles for this month |

From: Michael Meissner <>
Newsgroups: comp.compilers
Date: 19 Jun 1998 10:31:40 -0400
Organization: Compilers Central
References: 98-06-095
Keywords: GCC, registers

"William C. Kreahling" <> writes:

> Hello,
> I was wondering if anyone had any information about register
> allocation in dlxcc. Dlxcc is a gcc cross compiler that takes C code and
> converts it to code for a dlx simulator. Dlxcc also does register
> allocation on that code. For my purposes I would like it to generate the
> code without doing any register allocation. S I am having to search
> though the code trying to find and disable the register allocation (if
> possible). If anyone has any ideas, or could even point me in the right
> direction I would greatly appreciate it. Since dlxcc is a gcc cross
> compiler, any info on how gcc itself handles regsiter would also be a
> help.

In the GCC scheme of things, when optimizing, the first pass of
register allocation is in local-alloc.c (with a prepass in
regclass.c), the second pass is global.c, and the third pass is
reload1.c (with subroutines in reload.c). The file toplev.c controls
calling the various passes (note, the third pass is called from within
the second pass). If you are not optimizing, then the compiler does
two passes, first stupid.c to try and honor register declarations but
nothing else, and then calling reload to deal with everything else.

The local-alloc pass involves allocating registers that are only used
in a basic block, and not used elsewhere.

The global pass involves allocating the registers that are used in
more than one basic blocks.

The reload pass involves allocating spill registers for those
registers that did not get a hard register, and making sure each
instruction has the operands in the proper registers. In general, it
is a harder pass to understand than the others.

I suspect it might be easier to just bump up the number of physical
registers to a much higher number (say 1000). Note, if you change the
# of registers, you probably need to rebuild the compiler from
scratch, since the GCC Makefile does not list dependencies of the
<machine>.h file.
Michael Meissner, Cygnus Solutions (Massachusetts office)
4th floor, 955 Massachusetts Avenue, Cambridge, MA 02139, USA, 617-354-5416 (office), 617-354-7161 (fax)

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.