This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Don't merge blocks in gimple at -O0 if that would lose goto_locus (PR debug/44375)
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Richard Guenther <rguenther at suse dot de>, gcc-patches at gcc dot gnu dot org
- Date: Sat, 20 Nov 2010 18:56:27 -0800
- Subject: Re: [PATCH] Don't merge blocks in gimple at -O0 if that would lose goto_locus (PR debug/44375)
- References: <20100602170934.GA10293@tyan-ft48-01.lab.bos.redhat.com>
On Wed, Jun 2, 2010 at 10:09 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> At -O0 -g we don't often emit any instructions with location
> of return stmt, either for return; stmts or when NRV happens.
>
> The problem is that the return is turned into a goto and merge_blocks
> then removes it, as the goto is to immediately following stmt.
>
> The following patch fixes it by avoiding the merge at -O0 in
> such cases. ?The RTL cfg cleanups know how to handle this
> and insert a nop insn with the right locus afterwards.
> Bootstrapped/regtested on x86_64-linux and i686-linux. ?Ok for trunk?
>
> Alternative patch is in the PR - emitting GIMPLE_NOP in between the stmts
> and for -O0 expand GIMPLE_NOPs with location as nop insns with that
> location.
>
> 2010-06-02 ?Jakub Jelinek ?<jakub@redhat.com>
>
> ? ? ? ?PR debug/44375
> ? ? ? ?* tree-cfg.c (gimple_can_merge_blocks_p): For -O0
> ? ? ? ?return false if merging the bbs would lead to goto_locus
> ? ? ? ?location being lost from the IL.
>
This caused:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46585
H.J.