diff mbox

Fix wrong-code with IPA PTA

Message ID alpine.LSU.2.11.1512101011340.4884@t29.fhfr.qr
State New
Headers show

Commit Message

Richard Biener Dec. 10, 2015, 9:12 a.m. UTC
This fixes a missing constraint for by-reference DECL_RESULT in
nonlocal_p mode.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2015-12-10  Richard Biener  <rguenther@suse.de>

	* tree-ssa-structalias.c (create_function_info_for): Add missing
	constraint from nonlocal for DECL_RESULT.
diff mbox

Patch

Index: gcc/tree-ssa-structalias.c
===================================================================
--- gcc/tree-ssa-structalias.c	(revision 231494)
+++ gcc/tree-ssa-structalias.c	(working copy)
@@ -5631,6 +5630,11 @@  create_function_info_for (tree decl, con
       if (DECL_RESULT (decl))
 	insert_vi_for_tree (DECL_RESULT (decl), resultvi);
 
+      if (nonlocal_p
+	  && DECL_RESULT (decl)
+	  && DECL_BY_REFERENCE (DECL_RESULT (decl)))
+	make_constraint_from (resultvi, nonlocal_id);
+
       gcc_assert (prev_vi->offset < resultvi->offset);
       prev_vi->next = resultvi->id;
       prev_vi = resultvi;