Hi,
this removes a duplicated statement, in fold-const.c in function getbyterep:
The comment, "Ideally this would turn into a gcc_checking_assert over time."
and the following if-statement are duplicated so one of them can be removed:
if (init_bytes > array_size)
init_bytes = array_size;
This happened due to a merge conflict a long time ago.
Bootstrapped and regtested on x86_64-pc-linux-gnu.
I think this qualifies as obvious, so I will commit it now.
Thanks
Bernd.
From 48a85b06992e4d915f29998f8db96ec2a019ea16 Mon Sep 17 00:00:00 2001
From: Bernd Edlinger <[email protected]>
Date: Tue, 3 Nov 2020 14:20:14 +0100
Subject: [PATCH] Cleanup of a merge mistake in fold-const.c
This removes a duplicated statement.
It was apparently introduced due to a merge mistake.
2020-11-03 Bernd Edlinger <[email protected]>
* fold-const.c (getbyterep): Remove duplicated statement.
---
gcc/fold-const.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index ebd32bb..c47557d 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -15565,11 +15565,6 @@ getbyterep (tree src, unsigned HOST_WIDE_INT *strsize)
is equal to strlen (A) + 1. */
const unsigned HOST_WIDE_INT array_size = tree_to_uhwi (mem_size);
unsigned HOST_WIDE_INT init_bytes = TREE_STRING_LENGTH (src);
-
- /* Ideally this would turn into a gcc_checking_assert over time. */
- if (init_bytes > array_size)
- init_bytes = array_size;
-
const char *string = TREE_STRING_POINTER (src);
/* Ideally this would turn into a gcc_checking_assert over time. */
--
1.9.1