OSDN Git Service

* rtl.c (rtx_equal_p): Check for null pointers when comparing rtx
authordanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 8 Dec 2001 06:11:25 +0000 (06:11 +0000)
committerdanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 8 Dec 2001 06:11:25 +0000 (06:11 +0000)
strings.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47785 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/rtl.c

index b07ac1b..792a400 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 3e73e4b..4d97bbd 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;