public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/47028] [4.6 Regression] gcc.dg/tree-ssa/tailrecursion-[57].c FAIL with -foptimize-sibling-calls -fno-forward-propagate -fno-tree-copy-prop -fno-tree-dominator-opts
Date: Thu, 30 Dec 2010 13:19:00 -0000	[thread overview]
Message-ID: <bug-47028-4-oEmWxPqUbR@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-47028-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47028

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-12-30 13:19:21 UTC ---
The problem is much earlier than that.
In *.expand we have:
;; Start of basic block ( 0) -> 2
;; Pred edge  ENTRY [100.0%]  (fallthru)
(note 12 6 9 2 [bb 2] NOTE_INSN_BASIC_BLOCK)

(insn 9 12 7 2 (set (reg/v:SI 70 [ n ])
        (reg/v:SI 72 [ n ])) pr47028.c:7 -1
     (nil))

(insn 7 9 8 2 (set (reg/v:SI 72 [ n ])
        (reg:SI 5 di [ n ])) pr47028.c:7 -1
     (nil))
where obviously insn 7 should be before insn 9, not the other way around.
The reason it is emitted that way is because in *.optimized we have:
<bb 2>:
  # n_13 = PHI <n_3(D)(0)>
and insn 9 is insert_partition_copy_on_edge'ed on the ENTRY_BLOCK_PTR -> bb 2
edge, which is before the argument setup.

So, either insertions on the single edge from ENTRY_BLOCK_PTR to the entry bb
should be committed after parm_birth_insn instead of the start of that bb, or
we need to ensure even if the user ridiculously turns off all optimization
passes that clean up degenerated PHIs they get cleaned up somewhere.  The PHI
here is created during tail recursion pass, but at that point it is not
degenerate PHI, it only becomes one during some cfg cleanup afterwards.


  parent reply	other threads:[~2010-12-30 13:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-20 18:56 [Bug rtl-optimization/47028] New: " zsojka at seznam dot cz
2010-12-20 19:20 ` [Bug rtl-optimization/47028] " zsojka at seznam dot cz
2010-12-27 19:06 ` jakub at gcc dot gnu.org
2010-12-30 13:19 ` jakub at gcc dot gnu.org [this message]
2010-12-30 14:44 ` hjl.tools at gmail dot com
2010-12-30 16:00 ` jakub at gcc dot gnu.org
2010-12-30 18:57 ` rguenth at gcc dot gnu.org
2011-01-02 17:07 ` jakub at gcc dot gnu.org
2011-01-02 17:24 ` jakub at gcc dot gnu.org

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=bug-47028-4-oEmWxPqUbR@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).