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: [RFC/RFT] Patch (java): Switch to new verifier


Andrew> for (blah)
Andrew> baz += a.b;
Andrew> because we'll fetch a.b from memory every time around the loop.

This case would be helped if we could peel (is that the right term?)
the first iteration off the loop.  Then we would see:

  baz += a.b;
  for (...)
    baz += a.b;

Then we could mark the reference via "a" in the loop as non-volatile,
as it would be dominated by a possibly-trapping reference.  (Maybe we
could accomplish this by adding an ASSERT_EXPR<a != null> after a
dereference via 'a', then let VRP remove them... this would let us
easily catch the case where a dereference of a 'new' object cannot
trap.)

Peeling the first iteration may help java code in other cases, due to
class initialization.

rth>   baz += a.b + a.c

This would also be handled by the same machinery.

Tom


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