For PowerPC, never put a reg_float value in a reg_any.
authorGeorge Koehler <xkernigh@netscape.net>
Fri, 17 Feb 2017 01:30:17 +0000 (20:30 -0500)
committerGeorge Koehler <xkernigh@netscape.net>
Fri, 17 Feb 2017 01:30:17 +0000 (20:30 -0500)
With this type check, I can change the size checks into assertions.

mach/powerpc/ncg/mach.c

index c63cc20..10a1cf1 100644 (file)
@@ -115,16 +115,13 @@ regscore(long offset, int size, int type, int frequency, int totype)
 
        switch (type) {
                case reg_float:
-                       if (size != 8) {
-                               fprintf(codefile, "! local %ld float size %d reject\n", offset, size);
+                       /* Don't put reg_float in reg_any. */
+                       if (totype != reg_float)
                                return -1;
-                       }
+                       assert(size == 8);
                        break;
                default:
-                       if (size != 4) {
-                               fprintf(codefile, "! local %ld int size %d reject\n", offset, size);
-                               return -1;
-                       }
+                       assert(size == 4);
                        break;
        }
 
@@ -139,7 +136,9 @@ regscore(long offset, int size, int type, int frequency, int totype)
         * 4 bytes if the local is a parameter.
         */
        score = 4 * frequency - 8 - ((offset >= 0) ? 4 : 0);
+#if 0
        fprintf(codefile, "! local %ld score %d\n", offset, score);
+#endif
        return score;
 }