Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(116)

Issue 9760043: [google gcc-4_8] not mapping debug expr to a deleted varpool node

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 11 months ago by xur
Modified:
10 years, 11 months ago
Reviewers:
davidxl
CC:
gcc-patches_gcc.gnu.org
Base URL:
svn+ssh://gcc.gnu.org/svn/gcc/branches/google/gcc-4_8/
Visibility:
Public.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -0 lines) Patch
M gcc/tree-inline.c View 1 chunk +11 lines, -0 lines 0 comments Download

Messages

Total messages: 3
xur
This patch fixes a bug in exposed in LIPO build (ICE in copy tree node). ...
10 years, 11 months ago (2013-05-24 23:27:00 UTC) #1
davidxl
On Fri, May 24, 2013 at 4:26 PM, Rong Xu <xur@google.com> wrote: > This patch ...
10 years, 11 months ago (2013-05-25 02:18:28 UTC) #2
xur
10 years, 11 months ago (2013-05-30 20:17:37 UTC) #3
On Fri, May 24, 2013 at 7:18 PM, Xinliang David Li <davidxl@google.com>
wrote:
>
> On Fri, May 24, 2013 at 4:26 PM, Rong Xu <xur@google.com> wrote:
> > This patch fixes a bug in exposed in LIPO build (ICE in copy tree node).
> >
> > Tested with bookstrap and google internal benchmarks.
> >
> > -Rong
> >
> > 2013-05-24  Rong Xu  <xur@google.com>
> >         Google ref b/8963414.
> >         * gcc/tree-inline.c (add_local_variables): Not map
> >         to deleted debug expression.
> >
> > Index: gcc/tree-inline.c
> > ===================================================================
> > --- gcc/tree-inline.c   (revision 199128)
> > +++ gcc/tree-inline.c   (working copy)
> > @@ -3788,6 +3788,17 @@ add_local_variables (struct function *callee,
stru
> >           {
> >             tree tem = DECL_DEBUG_EXPR (var);
> >             bool old_regimplify = id->regimplify;
> > +
> > +            /* The mapped debug expression might be deleted
> > +               as a varpool node (the reachbility analysis
> > +               of varpool node does not check the reference
> > +               from debug expressions.
> > +               Set it to 0 if that's the case.  */
> > +            if (L_IPO_COMP_MODE && tem &&
> > +                (TREE_STATIC (tem) || DECL_EXTERNAL(tem)) &&
> > +                real_varpool_node (tem) == NULL)
> > +              tem = NULL;
> > +
> >             id->remapping_type_depth++;
> >             walk_tree (&tem, copy_tree_body_r, id, NULL);
> >             id->remapping_type_depth--;
>
>
> IIUC, it is the real target var-decl of VAR that gets removed from
> lipo's symtab thus calling real_var_pool_node later will trigger
> gcc_assert. This fix just moved the assertion earlier?
>

No. There is no assertion after the fix. readl_varpool_node will not assert
in this case --- the decl is still there. We just did not get the varpool
node (we get a NULL pointer).
The ICE in walk_tree() when we clone that NULL varpool node.

> It should be ok for now to just drop the debug expr if the var is
> static/global.
>
> David
>
> >
> > --
> > This patch is available for review at
http://codereview.appspot.com/9760043
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b