re PR debug/54177 (Segfault in cselib_lookup due to NULL_RTX passed from vt_add_funct...
authorAlexandre Oliva <aoliva@redhat.com>
Tue, 2 Oct 2012 19:58:37 +0000 (19:58 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Tue, 2 Oct 2012 19:58:37 +0000 (19:58 +0000)
PR debug/54177
* var-tracking.c (vt_add_function_parameter): Bail if
var_lowpart fails.

From-SVN: r191999

gcc/ChangeLog
gcc/var-tracking.c

index 4612f03..1cb0b5c 100644 (file)
@@ -1,3 +1,9 @@
+2012-10-02  Alexandre Oliva <aoliva@redhat.com>
+
+       PR debug/54177
+       * var-tracking.c (vt_add_function_parameter): Bail if
+       var_lowpart fails.
+
 2012-10-02  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR target/54741
index 9f5bc12..bbd2f4b 100644 (file)
@@ -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