PATH: mixing define_peephole and define_peephole2

Herman ten Brugge Haj.Ten.Brugge@net.HCC.nl
Thu Aug 3 10:42:00 GMT 2000


Hello,

I was trying to implement define_peephole2 into the c4x.md file. The
compiler dumped core because the insn_code_number from the genpeep.c
was calculated incorrectly.

	Herman.


2000-08-03 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>

        * genpeep.c (main): Allow mixing of define_peephole and
	define_peephole2 definition in the md file.



--- genpeep.c.org	Thu Aug  3 19:36:02 2000
+++ genpeep.c	Thu Aug  3 19:34:35 2000
@@ -419,22 +419,15 @@ from the machine description file `md'. 
 
   while (1)
     {
-      int line_no, rtx_number = 0;
+      int line_no;
 
-      desc = read_md_rtx (&line_no, &rtx_number);
+      desc = read_md_rtx (&line_no, &insn_code_number);
       if (desc == NULL)
 	break;
 
        if (GET_CODE (desc) == DEFINE_PEEPHOLE)
 	{
 	  gen_peephole (desc);
-	  insn_code_number++;
-	}
-      if (GET_CODE (desc) == DEFINE_INSN
-	  || GET_CODE (desc) == DEFINE_EXPAND
-	  || GET_CODE (desc) == DEFINE_SPLIT)
-	{
-	  insn_code_number++;
 	}
     }
 


More information about the Gcc-patches mailing list