This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[vta, trunk?] fix bootstrap-debug with -O3 on ia64
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 12 May 2008 04:25:40 -0300
- Subject: [vta, trunk?] fix bootstrap-debug with -O3 on ia64
The second part of this patch might be relevant for mainline as well.
The problem I got was that src was a CONST_INT, and using its mode
would cause the IF_THEN_ELSE to have VOIDmode instead of the expected
mode. This probably goes unnoticed preventing optimizations, although
I don't have a testcase for this. In the VTA branch, it triggered an
assertion failure with today's VTA patchset minus this one.
for gcc/ChangeLog.vta
from Alexandre Oliva <aoliva@redhat.com>
* cselib.c (cselib_reset_table_with_next_value): Add note to
preserve constants.
(cselib_record_sets): Use correct mode for IF_THEN_ELSE.
Index: gcc/cselib.c
===================================================================
--- gcc/cselib.c.orig 2008-05-12 04:06:40.000000000 -0300
+++ gcc/cselib.c 2008-05-12 04:10:43.000000000 -0300
@@ -246,6 +246,7 @@ cselib_reset_table_with_next_value (unsi
n_used_regs = 0;
+ /* ??? Preserve constants? */
htab_empty (cselib_hash_table);
n_useless_values = 0;
@@ -1738,7 +1739,7 @@ cselib_record_sets (rtx insn)
{
rtx src = sets[i].src;
if (cond)
- src = gen_rtx_IF_THEN_ELSE (GET_MODE (src), cond, src, dest);
+ src = gen_rtx_IF_THEN_ELSE (GET_MODE (dest), cond, src, dest);
sets[i].src_elt = cselib_lookup (src, GET_MODE (dest), 1);
if (MEM_P (dest))
sets[i].dest_addr_elt = cselib_lookup (XEXP (dest, 0), Pmode, 1);
--
Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}
FSFLA Board Member ÂSÃ Libre! => http://www.fsfla.org/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}