diff mbox series

[i386] Fix DECL_RESULT building for resolver

Message ID alpine.LSU.2.20.1903141225160.4934@zhemvz.fhfr.qr
State New
Headers show
Series [i386] Fix DECL_RESULT building for resolver | expand

Commit Message

Richard Biener March 14, 2019, 11:29 a.m. UTC
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).

Richard.

2019-03-14  Richard Biener  <rguenther@suse.de>

	PR target/89711
	* config/i386/i386.c (make_resolver_func): Properly set
	DECL_CONTEXT on the RESULT_DECL.
	* config/rs6000/rs6000.c (make_resolver_func): Likewise.

   DECL_RESULT (decl) = t;

Comments

Segher Boessenkool March 14, 2019, 1:24 p.m. UTC | #1
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
diff mbox series

Patch

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;