This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Committed] PR26977: Invalid paradoxical SUBREGs in emit_group_store
- From: Roger Sayle <roger at eyesopen dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 2 Apr 2006 16:03:38 -0600 (MDT)
- Subject: [Committed] PR26977: Invalid paradoxical SUBREGs in emit_group_store
The following patch should resolve PR middle-end/26977 which is a
bootstrap failure building Ada on IA-64 introduced by my recent fix
for PR17959. It turns out that simplify_gen_subreg can sometimes
return NULL_RTX if it fails to produce a legitimate paradoxical SUBREG.
In the case of this failure, it doesn't like a paradoxical extension
from SFmode to TImode, even though we seem to be able to create an
insv instruction for the same mode combination.
The obvious patch below checks whether simplify_gen_subreg returns
a non-NULL rtx before performing the new optimization.
This patch has been tested on x86_64-unknown-linux-gnu, with a
full "make bootstrap", all default languages, and regression
tested with a top-level "make -k check" with no new failures.
Committed to mainline as revision 112626.
Many thanks to Andreas Schwab for his help investigating this.
2006-04-02 Roger Sayle <roger@eyesopen.com>
PR middle-end/26977
* expr.c (emit_group_store): Check whether simplify_gen_subreg returns
NULL_RTX, indicating it couldn't create a valid paradoxical subreg.
Index: expr.c
===================================================================
*** expr.c (revision 112608)
--- expr.c (working copy)
*************** emit_group_store (rtx orig_dst, rtx src,
*** 1945,1953 ****
{
temp = simplify_gen_subreg (outer, tmps[start],
inner, bytepos);
! emit_move_insn (dst, temp);
! done = true;
! start++;
}
}
--- 1945,1956 ----
{
temp = simplify_gen_subreg (outer, tmps[start],
inner, bytepos);
! if (temp)
! {
! emit_move_insn (dst, temp);
! done = true;
! start++;
! }
}
}
*************** emit_group_store (rtx orig_dst, rtx src,
*** 1961,1969 ****
{
temp = simplify_gen_subreg (outer, tmps[finish - 1],
inner, bytepos);
! emit_move_insn (dst, temp);
! done = true;
! finish--;
}
}
--- 1964,1975 ----
{
temp = simplify_gen_subreg (outer, tmps[finish - 1],
inner, bytepos);
! if (temp)
! {
! emit_move_insn (dst, temp);
! done = true;
! finish--;
! }
}
}
Roger
--