public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Georg-Johann Lay <avr@gjlay.de>
To: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: [patch,committed] Work around problem in gen-pass-instances.awk
Date: Wed, 26 Oct 2016 09:54:00 -0000	[thread overview]
Message-ID: <a39e9d40-5c0c-5f4f-d011-0d99da814b20@gjlay.de> (raw)

gen-pass-instances.awk is sensitive to the order in which directives are 
written down, e.g. in target-pass.def: If a pass that runs first is added 
first, then the last pass is skipped and not added to pass-instances.def.

Work around is to add the 2nd pass before adding the 1st pass...

http://gcc.gnu.org/r241547

No so obvious, but committed anyway...

Johann

	gen-pass-instances.awk is sensitive to the order in which
	passes are added; passes that appear later have to be added first.

	PR target/71676
	PR target/71678
	* config/avr/avr-passes.def: Swap order of directives for
	gen-pass-instances.awk.

Index: config/avr/avr-passes.def
===================================================================
--- config/avr/avr-passes.def   (revision 241546)
+++ config/avr/avr-passes.def   (revision 241547)
@@ -17,6 +17,19 @@
     along with GCC; see the file COPYING3.  If not see
     <http://www.gnu.org/licenses/>.  */

+/* FIXME: We have to add the last pass first, otherwise
+          gen-pass-instances.awk won't work as expected. */
+
+/* This avr-specific pass (re)computes insn notes, in particular REG_DEAD
+   notes which are used by `avr.c::reg_unused_after' and branch offset
+   computations.  These notes must be correct, i.e. there must be no
+   dangling REG_DEAD notes; otherwise wrong code might result, cf. PR64331.
+
+   DF needs (correct) CFG, hence right before free_cfg is the last
+   opportunity to rectify notes.  */
+
+INSERT_PASS_BEFORE (pass_free_cfg, 1, avr_pass_recompute_notes);
+
  /* casesi uses a SImode switch index which is quite costly as most code will
     work on HImode or QImode.  The following pass runs right after .expand and
     tries to fix such situations by operating on the original mode.  This
@@ -27,13 +40,3 @@
     insns withaout any insns in between.  */

  INSERT_PASS_AFTER (pass_expand, 1, avr_pass_casesi);
-
-/* This avr-specific pass (re)computes insn notes, in particular REG_DEAD
-   notes which are used by `avr.c::reg_unused_after' and branch offset
-   computations.  These notes must be correct, i.e. there must be no
-   dangling REG_DEAD notes; otherwise wrong code might result, cf. PR64331.
-
-   DF needs (correct) CFG, hence right before free_cfg is the last
-   opportunity to rectify notes.  */
-
-INSERT_PASS_BEFORE (pass_free_cfg, 1, avr_pass_recompute_notes);

             reply	other threads:[~2016-10-26  9:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-26  9:54 Georg-Johann Lay [this message]
2016-10-26 10:48 ` Jakub Jelinek
2016-10-26 11:08   ` Richard Biener

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=a39e9d40-5c0c-5f4f-d011-0d99da814b20@gjlay.de \
    --to=avr@gjlay.de \
    --cc=gcc-patches@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).