rtl.c (rtx_equal_p): Check for null pointers when comparing rtx strings.
authorJohn David Anglin <dave@hiauly1.hia.nrc.ca>
Sat, 8 Dec 2001 06:11:25 +0000 (06:11 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Sat, 8 Dec 2001 06:11:25 +0000 (06:11 +0000)
* rtl.c (rtx_equal_p): Check for null pointers when comparing rtx
strings.

From-SVN: r47785

gcc/ChangeLog
gcc/rtl.c

index b07ac1b438f44978c968564895cec5969a53466e..792a4008084100b9fbf17b8f522506ca577d07cd 100644 (file)
@@ -1,3 +1,8 @@
+2001-12-08  John David Anglin  <dave@hiauly1.hia.nrc.ca>
+
+       * rtl.c (rtx_equal_p): Check for null pointers when comparing rtx
+       strings.
+
 2001-12-07  Richard Henderson  <rth@redhat.com>
 
        * doc/extend.texi: Fix typo last change.
index 3e73e4bf835456774c0576291dc214ec3e71d335..4d97bbd14ab902199edaa381ccc8cd43651e556f 100644 (file)
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -670,7 +670,9 @@ rtx_equal_p (x, y)
 
        case 'S':
        case 's':
-         if (strcmp (XSTR (x, i), XSTR (y, i)))
+         if ((XSTR (x, i) || XSTR (y, i))
+             && (! XSTR (x, i) || ! XSTR (y, i)
+                 || strcmp (XSTR (x, i), XSTR (y, i))))
            return 0;
          break;