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: [RFA, patch] Add missing source location info to thunks


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


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