This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/80492] [5/6/7 Regression] Wrong code when unrolling a loop with inline asm and local regs
- 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, 25 Apr 2017 08:10:54 +0000
- Subject: [Bug tree-optimization/80492] [5/6/7 Regression] Wrong code when unrolling a loop with inline asm and local regs
- Auto-submitted: auto-generated
- References: <bug-80492-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80492
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
I can fix it with
Index: gcc/tree-ssa-pre.c
===================================================================
--- gcc/tree-ssa-pre.c (revision 247095)
+++ gcc/tree-ssa-pre.c (working copy)
@@ -4495,6 +4519,8 @@ eliminate_dom_walker::before_dom_childre
if (gimple_assign_single_p (stmt)
&& !gimple_has_volatile_ops (stmt)
&& !is_gimple_reg (gimple_assign_lhs (stmt))
+ && !(TREE_CODE (gimple_assign_lhs (stmt)) == VAR_DECL
+ && DECL_HARD_REGISTER (gimple_assign_lhs (stmt)))
&& (TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME
|| is_gimple_min_invariant (gimple_assign_rhs1 (stmt))))
{
CSE is similarly guarded.
But I really wonder if it is ok to omit constraints from the asm marking
the register variable as changed.
This basically means we treat register vars as volatile (but we do not
mark them so in the IL!) with all optimization consequences this has.
Anyway. Testing the above.