Sync include & libiberty with gcc

Message ID 3e2558b3-0eac-00f4-3287-30e54657a563@arm.com
State New
Headers show
Series
  • Sync include & libiberty with gcc
Related show

Commit Message

Richard Earnshaw (lists) May 31, 2018, 9:35 a.m.
I've just pushed 3 patches to bring libiberty and necessary include
files into line with the recent pushes to gcc's copies of these files.

For the record these are

memory leak in argv.c:
https://gcc.gnu.org/ml/gcc-patches/2017-12/msg01609.html

alignment for ubsan in md5.c:
https://gcc.gnu.org/ml/gcc-patches/2018-03/msg00019.html

new function in splay-tree.c:
https://gcc.gnu.org/ml/gcc-patches/2018-05/msg01547.html

Patch

From f7eadf51a8cd6e94ba33cd0b5b2a5063145859d6 Mon Sep 17 00:00:00 2001
From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu, 10 May 2018 10:15:42 +0000
Subject: [PATCH] Improve boostrap-ubsan config (PR bootstrap/64914).

2018-05-10  Martin Liska  <mliska@suse.cz>

	PR bootstrap/64914
	* md5.c: Use strict alignment with UBSAN_BOOTSTRAP.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@260112 138bc75d-0d04-0410-961f-82ee72b054a4
---
 libiberty/ChangeLog       | 5 +++++
 libiberty/md5.c           | 2 +-
 4 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index a116d37..b249226 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,8 @@ 
+2018-05-10  Martin Liska  <mliska@suse.cz>
+
+	PR bootstrap/64914
+	* md5.c: Use strict alignment with UBSAN_BOOTSTRAP.
+
 2018-04-30  Daniel van Gerpen  <daniel@vangerpen.de>
 
 	* argv.c (expandargv): Fix memory leak for copied argv.
diff --git a/libiberty/md5.c b/libiberty/md5.c
index f106d22..4dd5186a 100644
--- a/libiberty/md5.c
+++ b/libiberty/md5.c
@@ -231,7 +231,7 @@  md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx)
   /* Process available complete blocks.  */
   if (len > 64)
     {
-#if !_STRING_ARCH_unaligned
+#if !_STRING_ARCH_unaligned || defined UBSAN_BOOTSTRAP
 /* To check alignment gcc has an appropriate operator.  Other
    compilers don't.  */
 # if __GNUC__ >= 2
-- 
2.7.4