fold-const.c (operand_equal_p): Use memcmp to compare string constants.
authorMartin v. Löwis <loewis@informatik.hu-berlin.de>
Mon, 27 Dec 1999 11:35:07 +0000 (11:35 +0000)
committerMartin v. Löwis <loewis@gcc.gnu.org>
Mon, 27 Dec 1999 11:35:07 +0000 (11:35 +0000)
* fold-const.c (operand_equal_p): Use memcmp to compare string
constants.

From-SVN: r31097

gcc/ChangeLog
gcc/fold-const.c

index dd06786f1b528fa8a5799517c5cdb5bb8b33b2b6..03fec709414263e2f7f35e6157764edd65eca404 100644 (file)
@@ -1,3 +1,9 @@
+1999-12-23  Martin v. Löwis  <loewis@informatik.hu-berlin.de>
+
+       * fold-const.c (operand_equal_p): Use memcmp to compare string
+       constants.
+       Suggested by D. J. Bernstein
+
 1999-12-17  Jakub Jelinek  <jakub@redhat.com>
 
        * config/h8300/h8300.h (TARGET_H8300H, TARGET_H8300S): Make sure
index 4eaf4cef879e17cc96bc1cbc4e6a922a4f91e510..a59d6223099532aac98f4756e82036a5a86b61e9 100644 (file)
@@ -2250,7 +2250,7 @@ operand_equal_p (arg0, arg1, only_const)
 
       case STRING_CST:
        return (TREE_STRING_LENGTH (arg0) == TREE_STRING_LENGTH (arg1)
-               && ! strncmp (TREE_STRING_POINTER (arg0),
+               && ! memcmp (TREE_STRING_POINTER (arg0),
                              TREE_STRING_POINTER (arg1),
                              TREE_STRING_LENGTH (arg0)));