Possible typo in src/share/vm/adlc/formssel.cpp:914

Peter B. Kessler Peter.Kessler at Sun.COM
Mon Jan 25 15:17:50 PST 2010


I'm looking in

    http://hg.openjdk.java.net/jdk7/jdk7/hotspot/file/3003ddd1d433/src/share/vm/adlc/formssel.cpp

at lines 914-915

      914       if ((!component->isa( Component::USE) && ((e->_use_def & Component::USE) != 0))) {
      915         if (component->isa(Component::USE) && _matrule) {

If I have my precedence rules correct, that means I get into the outer then-clause if the component *is not* a USE, but then I never get into the inner then-clause, because it's restricted to a component that *is* a USE.

Then there's the funny double-parentheses in the first predicate.  I wonder if line 914 should be

      914       if (!(component->isa( Component::USE) && ((e->_use_def & Component::USE) != 0))) {

which would get into the outer then-clause if not both the component and the effect were uses, and then would get into the inner then-clause if the component is a USE and there is a match rule (implying that the effect is not a USE).  That seems to make more sense.

Is my suggestion right?  Is this worth fixing?

			... peter




More information about the hotspot-compiler-dev mailing list