This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH/RFC] SH64 EH with pic (4/4)


> It sounds reasonable.  How about the attached patch?  It also gets rid
> of the failure of libffi/unwindtest and looks generating appropriate cfi.
> Now I'm regtesting it with a slightly old mainline.

Hmm.  I thought that it would be necessary to suppress cfi generation for
either the move or the stack access, but now I see that we do not generate
cfi for the move from the target / special register in the first place.
So we also had a second bug, that we said only that a general purpose
register was saved, without mentioning first the move of the target /
special register into that general purpose register.
Your patch fixes both these bugs for target registers, but it doesn't fix
the latter one for PR_REG / special registers on SHcompact.

> +	    /* We gross over the intermediate copy and pretend we do
> +	       a direct save from the target register in the cfi.  */

Typo: s/gross/gloss/ .  Moreover, it is even more important to explain *why*
we are doing this.  And with the change below, we are doing a bit more, too.
I suggest:

+	    /* If we use an intermediate register for the save, we can't
+	       describe this exactly in cfi as a copy of the to-be-saved
+	       register into the temporary register and then the temporary
+	       register on the stack, because the temporary register can
+	       have a different natural size than the to-be-saved register.
+	       Thus, we gloss over the intermediate copy and pretend we do
+	       a direct save from the to-be-saved register.  */


> +	    if (TARGET_REGISTER_P (reg))

Make this (REGNO (reg_rtx) != reg) to catch the SHcompact problems.

> +	      {
> +		rtx set, note_rtx;
> +
> +		set = gen_rtx_SET (VOIDmode, mem_rtx, orig_reg_rtx);
> +		note_rtx = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, set,
> +					      REG_NOTES (insn));
> +		REG_NOTES (insn) = note_rtx;
> +	      }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]