This commit is contained in:
Jakub Jelinek 2006-09-28 19:13:28 +00:00
parent 324a0ef6a3
commit 64c38ad92b
4 changed files with 87 additions and 8 deletions

View File

@ -1 +1 @@
gcc-4.1.1-20060926.tar.bz2 gcc-4.1.1-20060928.tar.bz2

74
gcc41-pr29272.patch Normal file
View File

@ -0,0 +1,74 @@
2006-09-28 Jakub Jelinek <jakub@redhat.com>
PR middle-end/29272
* builtins.c (fold_builtin_memset, fold_builtin_memory_op): Restrict
single entry optimization to variables and components thereof.
--- gcc/builtins.c.jj 2006-09-22 10:29:55.000000000 +0200
+++ gcc/builtins.c 2006-09-28 20:31:30.000000000 +0200
@@ -7905,7 +7905,7 @@ fold_builtin_exponent (tree fndecl, tree
static tree
fold_builtin_memset (tree arglist, tree type, bool ignore)
{
- tree dest, c, len, var, ret;
+ tree dest, c, len, var, ret, inner;
unsigned HOST_WIDE_INT length, cval;
if (!validate_arglist (arglist,
@@ -7939,6 +7939,15 @@ fold_builtin_memset (tree arglist, tree
&& !POINTER_TYPE_P (TREE_TYPE (var)))
return 0;
+ /* If var is a VAR_DECL or a component thereof,
+ we can use its alias set, otherwise we'd need to make
+ sure we go through alias set 0. */
+ inner = var;
+ while (handled_component_p (inner))
+ inner = TREE_OPERAND (inner, 0);
+ if (! SSA_VAR_P (inner))
+ return 0;
+
length = tree_low_cst (len, 1);
if (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (var))) != length
|| get_pointer_alignment (dest, BIGGEST_ALIGNMENT) / BITS_PER_UNIT
@@ -8009,7 +8018,7 @@ fold_builtin_bzero (tree arglist, bool i
static tree
fold_builtin_memory_op (tree arglist, tree type, bool ignore, int endp)
{
- tree dest, src, len, destvar, srcvar, expr;
+ tree dest, src, len, destvar, srcvar, expr, inner;
unsigned HOST_WIDE_INT length;
if (! validate_arglist (arglist,
@@ -8050,6 +8059,15 @@ fold_builtin_memory_op (tree arglist, tr
&& !SCALAR_FLOAT_TYPE_P (TREE_TYPE (destvar)))
return 0;
+ /* If destvar is a VAR_DECL or a component thereof,
+ we can use its alias set, otherwise we'd need to make
+ sure we go through alias set 0. */
+ inner = destvar;
+ while (handled_component_p (inner))
+ inner = TREE_OPERAND (inner, 0);
+ if (! SSA_VAR_P (inner))
+ return 0;
+
srcvar = src;
STRIP_NOPS (srcvar);
if (TREE_CODE (srcvar) != ADDR_EXPR)
@@ -8064,6 +8082,15 @@ fold_builtin_memory_op (tree arglist, tr
&& !SCALAR_FLOAT_TYPE_P (TREE_TYPE (srcvar)))
return 0;
+ /* If srcvar is a VAR_DECL or a component thereof,
+ we can use its alias set, otherwise we'd need to make
+ sure we go through alias set 0. */
+ inner = srcvar;
+ while (handled_component_p (inner))
+ inner = TREE_OPERAND (inner, 0);
+ if (! SSA_VAR_P (inner))
+ return 0;
+
length = tree_low_cst (len, 1);
if (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (destvar))) != length
|| get_pointer_alignment (dest, BIGGEST_ALIGNMENT) / BITS_PER_UNIT

View File

@ -1,6 +1,6 @@
%define DATE 20060926 %define DATE 20060928
%define gcc_version 4.1.1 %define gcc_version 4.1.1
%define gcc_release 26 %define gcc_release 27
%define _unpackaged_files_terminate_build 0 %define _unpackaged_files_terminate_build 0
%define multilib_64_archs sparc64 ppc64 s390x x86_64 %define multilib_64_archs sparc64 ppc64 s390x x86_64
%ifarch %{ix86} x86_64 ia64 %ifarch %{ix86} x86_64 ia64
@ -132,10 +132,9 @@ Patch23: gcc41-pr28709.patch
Patch24: gcc41-pr28755.patch Patch24: gcc41-pr28755.patch
Patch25: gcc41-pr27898.patch Patch25: gcc41-pr27898.patch
Patch26: gcc41-pr27567.patch Patch26: gcc41-pr27567.patch
Patch27: gcc41-pr29097.patch Patch27: gcc41-pr29272.patch
Patch28: gcc41-pr29059.patch Patch28: gcc41-pr29059.patch
Patch29: gcc41-strncat-chk.patch Patch29: gcc41-strncat-chk.patch
Patch30: gcc41-pr25261.patch
%define _gnu %{nil} %define _gnu %{nil}
%ifarch sparc %ifarch sparc
@ -445,10 +444,9 @@ which are required to run programs compiled with the GNAT.
%patch24 -p0 -b .pr28755~ %patch24 -p0 -b .pr28755~
%patch25 -p0 -b .pr27898~ %patch25 -p0 -b .pr27898~
%patch26 -p0 -b .pr27567~ %patch26 -p0 -b .pr27567~
%patch27 -p0 -b .pr29097~ %patch27 -p0 -b .pr29272~
%patch28 -p0 -b .pr29059~ %patch28 -p0 -b .pr29059~
%patch29 -p0 -b .strncat-chk~ %patch29 -p0 -b .strncat-chk~
%patch30 -p0 -b .pr25261~
sed -i -e 's/4\.1\.2/4.1.1/' gcc/BASE-VER gcc/version.c sed -i -e 's/4\.1\.2/4.1.1/' gcc/BASE-VER gcc/version.c
sed -i -e 's/" (Red Hat[^)]*)"/" (Red Hat %{version}-%{gcc_release})"/' gcc/version.c sed -i -e 's/" (Red Hat[^)]*)"/" (Red Hat %{version}-%{gcc_release})"/' gcc/version.c
@ -1510,6 +1508,13 @@ fi
%doc rpm.doc/changelogs/libmudflap/ChangeLog* %doc rpm.doc/changelogs/libmudflap/ChangeLog*
%changelog %changelog
* Thu Sep 28 2006 Jakub Jelinek <jakub@redhat.com> 4.1.1-27
- update from gcc-4_1-branch (-r117225:117266)
- PR target/29230
- restrict single entry mem{{,p}cpy,move,set} optimization to vars
and components thereof (PR middle-end/29272)
- fix java.util.Locale (Tom Tromey, #201712)
* Tue Sep 26 2006 Jakub Jelinek <jakub@redhat.com> 4.1.1-26 * Tue Sep 26 2006 Jakub Jelinek <jakub@redhat.com> 4.1.1-26
- update from gcc-4_1-branch (-r117162:117225) - update from gcc-4_1-branch (-r117162:117225)
- PRs classpath/28661, libgcj/29178, libstdc++/29179, libstdc++/29224 - PRs classpath/28661, libgcj/29178, libstdc++/29179, libstdc++/29224

View File

@ -1 +1 @@
691c96cd006fa802a35c63a9a7f017dd gcc-4.1.1-20060926.tar.bz2 64e2992874d48722891f2a7ccb9cf613 gcc-4.1.1-20060928.tar.bz2