This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA, patch] Add missing source location info to thunks
- From: Steven Bosscher <stevenb dot gcc at gmail dot com>
- To: Cary Coutant <ccoutant at google dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 4 Aug 2012 12:37:05 +0200
- Subject: Re: [RFA, patch] Add missing source location info to thunks
- References: <CAHACq4o-Q8oQqWsHZMgicPSM6295+TPg=L=w4Oa+aDkPziEHjw@mail.gmail.com>
On Sat, Aug 4, 2012 at 1:38 AM, Cary Coutant <ccoutant@google.com> wrote:
> diff --git a/gcc/final.c b/gcc/final.c
> index 095d608..d22130f 100644
> --- a/gcc/final.c
> +++ b/gcc/final.c
> @@ -1863,11 +1863,12 @@ final (rtx first, FILE *file, int optimize_p)
> start_to_bb = XCNEWVEC (basic_block, bb_map_size);
> end_to_bb = XCNEWVEC (basic_block, bb_map_size);
>
> - FOR_EACH_BB_REVERSE (bb)
> - {
> - start_to_bb[INSN_UID (BB_HEAD (bb))] = bb;
> - end_to_bb[INSN_UID (BB_END (bb))] = bb;
> - }
> + if (cfun->cfg != NULL)
> + FOR_EACH_BB_REVERSE (bb)
> + {
> + start_to_bb[INSN_UID (BB_HEAD (bb))] = bb;
> + end_to_bb[INSN_UID (BB_END (bb))] = bb;
> + }
> }
>
> /* Output the insns. */
Maybe check cfun->is_thunk instead? Everything else should have a cfg.
Ciao!
Steven