Patchwork [PR54177] Deal with var_lowpart failure in function parameters

login
register
mail settings
Submitter Alexandre Oliva
Date Oct. 2, 2012, 6:56 p.m.
Message ID <ory5jog0sl.fsf@livre.localdomain>
Download mbox | patch
Permalink /patch/188618/
State New
Headers show

Comments

Alexandre Oliva - Oct. 2, 2012, 6:56 p.m.
Uros has already taken care of the main patch for the problem, but I
feel it's appropriate to protect vt_add_function_parameter should
val_lowpart actually return NULL.

I'm checking this in as obvious.  Regstrapped on x86_64-linux-gnu and
i686-linux-gnu.

Patch

Deal with var_lowpart failure in function parameters.

From: Alexandre Oliva <aoliva@redhat.com>

for  gcc/ChangeLog

	* var-tracking.c (vt_add_function_parameter): Bail if
	var_lowpart fails.
---

 gcc/var-tracking.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)


diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index 9f5bc12..bbd2f4b 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -9428,6 +9428,7 @@  vt_add_function_parameter (tree parm)
       && GET_CODE (incoming) != PARALLEL)
     {
       cselib_val *val;
+      rtx lowpart;
 
       /* ??? We shouldn't ever hit this, but it may happen because
 	 arguments passed by invisible reference aren't dealt with
@@ -9436,7 +9437,11 @@  vt_add_function_parameter (tree parm)
       if (offset)
 	return;
 
-      val = cselib_lookup_from_insn (var_lowpart (mode, incoming), mode, true,
+      lowpart = var_lowpart (mode, incoming);
+      if (!lowpart)
+	return;
+
+      val = cselib_lookup_from_insn (lowpart, mode, true,
 				     VOIDmode, get_insns ());
 
       /* ??? Float-typed values in memory are not handled by