From 71145810908ff31ea6c2b98c0964e661d5b91c66 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Mon, 27 Dec 1999 11:35:07 +0000 Subject: [PATCH] fold-const.c (operand_equal_p): Use memcmp to compare string constants. * fold-const.c (operand_equal_p): Use memcmp to compare string constants. From-SVN: r31097 --- gcc/ChangeLog | 6 ++++++ gcc/fold-const.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dd06786f1b5..03fec709414 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +1999-12-23 Martin v. Löwis + + * fold-const.c (operand_equal_p): Use memcmp to compare string + constants. + Suggested by D. J. Bernstein + 1999-12-17 Jakub Jelinek * config/h8300/h8300.h (TARGET_H8300H, TARGET_H8300S): Make sure diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 4eaf4cef879..a59d6223099 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -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))); -- 2.30.2