This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/61572] [4.10 Regression] ICE: in assign_by_spills, at lra-assigns.c:1335
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 24 Jun 2014 08:12:44 +0000
- Subject: [Bug tree-optimization/61572] [4.10 Regression] ICE: in assign_by_spills, at lra-assigns.c:1335
- Auto-submitted: auto-generated
- References: <bug-61572-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61572
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Component|rtl-optimization |tree-optimization
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
That's because of
register __typeof__(0) c asm("rdx");
which AFAIK makes 'rdx' "fixed" in the whole function.
What changed recently is that we sunk the b = c; assignment right before
its use. Not doing that fixes the issue (but I wonder if the use of
that asm isn't undefined from the start).
Note that we still happily sink stores to hard registers (that probably
always reduces hardreg lifetime).
Index: tree-ssa-sink.c
===================================================================
--- tree-ssa-sink.c (revision 211928)
+++ tree-ssa-sink.c (working copy)
@@ -374,6 +374,12 @@ statement_sink_location (gimple stmt, ba
nearest to commondom. */
if (gimple_vuse (stmt))
{
+ /* Do not sink loads from hard registers. */
+ if (gimple_assign_single_p (stmt)
+ && TREE_CODE (gimple_assign_rhs1 (stmt)) == VAR_DECL
+ && DECL_HARD_REGISTER (gimple_assign_rhs1 (stmt)))
+ return false;
+
imm_use_iterator imm_iter;
use_operand_p use_p;
basic_block found = NULL;