diff mbox

Fix var-tracking for special record parameters passed indirectly

Message ID 2244478.hX7oRJZ8It@polaris
State New
Headers show

Commit Message

Eric Botcazou May 24, 2017, 8:12 a.m. UTC
var-tracking doesn't track structures and arrays as a whole because it cannot 
track values for multiple-part variables, but it has a special provision for 
Ada fat pointer types, which are structures with integral mode containing a 
pair of pointers and are pervasive in the language (see param-[123].c in the 
guality testsuite).  This works fine e.g. on x86 or x86-64, but not on SPARC 
or Visium which pass these structures indirectly as per their ABI.

Tested on x86_64-suse-linux and visium-elf, applied on mainline as obvious.


2017-05-24  Eric Botcazou  <ebotcazou@adacore.com>

	* var-tracking.c (track_expr_p): Do not return 0 for tracked record
	parameters passed indirectly.
diff mbox

Patch

Index: var-tracking.c
===================================================================
--- var-tracking.c	(revision 248140)
+++ var-tracking.c	(working copy)
@@ -5220,8 +5220,9 @@  track_expr_p (tree expr, bool need_rtl)
   if (decl_rtl && MEM_P (decl_rtl))
     {
       /* Do not track structures and arrays.  */
-      if (GET_MODE (decl_rtl) == BLKmode
-	  || AGGREGATE_TYPE_P (TREE_TYPE (realdecl)))
+      if ((GET_MODE (decl_rtl) == BLKmode
+	   || AGGREGATE_TYPE_P (TREE_TYPE (realdecl)))
+	  && !tracked_record_parameter_p (realdecl))
 	return 0;
       if (MEM_SIZE_KNOWN_P (decl_rtl)
 	  && MEM_SIZE (decl_rtl) > MAX_VAR_PARTS)