This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix PR50638 (segfault with emutls)
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Michael Matz <matz at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 8 Oct 2011 10:28:43 +0200
- Subject: Re: Fix PR50638 (segfault with emutls)
- References: <Pine.LNX.4.64.1110071830220.1483@wotan.suse.de>
On Fri, Oct 7, 2011 at 6:34 PM, Michael Matz <matz@suse.de> wrote:
> Hi,
>
> tree-emutls.c missed to called add_referenced_var for a variable that is
> referenced. ?That always was a bug, but meanwhile is fatal (causing a
> segfault). ?This fixes the problem. ?Okay for trunk if regstrapping
> succeeds?
Ok (qualifies even as obvious).
Thanks,
Richard.
> The related bugreport PR50640 (fortran segfaults for similar reasons) is a
> bit more involved and requires some pondering on my part. ?The PR50644
> (LTO segfault) requires some analysis still, to know which variable causes
> this.
>
>
> Ciao,
> Michael.
> -----------------
> ? ? ? ?PR middle-end/50638
> ? ? ? ?* tree-emutls.c (gen_emutls_addr): Call add_referenced_var.
>
> Index: tree-emutls.c
> ===================================================================
> --- tree-emutls.c ? ? ? (revision 179606)
> +++ tree-emutls.c ? ? ? (working copy)
> @@ -434,6 +434,7 @@ gen_emutls_addr (tree decl, struct lower
> ? ? ? addr = create_tmp_var (build_pointer_type (TREE_TYPE (decl)), NULL);
> ? ? ? x = gimple_build_call (d->builtin_decl, 1, build_fold_addr_expr (cdecl));
> ? ? ? gimple_set_location (x, d->loc);
> + ? ? ?add_referenced_var (cdecl);
>
> ? ? ? addr = make_ssa_name (addr, x);
> ? ? ? gimple_call_set_lhs (x, addr);
>