public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@google.com>
To: Trevor Scroggins <trevor.scroggins@gmail.com>
Cc: gcc@gcc.gnu.org
Subject: Re: CONSTANT_POOL_BEFORE_FUNCTION has no effect in tm.h?
Date: Mon, 06 Jul 2009 06:14:00 -0000	[thread overview]
Message-ID: <m3prcemj7t.fsf@google.com> (raw)
In-Reply-To: <ca05b9360907051356u109be34fo77e478519a5ecc9b@mail.gmail.com> (Trevor Scroggins's message of "Sun\, 5 Jul 2009 13\:56\:15 -0700")

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

  reply	other threads:[~2009-07-06  6:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-05 20:56 Trevor Scroggins
2009-07-06  6:14 ` Ian Lance Taylor [this message]
2009-07-06 16:29   ` Trevor Scroggins
2009-07-06 17:01     ` Ian Lance Taylor
2009-07-06 17:11       ` Trevor Scroggins
2009-07-06 18:29         ` Trevor Scroggins
2009-07-06 18:45           ` Ian Lance Taylor
2009-07-10 22:19             ` Trevor Scroggins
2009-07-10 22:20               ` Fwd: " Trevor Scroggins
2009-07-10 23:38               ` Ian Lance Taylor
2009-07-10 23:48                 ` Trevor Scroggins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3prcemj7t.fsf@google.com \
    --to=iant@google.com \
    --cc=gcc@gcc.gnu.org \
    --cc=trevor.scroggins@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).