public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Surya Kumari Jangala <jskumari@linux.vnet.ibm.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: GCC Development <gcc@gcc.gnu.org>
Subject: Re: [RFC] Analysis of PR105586 and possible approaches to fix issue
Date: Wed, 27 Jul 2022 19:40:51 +0530	[thread overview]
Message-ID: <74f7c33b-7347-d9db-6d5f-568a6c5c4bc4@linux.vnet.ibm.com> (raw)
In-Reply-To: <CAFiYyc1T6sZYocQ1j5azxAiU54Gn5kWo0aGdvpyEfV9WMZdV3A@mail.gmail.com>

Hi Richard,

On 27/07/22 12:28 pm, Richard Biener wrote:
> On Tue, Jul 26, 2022 at 8:55 PM Surya Kumari Jangala via Gcc
> <gcc@gcc.gnu.org> wrote:

>> To fix the issue of insns being assigned different cycles, there are two possible solutions:
>>
>> 1. Modify no_real_insns_p() to treat a DEBUG insn as a non-real insn (similar to NOTE and LABEL). With this change, bb 3 will not be scheduled in the debug mode (as it contains only NOTE and DEBUG insns). If scheduling is skipped, then bb 3’s state is not copied to bb 4 and the initial dfa state of bb 4 will be same in both debug and non-debug modes
>> 2. Copy dfa state of a basic block to it’s fall-thru block only if the basic block contains ‘real’ insns (ie, it should contain at least one insn which is not a LABEL, NOTE or DEBUG). This will prevent copying of dfa state from bb 3 to bb 4 in debug mode.
> 
> Do you know why the DFA state is not always copied to the fallthru
> destination and then copied further even if the block does not contain

I am not sure why the DFA state is not always copied to the fallthru destination. It is not very apparent from the code.

> any (real) insns?  It somewhat sounds like premature optimization
> breaking things here...
> 

Now that you mention it, yes it does seem suboptimal that the DFA state is not always copied. I don’t see any reason why the DFA state shouldn’t be always copied. And I think this is the fix for this bug. '-g' mode is behaving correctly, it is the non-debug mode which is incorrect.

Thanks,
Surya


  reply	other threads:[~2022-07-27 14:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-26 18:54 Surya Kumari Jangala
2022-07-27  6:58 ` Richard Biener
2022-07-27 14:10   ` Surya Kumari Jangala [this message]
2022-07-30 20:01   ` Jeff Law

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=74f7c33b-7347-d9db-6d5f-568a6c5c4bc4@linux.vnet.ibm.com \
    --to=jskumari@linux.vnet.ibm.com \
    --cc=gcc@gcc.gnu.org \
    --cc=richard.guenther@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).