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]

Two minor tweeks needed for SSA inliner


Hi,
two minor tweeks I need to get SSA inliner operational.  First one is changing
tree_common_ann accestor from producing secondary annotations on static
variables in tree-ssa-PRE.

The second hunk is making set_default_def to not segfault on NULL argument.
This is used for inliners when producing argument initialization code (ie the
SSA name of arugment is first built as uninitialized, as argument is, then
initialization code is inserted and the default_def is nullified).  This seems
pretty sane thing to do for me, even if I can surely change SSA_NAME
duplication code to not produce the uninitialized bit at first place.

Just that thing was (in a broken way) assumed to be used by that strange
conditional always being true, so it don't seem to logically belong there
anyway.

Bootstrapped/regtested i686-linux with other changes, separate testing in
progress, OK?

Honza

Index: tree-flow-inline.h
===================================================================
*** tree-flow-inline.h	(revision 120089)
--- tree-flow-inline.h	(working copy)
*************** clear_call_clobbered (tree var)
*** 952,957 ****
--- 952,960 ----
  static inline tree_ann_common_t
  tree_common_ann (tree t)
  {
+   /* Watch out static variables with unshared annotations.  */
+   if (DECL_P (t) && TREE_CODE (t) == VAR_DECL)
+     return &var_ann (t)->common;
    return &t->base.ann->common;
  }
  
Index: tree-dfa.c
===================================================================
*** tree-dfa.c	(revision 120090)
--- tree-dfa.c	(working copy)
*************** set_default_def (tree var, tree def)
*** 696,702 ****
        htab_remove_elt (DEFAULT_DEFS (cfun), *loc);
        return;
      }
!   gcc_assert (TREE_CODE (def) == SSA_NAME);
    loc = htab_find_slot_with_hash (DEFAULT_DEFS (cfun), &in,
                                    DECL_UID (var), INSERT);
  
--- 696,702 ----
        htab_remove_elt (DEFAULT_DEFS (cfun), *loc);
        return;
      }
!   gcc_assert (!def || TREE_CODE (def) == SSA_NAME);
    loc = htab_find_slot_with_hash (DEFAULT_DEFS (cfun), &in,
                                    DECL_UID (var), INSERT);
  


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