public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org
Subject: Re: PATCH [2/n]: Prepare x32: Convert pointer to TLS symbol if needed
Date: Wed, 29 Jun 2011 14:39:00 -0000	[thread overview]
Message-ID: <BANLkTinuPKbSHAfE+DviMYCwhHmqVVk-fg@mail.gmail.com> (raw)
In-Reply-To: <g4liwlm3fx.fsf@linaro.org>

On Wed, Jun 29, 2011 at 1:45 AM, Richard Sandiford
<richard.sandiford@linaro.org> wrote:
> "H.J. Lu" <hongjiu.lu@intel.com> writes:
>> @@ -706,7 +706,13 @@ precompute_register_parameters (int num_actuals, struct arg_data *args,
>>          pseudo now.  TLS symbols sometimes need a call to resolve.  */
>>       if (CONSTANT_P (args[i].value)
>>           && !targetm.legitimate_constant_p (args[i].mode, args[i].value))
>> -       args[i].value = force_reg (args[i].mode, args[i].value);
>> +       {
>> +         if (GET_MODE (args[i].value) != args[i].mode)
>> +           args[i].value = convert_to_mode (args[i].mode,
>> +                                            args[i].value,
>> +                                            args[i].unsignedp);
>> +         args[i].value = force_reg (args[i].mode, args[i].value);
>> +       }
>
> But if GET_MODE (args[i].value) != args[i].mode, then the call to
> targetm.legitimate_constant_p looks wrong.  The mode passed in the
> first argument is supposed to the mode of the second argument.
>
> Is there any reason why this and the following:
>
>        /* If we are to promote the function arg to a wider mode,
>           do it now.  */
>
>        if (args[i].mode != TYPE_MODE (TREE_TYPE (args[i].tree_value)))
>          args[i].value
>            = convert_modes (args[i].mode,
>                             TYPE_MODE (TREE_TYPE (args[i].tree_value)),
>                             args[i].value, args[i].unsignedp);
>
> need to be done in the current order?  I can't think of any off-hand.
> If not, would swapping them also fix the bug?
>
> (I can't review this either way, of course.)

It works on the testcase.  I will do a full test.

Thanks.

-- 
H.J.

  reply	other threads:[~2011-06-29 14:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-11 15:56 H.J. Lu
2011-06-29  8:55 ` Richard Sandiford
2011-06-29 14:39   ` H.J. Lu [this message]
2011-06-29 17:36     ` H.J. Lu
2011-07-01 16:38       ` Richard Sandiford

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=BANLkTinuPKbSHAfE+DviMYCwhHmqVVk-fg@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.sandiford@linaro.org \
    /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).