On 14/02/12 09:52, Jakub Jelinek wrote:
On Tue, Feb 14, 2012 at 07:27:21AM +0000, Paulo J. Matos wrote:
      case RTX_OBJ:
        /* Complex expressions should be the first, so decrease priority
           of objects.  Prefer pointer objects over non pointer objects.  */
-      if ((REG_P (op)&&  REG_POINTER (op))
-         || (MEM_P (op)&&  MEM_POINTER (op)))
-       return -1;
-      return -2;
+      if(REG_P(op))
+          return -1;
+      else if ((REG_P (op)&&  REG_POINTER (op))
+               || (MEM_P (op)&&  MEM_POINTER (op)))
+          return -2;
+      return -3;
The above is definitely wrong, I think it will penalize e.g. Power6/7 a lot.
Note that the REG_P&&  REG_POINTER testis then useless because of your
change.  So, if anything, you'd need to use highest priority for
REG_P&&  REG_POINTER, then MEM_P&&  MEM_POINTER, then REG_P and then MEM_P
and verify it doesn't regress on any major target on SPEC etc.
Watch your formatting and I don't think this is stage4 material in any case,
it is extremely risky change.

        Jakub

Thanks for the comments Jakub. I submitted the bug report since it 
helped me (my backend generated code is better) and Richard in the gcc 
mailing list agreed it to be unintuitive.
It is true that my test makes the following test on REG_P and 
REG_POINTER useless. My mistake, will fix.
I haven't tested it on any major target and the submission as a bug was 
in order to see if it has any interest for gcc main targets.
--
PMatos

Reply via email to