This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/64061] [5 Regression] ICE: in gen_rtx_SUBREG, at emit-rtl.c:894 with -O2 -g -fno-dce -fno-tree-dce


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64061

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot gnu.org

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I have a fix:
>From 54e1b1c2f4ce5bc6a924dbf30adbd8f03d4bdfe8 Mon Sep 17 00:00:00 2001
From: Andrew Pinski <apinski@cavium.com>
Date: Sat, 22 Nov 2014 09:39:48 -0800
Subject: [PATCH] 2014-11-22  Andrew Pinski  <apinski@cavium.com>

        Bug #13244
        * lra.c (lra_substitute_pseudo): Use gen_lowpart_if_possible
        instead of gen_rtx_SUBREG/gen_lowpart_SUBREG.
---
 gcc/ChangeLog.CAVIUM |    6 ++++++
 gcc/lra.c            |    8 +-------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/gcc/ChangeLog.CAVIUM b/gcc/ChangeLog.CAVIUM
index b7a633d..eb883cf 100644
--- a/gcc/ChangeLog.CAVIUM
+++ b/gcc/ChangeLog.CAVIUM
@@ -1,3 +1,9 @@
+2014-11-22  Andrew Pinski  <apinski@cavium.com>
+
+    Bug #13244
+    * lra.c (lra_substitute_pseudo): Use gen_lowpart_if_possible
+    instead of gen_rtx_SUBREG/gen_lowpart_SUBREG.
+
 2014-11-17  Andrew Pinski  <apinski@cavium.com>

     PR ipa/63981
diff --git a/gcc/lra.c b/gcc/lra.c
index ec122c7..3e07339 100644
--- a/gcc/lra.c
+++ b/gcc/lra.c
@@ -1807,13 +1807,7 @@ lra_substitute_pseudo (rtx *loc, int old_regno, rtx
new_reg)
       machine_mode inner_mode = GET_MODE (new_reg);

       if (mode != inner_mode)
-    {
-      if (GET_MODE_SIZE (mode) >= GET_MODE_SIZE (inner_mode)
-          || ! SCALAR_INT_MODE_P (inner_mode))
-        new_reg = gen_rtx_SUBREG (mode, new_reg, 0);
-      else
-        new_reg = gen_lowpart_SUBREG (mode, new_reg);
-    }
+    new_reg = gen_lowpart_if_possible (mode, new_reg);
       *loc = new_reg;
       return true;
     }
-- 
1.7.4.1

This shows up also on aarch64-linux-gnu and mips64-linux-gnu building libgo's
math.go


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]