This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
xstormy16 patch to fix folding of switch statements
- From: Geoffrey Keating <geoffk at cygnus dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 25 Jan 2002 10:18:32 -0800
- Subject: xstormy16 patch to fix folding of switch statements
I forgot to commit this patch earlier. The previous version would be
folded incorrectly when its operand is a constant; this one is better
(although not strictly correct).
--
Geoff Keating <geoffk@redhat.com>
===File ~/patches/gcc-stormy-tablejumpmem.patch=============
2001-11-20 Geoffrey Keating <geoffk@redhat.com>
* config/stormy16/stormy16.md (tablejump_pcrel): Use a MEM
to help folding.
Index: config/stormy16/stormy16.md
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/config/stormy16/stormy16.md,v
retrieving revision 1.12
diff -p -u -p -r1.12 stormy16.md
--- stormy16.md 2001/11/09 09:14:39 1.12
+++ stormy16.md 2001/11/20 18:25:49
@@ -904,7 +904,8 @@
}")
(define_insn "tablejump_pcrel"
- [(set (pc) (plus:HI (pc) (match_operand:HI 0 "register_operand" "r")))
+ [(set (pc) (mem:HI (plus:HI (pc)
+ (match_operand:HI 0 "register_operand" "r"))))
(use (label_ref:SI (match_operand 1 "" "")))]
""
"br %0"
============================================================