rpms/gcc/devel gcc41-s390-rh199604.patch, 1.1.2.1, 1.1.2.2 gcc41.spec, 1.88.2.1, 1.88.2.2
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Wed Aug 16 23:55:29 UTC 2006
Author: aoliva
Update of /cvs/dist/rpms/gcc/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv1504
Modified Files:
Tag: private-aoliva-gcc-4_1_1-13-branch
gcc41-s390-rh199604.patch gcc41.spec
Log Message:
* Wed Aug 16 2006 Alexandre Oliva <aoliva at redhat.com> 4.1.1-13.0.lxo.2
- Improve fix for openssl on s390. (BZ#199604, target/28146)
gcc41-s390-rh199604.patch:
reload.c | 36 ++++++++++++++++++++++++++++++++++++
reload.h | 1 +
reload1.c | 15 +++++++++++++++
3 files changed, 52 insertions(+)
Index: gcc41-s390-rh199604.patch
===================================================================
RCS file: /cvs/dist/rpms/gcc/devel/Attic/gcc41-s390-rh199604.patch,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- gcc41-s390-rh199604.patch 27 Jul 2006 05:47:04 -0000 1.1.2.1
+++ gcc41-s390-rh199604.patch 16 Aug 2006 23:55:26 -0000 1.1.2.2
@@ -1,98 +1,185 @@
for gcc/ChangeLog
from Alexandre Oliva <aoliva at redhat.com>
- * rtlanal.c (count_occurrences): Add new flag to enable
- comparison of MEM attributes.
- * reload1.c (delete_output_reload): Use it to count the
- results of register elimination.
+ PR target/28146
+ * reload.h (reg_equiv_alt_mem_list): New declaration.
+ * reload1.c (reg_equiv_alt_mem_list): New definition.
+ (reload): Initialize it and release it.
+ (delete_output_reload): Use it.
+ * reload.c (push_reg_equiv_alt_mem): New function.
+ (find_reloads_toplev): Call it.
+ (find_reloads_address, find_reloads_address_1): Likewise.
+ (find_reloads_subreg_address): Likewise.
Index: gcc/reload1.c
===================================================================
---- gcc/reload1.c.orig 2006-06-19 11:53:32.000000000 -0300
-+++ gcc/reload1.c 2006-07-26 07:07:40.000000000 -0300
-@@ -7798,9 +7798,21 @@ delete_output_reload (rtx insn, int j, i
- }
- n_occurrences = count_occurrences (PATTERN (insn), reg, 0);
- if (substed)
-- n_occurrences += count_occurrences (PATTERN (insn),
-- eliminate_regs (substed, 0,
-- NULL_RTX), 0);
-+ {
-+ rtx elim = eliminate_regs (substed, 0, NULL_RTX);
-+ int flags = 0;
+--- gcc/reload1.c.orig 2006-08-16 05:47:32.000000000 -0300
++++ gcc/reload1.c 2006-08-16 05:48:07.000000000 -0300
+@@ -120,6 +120,10 @@ rtx *reg_equiv_address;
+ or zero if pseudo reg N is not equivalent to a memory slot. */
+ rtx *reg_equiv_mem;
+
++/* Element N is an EXPR_LIST of REG_EQUIVs containing MEMs with
++ alternate representations of the location of pseudo reg N. */
++rtx *reg_equiv_alt_mem_list;
+
-+ /* eliminate_regs() may create simple rtxes for a pseudo mapped
-+ to memory such as (plus (reg) (const_int X)) where the
-+ reload-generated corresponding address is (plus (plus (reg)
-+ (const_int Y)) (const_int Z)), where X = Y + Z. We have to
-+ match them otherwise we lose, so take advantage of memory
-+ attributes. */
-+ if (MEM_P (elim) && MEM_ATTRS (elim))
-+ flags |= 2;
+ /* Widest width in which each pseudo reg is referred to (via subreg). */
+ static unsigned int *reg_max_ref_width;
+
+@@ -701,6 +705,7 @@ reload (rtx first, int global)
+ reg_equiv_constant = xcalloc (max_regno, sizeof (rtx));
+ reg_equiv_invariant = xcalloc (max_regno, sizeof (rtx));
+ reg_equiv_mem = xcalloc (max_regno, sizeof (rtx));
++ reg_equiv_alt_mem_list = xcalloc (max_regno, sizeof (rtx));
+ reg_equiv_address = xcalloc (max_regno, sizeof (rtx));
+ reg_max_ref_width = xcalloc (max_regno, sizeof (int));
+ reg_old_renumber = xcalloc (max_regno, sizeof (short));
+@@ -1258,6 +1263,11 @@ reload (rtx first, int global)
+ if (offsets_at)
+ free (offsets_at);
+
++ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
++ if (reg_equiv_alt_mem_list[i])
++ free_EXPR_LIST_list (®_equiv_alt_mem_list[i]);
++ free (reg_equiv_alt_mem_list);
+
-+ n_occurrences += count_occurrences (PATTERN (insn), elim, flags);
+ free (reg_equiv_mem);
+ reg_equiv_init = 0;
+ free (reg_equiv_address);
+@@ -7801,6 +7811,11 @@ delete_output_reload (rtx insn, int j, i
+ n_occurrences += count_occurrences (PATTERN (insn),
+ eliminate_regs (substed, 0,
+ NULL_RTX), 0);
++ for (i1 = reg_equiv_alt_mem_list [REGNO (reg)]; i1; i1 = XEXP (i1, 1))
++ {
++ gcc_assert (!rtx_equal_p (XEXP (i1, 0), substed));
++ n_occurrences += count_occurrences (PATTERN (insn), XEXP (i1, 0), 0);
+ }
if (n_occurrences > n_inherited)
return;
-Index: gcc/rtlanal.c
+Index: gcc/reload.c
===================================================================
---- gcc/rtlanal.c.orig 2005-11-04 06:41:19.000000000 -0200
-+++ gcc/rtlanal.c 2006-07-26 07:09:06.000000000 -0300
-@@ -547,11 +547,15 @@ global_reg_mentioned_p (rtx x)
- return for_each_rtx (&x, global_reg_mentioned_p_1, NULL);
- }
+--- gcc/reload.c.orig 2006-08-16 05:47:32.000000000 -0300
++++ gcc/reload.c 2006-08-16 05:47:39.000000000 -0300
+@@ -282,6 +282,26 @@ static int find_inc_amount (rtx, rtx);
+ static int refers_to_mem_for_reload_p (rtx);
+ static int refers_to_regno_for_reload_p (unsigned int, unsigned int,
+ rtx, rtx *);
++
++/* Add NEW to reg_equiv_alt_mem_list[REGNO] if it's different from
++ ORIG and not present in the list yet. */
++
++static inline void
++push_reg_equiv_alt_mem (int regno, rtx new, rtx orig)
++{
++ rtx it;
++
++ if (new == orig)
++ return;
++
++ for (it = reg_equiv_alt_mem_list [regno]; it; it = XEXP (it, 1))
++ if (rtx_equal_p (XEXP (it, 0), new))
++ return;
++
++ reg_equiv_alt_mem_list [regno]
++ = alloc_EXPR_LIST (REG_EQUIV, new,
++ reg_equiv_alt_mem_list [regno]);
++}
--/* Return the number of places FIND appears within X. If COUNT_DEST is
-- zero, we do not count occurrences inside the destination of a SET. */
-+/* Return the number of places FIND appears within X. If COUNT_FLAGS
-+ has the least-significant bit zero, we do not count occurrences
-+ inside the destination of a SET. If COUNT_FLAGS has the
-+ second-least-significant bit one, FIND is assumed to be a MEM with
-+ attributes, and we compare MEMs containing attributes with it by
-+ their attributes rather than by rtx equality. */
-
- int
--count_occurrences (rtx x, rtx find, int count_dest)
-+count_occurrences (rtx x, rtx find, int flags)
- {
- int i, j;
- enum rtx_code code;
-@@ -576,13 +580,19 @@ count_occurrences (rtx x, rtx find, int
- return 0;
-
- case MEM:
-- if (MEM_P (find) && rtx_equal_p (x, find))
-+ if ((flags & 2) && MEM_ATTRS (x))
-+ {
-+ if (MEM_EXPR (find) == MEM_EXPR (x)
-+ && MEM_OFFSET (find) == MEM_OFFSET (x))
-+ return 1;
-+ }
-+ else if (MEM_P (find) && rtx_equal_p (x, find))
- return 1;
- break;
-
- case SET:
-- if (SET_DEST (x) == find && ! count_dest)
-- return count_occurrences (SET_SRC (x), find, count_dest);
-+ if (SET_DEST (x) == find && ! (flags & 1))
-+ return count_occurrences (SET_SRC (x), find, flags);
- break;
-
- default:
-@@ -597,12 +607,12 @@ count_occurrences (rtx x, rtx find, int
- switch (*format_ptr++)
- {
- case 'e':
-- count += count_occurrences (XEXP (x, i), find, count_dest);
-+ count += count_occurrences (XEXP (x, i), find, flags);
- break;
-
- case 'E':
- for (j = 0; j < XVECLEN (x, i); j++)
-- count += count_occurrences (XVECEXP (x, i, j), find, count_dest);
-+ count += count_occurrences (XVECEXP (x, i, j), find, flags);
- break;
- }
- }
+ #ifdef HAVE_SECONDARY_RELOADS
+
+@@ -4557,6 +4577,7 @@ find_reloads_toplev (rtx x, int opnum, e
+ x = mem;
+ i = find_reloads_address (GET_MODE (x), &x, XEXP (x, 0), &XEXP (x, 0),
+ opnum, type, ind_levels, insn);
++ push_reg_equiv_alt_mem (regno, x, mem);
+ if (address_reloaded)
+ *address_reloaded = i;
+ }
+@@ -4765,9 +4786,12 @@ find_reloads_address (enum machine_mode
+ tem = make_memloc (ad, regno);
+ if (! strict_memory_address_p (GET_MODE (tem), XEXP (tem, 0)))
+ {
++ rtx orig = tem;
++
+ find_reloads_address (GET_MODE (tem), &tem, XEXP (tem, 0),
+ &XEXP (tem, 0), opnum,
+ ADDR_TYPE (type), ind_levels, insn);
++ push_reg_equiv_alt_mem (regno, tem, orig);
+ }
+ /* We can avoid a reload if the register's equivalent memory
+ expression is valid as an indirect memory address.
+@@ -5520,6 +5544,8 @@ find_reloads_address_1 (enum machine_mod
+ if (reg_equiv_address[regno]
+ || ! rtx_equal_p (tem, reg_equiv_mem[regno]))
+ {
++ rtx orig = tem;
++
+ /* First reload the memory location's address.
+ We can't use ADDR_TYPE (type) here, because we need to
+ write back the value after reading it, hence we actually
+@@ -5529,6 +5555,8 @@ find_reloads_address_1 (enum machine_mod
+ RELOAD_OTHER,
+ ind_levels, insn);
+
++ push_reg_equiv_alt_mem (regno, tem, orig);
++
+ /* Then reload the memory location into a base
+ register. */
+ reloadnum = push_reload (tem, tem, &XEXP (x, 0),
+@@ -5583,6 +5611,8 @@ find_reloads_address_1 (enum machine_mod
+ if (reg_equiv_address[regno]
+ || ! rtx_equal_p (tem, reg_equiv_mem[regno]))
+ {
++ rtx orig = tem;
++
+ /* First reload the memory location's address.
+ We can't use ADDR_TYPE (type) here, because we need to
+ write back the value after reading it, hence we actually
+@@ -5590,6 +5620,7 @@ find_reloads_address_1 (enum machine_mod
+ find_reloads_address (GET_MODE (tem), &tem, XEXP (tem, 0),
+ &XEXP (tem, 0), opnum, type,
+ ind_levels, insn);
++ push_reg_equiv_alt_mem (regno, tem, orig);
+ /* Put this inside a new increment-expression. */
+ x = gen_rtx_fmt_e (GET_CODE (x), GET_MODE (x), tem);
+ /* Proceed to reload that, as if it contained a register. */
+@@ -5779,6 +5810,7 @@ find_reloads_address_1 (enum machine_mod
+ find_reloads_address (GET_MODE (x), &x, XEXP (x, 0),
+ &XEXP (x, 0), opnum, ADDR_TYPE (type),
+ ind_levels, insn);
++ push_reg_equiv_alt_mem (regno, x, tem);
+ }
+ }
+
+@@ -5962,6 +5994,7 @@ find_reloads_subreg_address (rtx x, int
+ unsigned outer_size = GET_MODE_SIZE (GET_MODE (x));
+ unsigned inner_size = GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)));
+ int offset;
++ rtx orig = tem;
+
+ /* For big-endian paradoxical subregs, SUBREG_BYTE does not
+ hold the correct (negative) byte offset. */
+@@ -5997,6 +6030,9 @@ find_reloads_subreg_address (rtx x, int
+ find_reloads_address (GET_MODE (tem), &tem, XEXP (tem, 0),
+ &XEXP (tem, 0), opnum, type,
+ ind_levels, insn);
++ /* ??? Do we need to handle nonzero offsets somehow? */
++ if (!offset)
++ push_reg_equiv_alt_mem (regno, tem, orig);
+
+ /* If this is not a toplevel operand, find_reloads doesn't see
+ this substitution. We have to emit a USE of the pseudo so
+Index: gcc/reload.h
+===================================================================
+--- gcc/reload.h.orig 2006-08-16 05:47:32.000000000 -0300
++++ gcc/reload.h 2006-08-16 05:47:39.000000000 -0300
+@@ -170,6 +170,7 @@ extern rtx *reg_equiv_invariant;
+ extern rtx *reg_equiv_memory_loc;
+ extern rtx *reg_equiv_address;
+ extern rtx *reg_equiv_mem;
++extern rtx *reg_equiv_alt_mem_list;
+
+ /* Element N is the list of insns that initialized reg N from its equivalent
+ constant or memory slot. */
Index: gcc41.spec
===================================================================
RCS file: /cvs/dist/rpms/gcc/devel/gcc41.spec,v
retrieving revision 1.88.2.1
retrieving revision 1.88.2.2
diff -u -r1.88.2.1 -r1.88.2.2
--- gcc41.spec 27 Jul 2006 05:47:04 -0000 1.88.2.1
+++ gcc41.spec 16 Aug 2006 23:55:26 -0000 1.88.2.2
@@ -1,6 +1,6 @@
%define DATE 20060721
%define gcc_version 4.1.1
-%define gcc_release 13.0.lxo.1
+%define gcc_release 13.0.lxo.2
%define _unpackaged_files_terminate_build 0
%define multilib_64_archs sparc64 ppc64 s390x x86_64
%ifarch %{ix86} x86_64 ia64
@@ -1524,8 +1524,11 @@
%doc rpm.doc/changelogs/libmudflap/ChangeLog*
%changelog
+* Wed Aug 16 2006 Alexandre Oliva <aoliva at redhat.com> 4.1.1-13.0.lxo.2
+- Improve fix for openssl on s390. (BZ#199604, target/28146)
+
* Thu Jul 27 2006 Alexandre Oliva <aoliva at redhat.com> 4.1.1-13.0.lxo.1
-- Fix reload problem that breaks openssl on s390. (BZ#199640, perhaps
+- Fix reload problem that breaks openssl on s390. (BZ#199604, perhaps
also PR target/28146)
* Tue Jul 25 2006 Alexandre Oliva <aoliva at redhat.com> 4.1.1-13
More information about the fedora-cvs-commits
mailing list