Message ID | alpine.LSU.2.20.1903141225160.4934@zhemvz.fhfr.qr |
---|---|
State | New |
Headers | show |
Series | [i386] Fix DECL_RESULT building for resolver | expand |
On Thu, Mar 14, 2019 at 12:29:37PM +0100, Richard Biener wrote: > The following properly sets DECL_CONTEXT of the result decl we build, > otherwise LTO happily merges those across different resolver decls > ending up in IPA PTA ICEing on this invalidity. > > Bootstrap & regtest running on x86_64-unknown-linux-gnu, will apply > as obvious. > > Wonder if other targets copied from this, ah, powerpc did, > will commit a powerpc fix alongside (w/o further testing). Let's hope it works then ;-) Thanks for the fix! Segher
Index: gcc/config/i386/i386.c =================================================================== --- gcc/config/i386/i386.c (revision 269678) +++ gcc/config/i386/i386.c (working copy) @@ -32572,6 +32572,7 @@ make_resolver_func (const tree default_d } /* Build result decl and add to function_decl. */ t = build_decl (UNKNOWN_LOCATION, RESULT_DECL, NULL_TREE, ptr_type_node); + DECL_CONTEXT (t) = decl; DECL_ARTIFICIAL (t) = 1; DECL_IGNORED_P (t) = 1; DECL_RESULT (decl) = t; Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 269678) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -37467,6 +37467,7 @@ make_resolver_func (const tree default_d /* Build result decl and add to function_decl. */ tree t = build_decl (UNKNOWN_LOCATION, RESULT_DECL, NULL_TREE, ptr_type_node); + DECL_CONTEXT (t) = decl; DECL_ARTIFICIAL (t) = 1; DECL_IGNORED_P (t) = 1;