This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: gcc-4.8 + tree-loop-distribute-patterns breaks glibc-2.18
- From: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Date: Tue, 21 May 2013 16:20:03 -0300
- Subject: Re: gcc-4.8 + tree-loop-distribute-patterns breaks glibc-2.18
- References: <20130520120304 dot GA10899 at winnix> <519A19D4 dot 6000001 at linux dot vnet dot ibm dot com> <519B35C8 dot 108 at suse dot com>
On 21-05-2013 05:52, Andreas Jaeger wrote:
> My suggestion was to simplify your patch: remove all the configure parts and unconditionally include <string.h> (together with a comment) where needed (as in your patch).
>
> Wouldn't that work?
>
> Andreas
For the check-localplt case I think it is suffice, but I'm not sure if it will be the
case for string algorithms in the loader (I'll check it). I did the configure part
mostly to be prepared fr such cases where include <string.h> is not enough.
Based on your comments, I propose the following patch to fix the check-localplt issues
I observed with GCC 4.8 and GCC trunk on PPC32 and PPC64. I tested with default 4.8
from gcc site and also with today gcc trunk on both PPC32 and PCP64.
Any comments?
---
2013-05-21 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
* stdlib/divrem.c: Include <string.h> to avoid string function PLT
call from loop transformation.
* stdlib/mul.c: Likewise.
* stdlib/mul_n.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c: Likewise.
* wcsmbs/wcpncpy.c: Likewise.
* wcsmbs/wcsncpy.c: Likewise.
--
diff --git a/stdlib/divrem.c b/stdlib/divrem.c
index 99c782e..d15e72e 100644
--- a/stdlib/divrem.c
+++ b/stdlib/divrem.c
@@ -19,6 +19,7 @@ You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library; see the file COPYING.LIB. If not, see
<http://www.gnu.org/licenses/>. */
+#include <string.h> /* memmove/memset prototypes to avoid PLT calls. */
#include <gmp.h>
#include "gmp-impl.h"
#include "longlong.h"
diff --git a/stdlib/mul.c b/stdlib/mul.c
index 1258717..d1c8d54 100644
--- a/stdlib/mul.c
+++ b/stdlib/mul.c
@@ -18,6 +18,7 @@ You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library; see the file COPYING.LIB. If not, see
<http://www.gnu.org/licenses/>. */
+#include <string.h> /* memmove/memset prototypes to avoid PLT calls. */
#include <gmp.h>
#include "gmp-impl.h"
diff --git a/stdlib/mul_n.c b/stdlib/mul_n.c
index f0a9a30..998cd0b 100644
--- a/stdlib/mul_n.c
+++ b/stdlib/mul_n.c
@@ -18,6 +18,7 @@ You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library; see the file COPYING.LIB. If not, see
<http://www.gnu.org/licenses/>. */
+#include <string.h> /* memmove/memset prototypes to avoid PLT calls. */
#include <gmp.h>
#include "gmp-impl.h"
diff --git a/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c b/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c
index 00e44b8..030c704 100644
--- a/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c
+++ b/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c
@@ -22,6 +22,7 @@
#include <float.h>
#include <math.h>
#include <stdlib.h>
+#include <string.h> /* memmove/memset prototypes to avoid PLT calls. */
/* Convert a `long double' in IBM extended format to a multi-precision
integer representing the significand scaled up by its number of
diff --git a/wcsmbs/wcpncpy.c b/wcsmbs/wcpncpy.c
index 634d335..06860a8 100644
--- a/wcsmbs/wcpncpy.c
+++ b/wcsmbs/wcpncpy.c
@@ -16,6 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <string.h> /* memmove/memset prototypes to avoid PLT calls. */
#include <wchar.h>
diff --git a/wcsmbs/wcsncpy.c b/wcsmbs/wcsncpy.c
index a88f8fc..e804380 100644
--- a/wcsmbs/wcsncpy.c
+++ b/wcsmbs/wcsncpy.c
@@ -16,6 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <string.h> /* memmove/memset prototypes to avoid PLT calls. */
#include <wchar.h>