public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
To: Nathan Sidwell <nathan@acm.org>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>, Joey Ye <joey.ye@arm.com>,
	nd	<nd@arm.com>
Subject: Re: [ARM] no-data-is-text-relative & msingle-pic-base
Date: Tue, 12 Jul 2016 16:01:00 -0000	[thread overview]
Message-ID: <57851444.10002@arm.com> (raw)
In-Reply-To: <725a5dca-7f6b-286b-745e-bcfd837a0f9d@acm.org>

On 12/07/16 13:02, Nathan Sidwell wrote:
> Ramana,
> could you review this?


Sorry missed this.
> 
> original thread https://gcc.gnu.org/ml/gcc-patches/2016-05/msg00630.html, reproduced below:
> 
> 
> currently, the documentation for -mno-pic-data-is-text-relative (-mno-PDITR) says
> 'Assume that each data segments are relative to text segment at load time.
>  Therefore, it permits addressing data using PC-relative operations.
>  This option is on by default for targets other than VxWorks RTP.'
> 
> However, if you use just this option, you still end up with a pic-register init sequence that presumes a fixed mapping. That's a surprise. Joey tells me its expected use is with -msingle-pic-base (-mSPB), which reserves a global register to point at the (single) GOT. That's what I had expected the -mno-PDITR option to have implied.
> 
> Apparently there are legitimate reasons one might want the -mno-PDITR behaviour without -mSPB. I don't know what those are though.
> 
> Anyway, IMHO that is the rare case and the more common case is that one would want to have -mnoPDITR imply -mSPB. (The reverse probably doesn't apply.)
> 
> This patch does 3 things.
> 1) have -mno-PDITR imply -mSPB, unless one has explicitly provided -m[no-]SPB.
> 2) clarified  the -m[no-]PDITR documentation.
> 3) Added some testcases -- there didn't appear to be any.
> 
> ok?
> 

Ok and thank you for the testcases. -mno-PDITR => -mSPB by default (in the absence of -mno-SPB on the command line) seems correct after having done the necessary archeology.

I am also slightly inclined to go further and error out if someone uses -mno-PDITR with -mno-SPB on the command line, after all as you say -mno-PDITR implies a non-fixed mapping while -mno-SPB implies there is some fixed mapping some where currently in the compiler. I don't see how the twain can meet. That can happen as a follow-up - the current patch is by itself a step improvement.


Thanks,
Ramana

> nathan

  reply	other threads:[~2016-07-12 16:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-12 12:02 Nathan Sidwell
2016-07-12 16:01 ` Ramana Radhakrishnan [this message]
2016-07-12 16:07   ` Nathan Sidwell
2016-07-12 16:19     ` Joey Ye

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=57851444.10002@arm.com \
    --to=ramana.radhakrishnan@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joey.ye@arm.com \
    --cc=nathan@acm.org \
    --cc=nd@arm.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).