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/17468] [4.0 regression] Java garbage collector miscompiled at -O1 and higher


------- Additional Comments From rth at gcc dot gnu dot org  2004-09-14 07:20 -------
>From the .26.tailc dump, it's obvious that the two stmts are just reversed.

  <retval>_4 = D.1138_1;
  acc_tmp.5_29 = add_acc.2_23 + acc_tmp.4_28;
  acc_tmp.4_28 = mult_acc.1_22 * <retval>_4;
  return acc_tmp.5_29;

But there's a second more subtle bug in that we should be generating

  acc_tmp.4_28 = mult_acc.1_22 * D.1138_1;
  acc_tmp.5_29 = add_acc.2_23 + acc_tmp.4_28;
  <retval>_4 = acc_tmp.5_29
  return <retval>_4;

The trick here is that <retval> will have DECL_RTL as a hard register.
We cannot legitimately extend its lifetime at all.  This is not normally
a problem, given how we generate trees.

-- 


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


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