On 07/08/2011 05:51 AM, Dimitrios Apostolou wrote:
+         /* first write DF_REF_BASE */

This is not necessary. These uses are written to use_vec, while the uses from REG_EQUIV and REG_EQUAL are written to eq_use_vec (see df_ref_create_structure).

Also, anyway this wouldn't work because you would have to split the loop in two. I'll attribute that to the time of day when you were writing the message. :)

+        case REG_NON_LOCAL_GOTO:
+          /* The frame ptr is used by a non-local goto.  */
+          df_ref_record (DF_REF_BASE, collection_rec,
+                         regno_reg_rtx[FRAME_POINTER_REGNUM],
+                         NULL, bb, insn_info,
+                         DF_REF_REG_USE, 0);
+#if !HARD_FRAME_POINTER_IS_FRAME_POINTER
+          df_ref_record (DF_REF_BASE, collection_rec,
+                         regno_reg_rtx[HARD_FRAME_POINTER_REGNUM],
+                         NULL, bb, insn_info,
+                         DF_REF_REG_USE, 0);
+#endif
+          break;

Also note that you have to check which of FRAME_POINTER_REGNUM and HARD_FRAME_POINTER_REGNUM comes first here, if you want to ensure the DF_REF_BASE refs are created sorted. But it's likely better to _not_ create them sorted and just replace qsort with an insertion sort, as discussed offlist. It will cost a single swap in a pretty rare case.

Paolo

Reply via email to