This is the mail archive of the gcc-bugs@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]

[Bug tree-optimization/32663] [4.3 regression]: revision 126369 went into an infinite loop



------- Comment #6 from hjl at lucon dot org  2007-07-07 19:35 -------
If I revert

-         if (lhsval)
+         if (lhsval && vuse_equiv (lhsval, stmt))

the regression is gone. I suspected that the original code:

          if (lhsval)
            {
              set_value_handle (newt, lhsval);
              if (!is_gimple_min_invariant (lhsval))
                add_to_value (lhsval, newt);
            }
          else
            {
              tree val = vn_lookup_or_add_with_stmt (newt, stmt);
              vn_add (lhs, val);
            }

doesnt't handle the case of

if (lhsval && !vuse_equiv (lhsval, stmt))

If I change it to

--- tree-ssa-pre.c.bad  2007-07-07 08:18:31.000000000 -0700
+++ tree-ssa-pre.c      2007-07-07 12:33:51.000000000 -0700
@@ -3362,7 +3362,8 @@ make_values_for_stmt (tree stmt, basic_b
          else
            {
              tree val = vn_lookup_or_add_with_stmt (newt, stmt);
-             vn_add (lhs, val);
+             if (!lhsval)
+               vn_add (lhs, val);
            }

          add_to_exp_gen (block, newt);

my testcase works.


-- 


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


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