This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Don't cross-jump in between frame related and non-frame related insns (PR target/80102, take 3)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 24 Mar 2017 14:04:42 +0100
- Subject: Re: [PATCH] Don't cross-jump in between frame related and non-frame related insns (PR target/80102, take 3)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jakub at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 4FF7613D15
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4FF7613D15
- References: <20170320211520.GO11094@tucnak> <ad6188d1-9413-35e9-3d1e-1edcd7b06bf6@redhat.com> <20170321074143.GT11094@tucnak> <20170321175334.GY11094@tucnak> <20170321202146.GA11094@tucnak> <3dea59bf-656e-beeb-fc7b-f5e796ba167b@redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Mar 24, 2017 at 06:37:10AM -0600, Jeff Law wrote:
> > 2017-03-21 Jakub Jelinek <jakub@redhat.com>
> >
> > PR target/80102
> > * cfgcleanup.c (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.
> Presumably this didn't ICE at some point in the past, so it's a regression?
> (it's not marked as such in the BZ).
It doesn't ICE for me with r238210 and ICEs with current trunk, I don't have
too many ppc64le compilers around though.
> > + /* If both i1 and i2 are frame related, verify all the CFA notes
> > + in the same order and with the same content. */
> > + if (RTX_FRAME_RELATED_P (i1))
> > + {
> > + static enum reg_note cfa_note_kinds[] = {
> > + REG_FRAME_RELATED_EXPR, REG_CFA_DEF_CFA, REG_CFA_ADJUST_CFA,
> > + REG_CFA_OFFSET, REG_CFA_REGISTER, REG_CFA_EXPRESSION,
> > + REG_CFA_VAL_EXPRESSION, REG_CFA_RESTORE, REG_CFA_SET_VDRAP,
> > + REG_CFA_TOGGLE_RA_MANGLE, REG_CFA_WINDOW_SAVE, REG_CFA_FLUSH_QUEUE
> > + };
> ISTM this could get out of date very easily. Is there a clean way to
> generate the array of cfa notes as we build up the notes from reg-notes.def?
We could e.g.
#ifndef REG_CFA_NOTE
# define REG_CFA_NOTE(NAME) REG_NOTE(NAME)
#endif
and then
REG_CFA_NOTE (FRAME_RELATED_EXPR)
etc. in reg-notes.def (and document that REG_CFA_NOTE should be used for
notes related to CFA).
Then in cfgcleanups.c we could just
#undef REG_CFA_NOTE
#define DEF_REG_NOTE(NAME)
#define REG_CFA_NOTE(NAME) REG_##NAME,
#include "reg-notes.def"
#undef DEF_REG_NOTE
#undef REG_CFA_NOTE
to populate the cfa_note_kinds array.
Jakub