public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexandre Oliva <aoliva@redhat.com>
To: Richard Guenther <richard.guenther@gmail.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [vta, graphite?] propagate degenerate phi nodes into debug stmts
Date: Tue, 07 Jun 2011 10:38:00 -0000	[thread overview]
Message-ID: <ory61eapul.fsf@livre.localdomain> (raw)
In-Reply-To: <BANLkTin0TpcbugNaZwEi-X3jnY6UiwpMJA@mail.gmail.com> (Richard	Guenther's message of "Mon, 6 Jun 2011 11:37:06 +0200")

[-- Attachment #1: Type: text/plain, Size: 779 bytes --]

On Jun  6, 2011, Richard Guenther <richard.guenther@gmail.com> wrote:

>> You meant 4.6 stage1, but I missed it.  How's it for 4.7 stage1?
>> Regstrapped on x86_64-linux-gnu and i686-linux-gnu.

> Isn't exactly ICEing for num_ssa_operands/delink_stmt_imm_use.

Uhh.  Looks like I didn't update the patch per your comments before
putting it aside for stage1, after all.  Sorry.

> So, the op_iter_init change is ok, the other two not - they should
> either ICE or work for PHIs (by using FOR_EACH_PHI_OR_STMT_USE
> in them).

The latter is legitimately called for GIMPLE_PHI, so I changed it to use
FOR_EACH_PHI_OR_STMT_USE.  The former was never called for GIMPLE_PHIs,
so I put in an assert there.

Regstrapped on x86_64-linux-gnu and i686-linux-gnu.  Ok?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: check-no-nonphi-iter-on-phi.patch --]
[-- Type: text/x-diff, Size: 1951 bytes --]

for  gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* tree-flow-inline.h (op_iter_init): Reject GIMPLE_PHI stmts.
	(num_ssa_operands): Likewise.
	(op_iter_init_phiuse): Forward-declare.
	(delink_stmt_imm_use): Iterate with FOR_EACH_PHI_OR_STMT_USE.

Index: gcc/tree-flow-inline.h
===================================================================
--- gcc/tree-flow-inline.h.orig	2011-06-03 11:56:24.619482744 -0300
+++ gcc/tree-flow-inline.h	2011-06-07 04:15:18.344729725 -0300
@@ -737,9 +737,11 @@ clear_and_done_ssa_iter (ssa_op_iter *pt
 static inline void
 op_iter_init (ssa_op_iter *ptr, gimple stmt, int flags)
 {
-  /* We do not support iterating over virtual defs or uses without
+  /* PHI nodes require a different iterator initialization path.  We
+     do not support iterating over virtual defs or uses without
      iterating over defs or uses at the same time.  */
-  gcc_checking_assert ((!(flags & SSA_OP_VDEF) || (flags & SSA_OP_DEF))
+  gcc_checking_assert (gimple_code (stmt) != GIMPLE_PHI
+		       && (!(flags & SSA_OP_VDEF) || (flags & SSA_OP_DEF))
 		       && (!(flags & SSA_OP_VUSE) || (flags & SSA_OP_USE)));
   ptr->defs = (flags & (SSA_OP_DEF|SSA_OP_VDEF)) ? gimple_def_ops (stmt) : NULL;
   if (!(flags & SSA_OP_VDEF)
@@ -868,11 +870,14 @@ num_ssa_operands (gimple stmt, int flags
   tree t;
   int num = 0;
 
+  gcc_checking_assert (gimple_code (stmt) != GIMPLE_PHI);
   FOR_EACH_SSA_TREE_OPERAND (t, stmt, iter, flags)
     num++;
   return num;
 }
 
+static inline use_operand_p
+op_iter_init_phiuse (ssa_op_iter *ptr, gimple phi, int flags);
 
 /* Delink all immediate_use information for STMT.  */
 static inline void
@@ -882,7 +887,7 @@ delink_stmt_imm_use (gimple stmt)
    use_operand_p use_p;
 
    if (ssa_operands_active ())
-     FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES)
+     FOR_EACH_PHI_OR_STMT_USE (use_p, stmt, iter, SSA_OP_ALL_USES)
        delink_imm_use (use_p);
 }
 

[-- Attachment #3: Type: text/plain, Size: 258 bytes --]



-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer

  reply	other threads:[~2011-06-07 10:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-08  8:07 Alexandre Oliva
2009-11-08  9:57 ` Richard Guenther
2009-11-16 20:35   ` Alexandre Oliva
2009-11-16 20:48   ` Alexandre Oliva
2009-11-17 15:47     ` Richard Guenther
2009-11-19  4:18       ` Alexandre Oliva
2009-11-19 10:56         ` Richard Guenther
2009-11-20  9:37           ` Alexandre Oliva
2009-11-20 10:47             ` Richard Guenther
2009-11-21  5:22               ` Alexandre Oliva
2011-06-03 14:38           ` Alexandre Oliva
2011-06-06  9:37             ` Richard Guenther
2011-06-07 10:38               ` Alexandre Oliva [this message]
2011-06-07 12:04                 ` Richard Guenther
2009-11-19  4:28       ` Alexandre Oliva
2009-11-19 10:59         ` Richard Guenther
2009-11-20  9:26           ` Alexandre Oliva
2009-12-05 16:04             ` H.J. Lu
2009-12-23  8:58               ` H.J. Lu
2010-01-29 17:02                 ` H.J. Lu

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=ory61eapul.fsf@livre.localdomain \
    --to=aoliva@redhat.com \
    --cc=gcc-patches@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).