On 03/26/2017 03:00 PM, Jakub Jelinek wrote:
Hi!

On Sat, Mar 25, 2017 at 07:45:53AM +0100, Jakub Jelinek wrote:
On Fri, Mar 24, 2017 at 06:37:46PM -0500, Segher Boessenkool wrote:
On Fri, Mar 24, 2017 at 08:36:16PM +0100, Jakub Jelinek wrote:
+         /* Skip over reg notes not related to CFI information.  */
+         while (n1)
+           {
+             for (i = 0; i < ARRAY_SIZE (cfa_note_kinds) - 1; i++)
+               if (REG_NOTE_KIND (n1) == cfa_note_kinds[i])
+                 break;
+             if (i != ARRAY_SIZE (cfa_note_kinds))
+               break;
+             n1 = XEXP (n1, 1);
+           }

Maybe factor out reg_note_is_cfa_note and/or insns_have_identical_cfa_notes
functions?

Well, for the reg_note_is_cfa_note, actually it might be better to just
have a const bool array indexed by the note enum instead of the loop, I'll
implement it later.  And yes, I can outline insns_have_identical_cfa_notes.

Here is updated patch that does that, bootstrapped/regtested on
powerpc64le-linux, ok for trunk?

2017-03-26  Jakub Jelinek  <ja...@redhat.com>

        PR target/80102
        * reg-notes.def (REG_CFA_NOTE): Define.  Use it for CFA related
        notes.
        * cfgcleanup.c (reg_note_cfa_p): New array.
        (insns_have_identical_cfa_notes): New function.
        (old_insns_match_p): Don't cross-jump in between /f
        and non-/f instructions.  If both i1 and i2 are frame related,
        verify all CFA notes, their order and content.

        * g++.dg/opt/pr80102.C: New test.
OK.
jeff

Reply via email to