public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Richard Earnshaw <Richard.Earnshaw@foss.arm.com>,Michael Matz
	<matz@suse.de>
Cc: Jim Wilson <jim.wilson@linaro.org>,Jeff Law
	<law@redhat.com>,"gcc-patches@gcc.gnu.org"
	<gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH, ARM] stop changing signedness in PROMOTE_MODE
Date: Tue, 14 Jul 2015 16:49:00 -0000	[thread overview]
Message-ID: <19B06965-B935-46D5-BC89-62C35A7C5250@gmail.com> (raw)
In-Reply-To: <55A53519.6040305@foss.arm.com>

On July 14, 2015 6:13:13 PM GMT+02:00, Richard Earnshaw <Richard.Earnshaw@foss.arm.com> wrote:
>On 13/07/15 16:29, Michael Matz wrote:
>> Hi,
>> 
>> On Mon, 13 Jul 2015, Richard Biener wrote:
>> 
>>> On Fri, Jul 10, 2015 at 5:46 PM, Jim Wilson <jim.wilson@linaro.org>
>wrote:
>>>> On Tue, Jul 7, 2015 at 2:35 PM, Richard Biener
>>>> <richard.guenther@gmail.com> wrote:
>>>>> On July 7, 2015 6:29:21 PM GMT+02:00, Jim Wilson
><jim.wilson@linaro.org> wrote:
>>>>>> signed sub-word locals.  Thus to detect the need for a
>conversion, you
>>>>>> have to have the decls, and we don't have them here.  There is
>also
>>>>>
>>>>> It probably is.  The decks for the parameter based SSA names are
>available, for the PHI destination there might be no decl.
>>>>
>>>> I tried looking again, and found the decls.  I'm able to get
>correct
>>>> code for my testcase with the attached patch to force the
>conversion.
>>>> It is rather inelegant, but I think I can cache the values I need
>to
>>>> make this simpler and cleaner.  I still don't have decls from
>>>> insert_part_to_rtx_on_edge and insert_rtx_to_part_on_edge, but it
>>>> looks like those are for breaking cycles, and hence might not need
>>>> conversions.
>>>
>>> Yes, that looks like a defect.  CCing Micha who wrote this code
>> 
>> I think it's a backend bug that parameters and locals are extended 
>> differently.  The code in tree-outof-ssa was written with the
>assumption 
>> that the modes of RTL objects might be different (larger) than the
>tree 
>> types suggest, but that they be _consistent_, i.e. that the
>particular 
>> extension depends on only the types, not on the tree-type of the
>decl.
>> 
>
>We went through this a couple of weeks back.  The backend documentation
>for PROMOTE_MODE says:
>
>" For most machines, the macro definition does not change
>@var{unsignedp}.
>However, some machines, have instructions that preferentially handle
>either signed or unsigned quantities of certain modes.  For example, on
>the DEC Alpha, 32-bit loads from memory and 32-bit add instructions
>sign-extend the result to 64 bits.  On such machines, set
>@var{unsignedp} according to which kind of extension is more
>efficient."
>
>So clearly it anticipates that all permitted extensions should work,
>and
>in particular it makes no mention of this having to match some
>abi-mandated promotions.  That makes this a MI bug not a target one.

We could also decide that it is a documentation defect.  Are there any other targets with this inconsistency?

FWIW I'd prefer to expose the promoted incoming decls after gimplification. Independent on any inconsistency.

Richard.

>R.
>
>
>> I think the above assumption does make sense because it's also a 
>> fundamental assumption in the whole gimple pipeline, types matter,
>not the 
>> objects (or better, we slowly but surely work towards this).  Hence
>such 
>> mismatches should either not exist (changing the backend), or should
>be 
>> exposed explicitely during gimplification already.  The latter is a
>large 
>> change, though.
>> 
>> I think dealing with this situation in outof-ssa is a hack and I
>don't 
>> like it.  It would extend the ugliness of different modes for same
>types 
>> even more, and that's something we should (gradually) move away from.
>> 
>> 
>> Ciao,
>> Michael.
>> 


  reply	other threads:[~2015-07-14 16:43 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-30  1:56 Jim Wilson
2015-07-02  9:07 ` Richard Earnshaw
2015-07-07 18:25   ` Jim Wilson
2015-07-07 15:07 ` Jeff Law
2015-07-07 16:29   ` Jim Wilson
2015-07-07 21:35     ` Richard Biener
2015-07-10 15:46       ` Jim Wilson
2015-07-13  8:19         ` Richard Biener
2015-07-13 15:29           ` Michael Matz
2015-07-13 15:35             ` H.J. Lu
2015-07-14 16:38             ` Richard Earnshaw
2015-07-14 16:49               ` Richard Biener [this message]
2015-07-14 17:07               ` Jim Wilson
2015-07-14 17:23                 ` Richard Biener
2015-07-15 13:25                 ` Michael Matz
2015-07-15 16:01                   ` Jim Wilson
2015-07-16  9:40                     ` Richard Earnshaw
2015-07-16 15:02                       ` Michael Matz
2015-07-16 15:20                         ` Richard Earnshaw
2015-07-15 13:04               ` Michael Matz
2015-07-08 22:54     ` Jeff Law
2015-07-10 15:35       ` Jim Wilson
2016-02-04  8:58 ` Ramana Radhakrishnan
2016-02-15 11:32   ` Kyrill Tkachov
2016-02-16 10:44     ` Ramana Radhakrishnan
2016-02-17 10:03     ` Christophe Lyon
2016-02-17 10:05       ` Kyrill Tkachov
2016-02-17 10:20         ` Christophe Lyon
2016-02-17 10:22           ` Kyrill Tkachov
2016-02-18 10:16             ` Christophe Lyon
2016-03-07  4:43           ` Ramana Radhakrishnan
2016-03-07 12:55             ` Christophe Lyon

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=19B06965-B935-46D5-BC89-62C35A7C5250@gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=Richard.Earnshaw@foss.arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jim.wilson@linaro.org \
    --cc=law@redhat.com \
    --cc=matz@suse.de \
    /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).