Hi,

PR 38474 testcase revealed what we can do a lot of entirely
unnecessary vdef walking only to throw away the result later because
of a much cheaper check.  I have posted a patch for trunk and 4.7 just
a moment ago.  this is a version for 4.6, doing essentially the same
thing.

I am about to bootstrap and test it on x86_64-linux and if no-one
objects, I will commit it to the branch on Monday because it is also
rather obvious and quite like the approved patch for newer code.

Thanks,

Martin


2012-06-29  Martin Jambor  <mjam...@suse.cz>

        pr middle-end/38474
        * ipa-prop.c (compute_known_type_jump_func): Check for a BINFO before
        checking for a dynamic type change.

Index: gcc/ipa-prop.c
===================================================================
--- gcc/ipa-prop.c      (revision 189050)
+++ gcc/ipa-prop.c      (working copy)
@@ -704,12 +704,11 @@ compute_known_type_jump_func (tree op, s
       || is_global_var (base))
     return;
 
-  if (detect_type_change (op, base, call, jfunc, offset))
-    return;
-
   binfo = TYPE_BINFO (TREE_TYPE (base));
-  if (!binfo)
+  if (!binfo
+      || detect_type_change (op, base, call, jfunc, offset))
     return;
+
   binfo = get_binfo_at_offset (binfo, offset, TREE_TYPE (op));
   if (binfo)
     {

Reply via email to