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 committed] Fix target/40313


On Sun, May 31, 2009 at 11:51 PM, Kaz Kojima <kkojima@rr.iij4u.or.jp> wrote:
> Hi,
>
> I've applied the attached patch to fix PR target/40313.
> In failing case, insn scheduling after reload pass moves a frame
> related insn in the prologue after NOTE_INSN_EPILOGUE_BEG note
> and this confuses dwarf2out_begin_epilogue. ?The patch emits
> a blockage insn before such insn in that situation. ?This may
> make a difference of the codes with/without -g which isn't good
> in general, but I guess it wouldn't be a real problem in this

The usual approach is to do it unconditionally then.  Why not do
that in this case as well?

Thanks,
Richard.

> specific situation because if such movement of the frame related
> insn happened, then no one can expect -g works well in the first
> place.
>
> The patch is tested with bootstrap and the top level "make -k
> check" on sh4-unknown-linux-gnu with no new failures.
>
> Regards,
> ? ? ? ?kaz
> --
> 2009-05-31 ?Kaz Kojima ?<kkojima@gcc.gnu.org>
>
> ? ? ? ?PR target/40313
> ? ? ? ?* config/sh/sh.c: Include debug.h.
> ? ? ? ?(sh_expand_epilogue): Emit a blockage insn before the frame
> ? ? ? ?pointer adjustment also when dwarf2out_do_frame returns true.
>
> --- ORIG/trunk/gcc/config/sh/sh.c ? ? ? 2009-05-30 18:35:42.000000000 +0900
> +++ trunk/gcc/config/sh/sh.c ? ?2009-05-31 08:46:05.000000000 +0900
> @@ -43,6 +43,7 @@ along with GCC; see the file COPYING3.
> ?#include "target.h"
> ?#include "target-def.h"
> ?#include "real.h"
> +#include "debug.h"
> ?#include "langhooks.h"
> ?#include "basic-block.h"
> ?#include "df.h"
> @@ -6747,8 +6748,9 @@ sh_expand_epilogue (bool sibcall_p)
> ? if (frame_pointer_needed)
> ? ? {
> ? ? ? /* We must avoid scheduling the epilogue with previous basic blocks
> - ? ? ? ?when exception handling is enabled. ?See PR/18032. ?*/
> - ? ? ?if (flag_exceptions)
> + ? ? ? ?when exception handling or frame information is needed.
> + ? ? ? ?See PR/18032 and PR/40313. ?*/
> + ? ? ?if (flag_exceptions || dwarf2out_do_frame ())
> ? ? ? ?emit_insn (gen_blockage ());
> ? ? ? output_stack_adjust (frame_size, hard_frame_pointer_rtx, e,
> ? ? ? ? ? ? ? ? ? ? ? ? ? &live_regs_mask);
>


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