OSDN Git Service

* reload1.c (move2add_last_cc0): New.
[pf3gnuchains/gcc-fork.git] / gcc / genextract.c
index 7c11136..e80fd20 100644 (file)
@@ -20,8 +20,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 02111-1307, USA.  */
 
 
-#include "hconfig.h"
+#include "bconfig.h"
 #include "system.h"
+#include "coretypes.h"
+#include "tm.h"
 #include "rtl.h"
 #include "errors.h"
 #include "insn-config.h"
@@ -210,12 +212,12 @@ walk_rtx (x, path)
       break;
 
     case MATCH_DUP:
-    case MATCH_PAR_DUP:
       duplocs[dup_count] = xstrdup (path);
       dupnums[dup_count] = XINT (x, 0);
       dup_count++;
       break;
 
+    case MATCH_PAR_DUP:
     case MATCH_OP_DUP:
       duplocs[dup_count] = xstrdup (path);
       dupnums[dup_count] = XINT (x, 0);
@@ -227,7 +229,7 @@ walk_rtx (x, path)
       
       for (i = XVECLEN (x, 1) - 1; i >= 0; i--)
         {
-         newpath[depth] = '0' + i;
+         newpath[depth] = (code == MATCH_OP_DUP ? '0' : 'a') + i;
          walk_rtx (XVECEXP (x, 1, i), newpath);
         }
       free (newpath);
@@ -321,7 +323,7 @@ print_path (path)
   /* We first write out the operations (XEXP or XVECEXP) in reverse
      order, then write "insn", then the indices in forward order.  */
 
-  for (i = len - 1; i >=0 ; i--)
+  for (i = len - 1; i >= 0 ; i--)
     {
       if (ISLOWER(path[i]))
        printf ("XVECEXP (");
@@ -360,7 +362,7 @@ main (argc, argv)
   progname = "genextract";
 
   if (argc <= 1)
-    fatal ("No input file name.");
+    fatal ("no input file name");
 
   if (init_md_reader_args (argc, argv) != SUCCESS_EXIT_CODE)
     return (FATAL_EXIT_CODE);
@@ -375,6 +377,8 @@ from the machine description file `md'.  */\n\n");
 
   printf ("#include \"config.h\"\n");
   printf ("#include \"system.h\"\n");
+  printf ("#include \"coretypes.h\"\n");
+  printf ("#include \"tm.h\"\n");
   printf ("#include \"rtl.h\"\n");
   printf ("#include \"insn-config.h\"\n");
   printf ("#include \"recog.h\"\n");
@@ -434,9 +438,11 @@ from the machine description file `md'.  */\n\n");
 
       /* The vector in the insn says how many operands it has.
         And all it contains are operands.  In fact, the vector was
-        created just for the sake of this function.  */
+        created just for the sake of this function.  We need to set the
+        location of the operands for sake of simplifications after
+        extraction, like eliminating subregs.  */
       printf ("      for (i = XVECLEN (pat, 0) - 1; i >= 0; i--)\n");
-      printf ("          ro[i] = XVECEXP (pat, 0, i);\n");
+      printf ("          ro[i] = *(ro_loc[i] = &XVECEXP (pat, 0, i));\n");
       printf ("      break;\n\n");
     }