public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/34123] [4.3 Regression] verify_ssa failed with -ftree-loop-linear
Date: Tue, 20 Nov 2007 10:59:00 -0000	[thread overview]
Message-ID: <20071120105906.6635.qmail@sourceware.org> (raw)
In-Reply-To: <bug-34123-12387@http.gcc.gnu.org/bugzilla/>



------- Comment #4 from jakub at gcc dot gnu dot org  2007-11-20 10:59 -------
The testcase is wrong, static unsigned char sbox[] = {}; means zero sized
array.
But using sbox[256] makes the testcase valid and the problem is still there.
This looks like a bug in can_convert_to_perfect_nest, this loop (at least
unless
earlier passes don't realize that sbox[i] == 0 for any i) can't be converted
into a perfect nest.
The basic block which is after the inner loop is:

<bb 5>:
# t_30 = PHI <t_16(4)>
D.1558_19 = (unsigned char) i_39;
t_20 = t_30 + D.1558_19;
i_21 = i_39 + 1;
if (i_21 <= 15)
  goto <bb 6>;
else
  goto <bb 8>;

<bb 6>:

<bb 7>:
# i_39 = PHI <0(2), i_21(6)>
# SMT.4_10 = PHI <SMT.4_26(D)(2), SMT.4_28(6)>
# t_29 = PHI <0(2), t_20(6)>
goto <bb 4>;

can_convert_to_perfect_nest walks the statements of these bbs and is satisfied
with all of them, the first two stmts in bb5 are satisfied by:

2234                          tree step = evolution_part_in_loop_num (scev,
loop->num);
2235                          if (step && step != chrec_dont_know 
2236                              && TREE_CODE (step) == INTEGER_CST)
2237                            continue;

- step is for both integer_one_node, the third stmt is of course correctly a
stmt_is_bumper_for_loop and the last one is exit_condition.  But nothing scans
the PHIs which are relevant here.  # t_30 = PHI <t_16(4)> in bb5 sets t_30 to
t_16, which is computed by inner loop.  And # t_29 = PHI <0(2), t_20(6)>
in bb7 sets t_29 used in the inner loop to t_20 set in bb5 (i.e. in the bb
which prevents perfect nest).  Should the PHIs be walked similarly to how
stmts are walked?


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dberlin at gcc dot gnu dot
                   |                            |org


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


  parent reply	other threads:[~2007-11-20 10:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-16 19:08 [Bug tree-optimization/34123] New: [4.3 Regression] verify_ssa failed (definition in block 11 does not dominate use in block 7) tbm at cyrius dot com
2007-11-16 19:08 ` [Bug tree-optimization/34123] " tbm at cyrius dot com
2007-11-16 19:15 ` tbm at cyrius dot com
2007-11-17 12:37 ` rguenth at gcc dot gnu dot org
2007-11-19  3:45 ` [Bug tree-optimization/34123] [4.3 Regression] verify_ssa failed with -ftree-loop-linear pinskia at gcc dot gnu dot org
2007-11-20 10:59 ` jakub at gcc dot gnu dot org [this message]
2007-11-27 22:00 ` mmitchel at gcc dot gnu dot org
2007-12-15 20:37 ` spop at gcc dot gnu dot org
2007-12-17 19:16 ` spop at gcc dot gnu dot org
2007-12-18 19:41 ` spop at gcc dot gnu dot org
2007-12-18 19:42 ` spop at gcc dot gnu dot 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=20071120105906.6635.qmail@sourceware.org \
    --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).