public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Henri Cloetens <henri.cloetens@blueice.be>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Question on gcc RTL and scheduling step.
Date: Wed, 26 Feb 2020 17:02:00 -0000	[thread overview]
Message-ID: <86e3b82f-61a0-dc59-1511-5b0de7ae0866@blueice.be> (raw)
In-Reply-To: <20200226125927.GM22482@gate.crashing.org>

Hello Segher, all,

- On the issue of the restore of R18 in mode DI, it seems from
   analysing the log file that the compiler does not understand this
   also affects R19. This looks a bug to me ??. Anyway, I have resolved
   this, by adding a 'clobber' statement to R19 when R18 is written
   in mode 'DI'.
- The other issue, I have changed ((set) (pc) (return)) to (return),
   but, as far as I understand the logfiles, and the documentation,
   both forms are equivalent. Anyway, after fixing the first issue, I do
   not see the second issue any more.

Best Regards and thanks,

Henri.



On 02/26/2020 01:59 PM, Segher Boessenkool wrote:
> Hi!
>
> On Wed, Feb 26, 2020 at 01:02:46PM +0100, Henri Cloetens wrote:
>> 1. The epilogue generator emits an instruction "popret_internal" that
>>      a. Restores R18 in mode DI. (which corresponds to R18 and R19 in
>> mode SI)
>>      b. Does the function return.
>> 2. Then, during scheduling, the compiler shifts an add instruction PAST
>> this return
>>      instruction, which is incorrect, because:
>>     (a.) The instruction writes R19. (it restores R18 and R19). The
>> scheduler should see this.
> Yes.  So why doesn't it?  Look at the various dump files to see what the
> df ("dataflow") framework thinks about this.
>
>>     (b.) The instruction changes the PC (program counter).
> The documentation says you should write just
>    (return)
> instead of
>    (set (pc) (return))
> (unlikely to be causing any of this, but a good cleanup to make).
>
>> Q. Why is this happening ?. How can I prevent this ?.
> You can have the scheduler print much more debugging info, but I'd
> start with the usual stuff: -dap.
>
>
> Segher
>

  reply	other threads:[~2020-02-26 15:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26 15:10 Henri Cloetens
2020-02-26 16:39 ` Segher Boessenkool
2020-02-26 17:02   ` Henri Cloetens [this message]
2020-02-26 22:00     ` Segher Boessenkool
2020-02-27  7:43       ` Henri Cloetens
2020-02-27  9:23         ` Segher Boessenkool

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=86e3b82f-61a0-dc59-1511-5b0de7ae0866@blueice.be \
    --to=henri.cloetens@blueice.be \
    --cc=gcc-help@gcc.gnu.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).