]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
peephole returns an rtx_insn
authorDavid Malcolm <dmalcolm@redhat.com>
Thu, 21 Aug 2014 09:40:09 +0000 (09:40 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Thu, 21 Aug 2014 09:40:09 +0000 (09:40 +0000)
2014-08-21  David Malcolm  <dmalcolm@redhat.com>

* output.h (peephole): Strengthen return type from rtx to
rtx_insn *.
* rtl.h (delete_for_peephole): Likewise for both params.
* genpeep.c (main): In generated "peephole" function, strengthen
return type and local "insn" from rtx to rtx_insn *.  For now,
rename param "ins1" to "uncast_ins1", adding "ins1" back as an
rtx_insn *, with a checked cast.
* jump.c (delete_for_peephole): Strengthen params "from", "to" and
locals "insn", "next", "prev" from rtx to rtx_insn *.

From-SVN: r214264

gcc/ChangeLog
gcc/genpeep.c
gcc/jump.c
gcc/output.h
gcc/rtl.h

index 5d9fc45c06fa27f3650cc9eba48b985805167034..840c79f1f8aad606756a2e3fdb0cdc44b92a0554 100644 (file)
@@ -1,3 +1,15 @@
+2014-08-21  David Malcolm  <dmalcolm@redhat.com>
+
+       * output.h (peephole): Strengthen return type from rtx to
+       rtx_insn *.
+       * rtl.h (delete_for_peephole): Likewise for both params.
+       * genpeep.c (main): In generated "peephole" function, strengthen
+       return type and local "insn" from rtx to rtx_insn *.  For now,
+       rename param "ins1" to "uncast_ins1", adding "ins1" back as an
+       rtx_insn *, with a checked cast.
+       * jump.c (delete_for_peephole): Strengthen params "from", "to" and
+       locals "insn", "next", "prev" from rtx to rtx_insn *.
+
 2014-08-21  Marc Glisse  <marc.glisse@inria.fr>
 
        PR tree-optimization/62112
index a8afadbc809e3149ea472bf091d85f347265beb9..bc2785e6e7d412296a7e7c5ac138327b78cb971b 100644 (file)
@@ -378,8 +378,10 @@ from the machine description file `md'.  */\n\n");
   printf ("extern rtx peep_operand[];\n\n");
   printf ("#define operands peep_operand\n\n");
 
-  printf ("rtx\npeephole (rtx ins1)\n{\n");
-  printf ("  rtx insn ATTRIBUTE_UNUSED, x ATTRIBUTE_UNUSED, pat ATTRIBUTE_UNUSED;\n\n");
+  printf ("rtx_insn *\npeephole (rtx uncast_ins1)\n{\n");
+  printf ("  rtx_insn *ins1 = as_a <rtx_insn *> (uncast_ins1);\n");
+  printf ("  rtx_insn *insn ATTRIBUTE_UNUSED;\n");
+  printf ("  rtx x ATTRIBUTE_UNUSED, pat ATTRIBUTE_UNUSED;\n\n");
 
   /* Early out: no peepholes for insns followed by barriers.  */
   printf ("  if (NEXT_INSN (ins1)\n");
index 6a8b9d5b7b4be41087e1c10ac88eb30e582113e2..96bdbe8ffbbbd2d4c202740e0526574f524397fe 100644 (file)
@@ -1398,14 +1398,14 @@ delete_related_insns (rtx insn)
    peephole insn that will replace them.  */
 
 void
-delete_for_peephole (rtx from, rtx to)
+delete_for_peephole (rtx_insn *from, rtx_insn *to)
 {
-  rtx insn = from;
+  rtx_insn *insn = from;
 
   while (1)
     {
-      rtx next = NEXT_INSN (insn);
-      rtx prev = PREV_INSN (insn);
+      rtx_insn *next = NEXT_INSN (insn);
+      rtx_insn *prev = PREV_INSN (insn);
 
       if (!NOTE_P (insn))
        {
index 2b32601d861c45d81448f80291792c4742f15303..53d575a3de66f258ededcf7eed3b61ef7900b299 100644 (file)
@@ -281,7 +281,7 @@ extern void assemble_addr_to_section (rtx, section *);
 extern int get_pool_size (void);
 
 #ifdef HAVE_peephole
-extern rtx peephole (rtx);
+extern rtx_insn *peephole (rtx);
 #endif
 
 extern void output_shared_constant_pool (void);
index f9713f1fcbc1e2147b59d165862dfe844965a386..7d31333c6bef27e97f873a31c9c01b9a3f4c3891 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -3062,7 +3062,7 @@ extern rtx reversed_comparison (const_rtx, enum machine_mode);
 extern enum rtx_code reversed_comparison_code (const_rtx, const_rtx);
 extern enum rtx_code reversed_comparison_code_parts (enum rtx_code, const_rtx,
                                                     const_rtx, const_rtx);
-extern void delete_for_peephole (rtx, rtx);
+extern void delete_for_peephole (rtx_insn *, rtx_insn *);
 extern int condjump_in_parallel_p (const_rtx);
 
 /* In emit-rtl.c.  */