This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: CONSTANT_POOL_BEFORE_FUNCTION has no effect in tm.h?
- From: Ian Lance Taylor <iant at google dot com>
- To: Trevor Scroggins <trevor dot scroggins at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 05 Jul 2009 23:14:14 -0700
- Subject: Re: CONSTANT_POOL_BEFORE_FUNCTION has no effect in tm.h?
- References: <ca05b9360907051356u109be34fo77e478519a5ecc9b@mail.gmail.com>
Trevor Scroggins <trevor.scroggins@gmail.com> writes:
> Hello, all. I'm attempting to port GCC 4.4.0 to a new m68k target. The
> target begins execution in the first byte of the first text section.
> Adding '#define CONSTANT_POOL_BEFORE_FUNCTION 0' in my target's tm.h
> seems like the simplest way to avoid execution of read-only data;
> however, defining the constant has no effect on compilation. (Note,
> custom or missing startup code is common, so I can't work around it
> there.)
>
> The only references to CONSTANT_POOL_BEFORE_FUNCTION are in varasm.c,
> and the only target current using the definition is pdp11--not exactly
> current. Is CONSTANT_POOL_BEFORE_FUNCTION still being used, or have I
> hit upon a section of dead code? Is there a simple way to relocate
> read-only data to the end of a function without writing a
> target-specific reorg routine? Jumping over the data in a prologue
> might be an easy, quick and dirty solution, but the target is a
> memory-constrained system, and that seems wasteful.
Setting CONSTANT_POOL_BEFORE_FUNCTION to 0 ought to work to emit the
constant pool after the function. However, to be clear, it only affects
the constant pool which holds constants which are not
LEGITIMATE_CONSTANT_P. This is normally things like 32-bit constants
which RISC architectures can not handle in a single instruction. The
m68k is a flexible architecture and can handle 32-bit constants just
fine without using a constant pool. You didn't really describe what you
are seeing; what makes you think that the constant pool is the problem?
Ian