This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: IPA merge: make ipa-type-escape and ipa-pure-const deal with SSA form


On 12/28/06, Jan Hubicka <jh@suse.cz> wrote:
> On 12/28/06, Jan Hubicka <jh@suse.cz> wrote:
> >Hi,
> >this patch makes ipe-pure-const and ipa-type-escape to "tolerate" (ie work
> >on
> >but not take advantage of) the SSA form. I've bootstrapped/regtested the
> >change
> >on x86_64-linux with IPA-SSA and running routine bootstrap/regtest on clean
> >mainline i686-linux now. Will commit it as obvious once testing converge.
>
> Uh, but your patch seems wrong.
> How can a type escape through an ssa_name, which is purely local to a
> function (IE non-escaping)?
Hehe, it is what you or Kenny told me to do about 2 years ago ;)
Here is updated patch I am re-testing now.  Does it look better?

Sigh now i wonder what happens when we have bad casts to ssa variables and then copy the bad-casted variable to a global/static. Ugh. You may have been right the first time.



Honza


        * ipa-type-escape.c (scan_for_refs): Look into SSA_NAMEs.
        * ipa-pure-const.c (check_operand): Accept SSA_NAME.
Index: ipa-type-escape.c
===================================================================
*** ipa-type-escape.c   (revision 120209)
--- ipa-type-escape.c   (working copy)
*************** scan_for_refs (tree *tp, int *walk_subtr
*** 1267,1273 ****
                   result so we do mark the resulting cast as being
                   bad.  */
                if (check_call (rhs))
!                 bitmap_set_bit (results_of_malloc, DECL_UID (lhs));
                break;
              default:
                break;
--- 1267,1277 ----
                   result so we do mark the resulting cast as being
                   bad.  */
                if (check_call (rhs))
!                 {
!                   if (TREE_CODE (lhs) == SSA_NAME)
!                     lhs = SSA_NAME_VAR (lhs);
!                   bitmap_set_bit (results_of_malloc, DECL_UID (lhs));
!                 }
                break;
              default:
                break;
Index: ipa-pure-const.c
===================================================================
*** ipa-pure-const.c    (revision 120209)
--- ipa-pure-const.c    (working copy)
*************** check_operand (funct_state local,
*** 163,169 ****
  static void
  check_tree (funct_state local, tree t, bool checking_write)
  {
!   if ((TREE_CODE (t) == EXC_PTR_EXPR) || (TREE_CODE (t) == FILTER_EXPR))
      return;

    /* Any tree which is volatile disqualifies thie function from being
--- 163,170 ----
  static void
  check_tree (funct_state local, tree t, bool checking_write)
  {
!   if ((TREE_CODE (t) == EXC_PTR_EXPR) || (TREE_CODE (t) == FILTER_EXPR)
!       || TREE_CODE (t) == SSA_NAME)
      return;

/* Any tree which is volatile disqualifies thie function from being



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]