[gcc/devel/ranger] Emit "#" instead of calling gcc_unreachable for invalid insns.

Aldy Hernandez aldyh@gcc.gnu.org
Wed Jun 17 18:39:56 GMT 2020


https://gcc.gnu.org/g:ad84548336ad9a08b451ddd7ea64f07aee0576a6

commit ad84548336ad9a08b451ddd7ea64f07aee0576a6
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Thu Feb 6 17:34:21 2020 +0100

    Emit "#" instead of calling gcc_unreachable for invalid insns.
    
    Implement standard approach by emitting "#" for insns that have to be split.
    
            * config/i386/i386.md (*pushtf): Emit "#" instead of
            calling gcc_unreachable in insn output.
            (*pushxf): Ditto.
            (*pushdf): Ditto.
            (*pushsf_rex64): Ditto for alternatives other than 1.
            (*pushsf): Ditto for alternatives other than 1.

Diff:
---
 gcc/ChangeLog           |  9 +++++++++
 gcc/config/i386/i386.md | 12 +++++++-----
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bc9c3720488..c842c4fc02f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2020-02-06  Uroš Bizjak  <ubizjak@gmail.com>
+
+	* config/i386/i386.md (*pushtf): Emit "#" instead of
+	calling gcc_unreachable in insn output.
+	(*pushxf): Ditto.
+	(*pushdf): Ditto.
+	(*pushsf_rex64): Ditto for alternatives other than 1.
+	(*pushsf): Ditto for alternatives other than 1.
+
 2020-02-06  Martin Liska  <mliska@suse.cz>
 
 	PR gcov-profile/91971
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 496a8666643..34649c010b8 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -3032,7 +3032,7 @@
   "TARGET_64BIT || TARGET_SSE"
 {
   /* This insn should be already split before reg-stack.  */
-  gcc_unreachable ();
+  return ("#");
 }
   [(set_attr "isa" "*,x64")
    (set_attr "type" "multi")
@@ -3087,7 +3087,7 @@
   ""
 {
   /* This insn should be already split before reg-stack.  */
-  gcc_unreachable ();
+  return ("#");
 }
   [(set_attr "isa" "*,*,*,nox64,x64")
    (set_attr "type" "multi")
@@ -3123,7 +3123,7 @@
   ""
 {
   /* This insn should be already split before reg-stack.  */
-  gcc_unreachable ();
+  return ("#");
 }
   [(set_attr "isa" "*,nox64,nox64,nox64,x64,sse2")
    (set_attr "type" "multi")
@@ -3156,7 +3156,8 @@
   "TARGET_64BIT"
 {
   /* Anything else should be already split before reg-stack.  */
-  gcc_assert (which_alternative == 1);
+  if (which_alternative != 1)
+    return ("#");
   return "push{q}\t%q1";
 }
   [(set_attr "type" "multi,push,multi")
@@ -3169,7 +3170,8 @@
   "!TARGET_64BIT"
 {
   /* Anything else should be already split before reg-stack.  */
-  gcc_assert (which_alternative == 1);
+  if (which_alternative != 1)
+    return ("#");
   return "push{l}\t%1";
 }
   [(set_attr "type" "multi,push,multi")


More information about the Gcc-cvs mailing list