re PR target/33135 ([SH] -ffinite-math-only should not be on by default)
authorOleg Endo <olegendo@gcc.gnu.org>
Thu, 4 Oct 2012 18:32:20 +0000 (18:32 +0000)
committerOleg Endo <olegendo@gcc.gnu.org>
Thu, 4 Oct 2012 18:32:20 +0000 (18:32 +0000)
PR target/33135
* config/sh/t-sh (HOST_LIBGCC2_CFLAGS): Delete.
* config/sh/t-netbsd (HOST_LIBGCC2_CFLAGS): Delete.
* config/sh/t-linux (HOST_LIBGCC2_CFLAGS): Remove mieee option.

From-SVN: r192097

gcc/config/sh/sh.md
gcc/testsuite/gcc.target/sh/pr52933-1.c
libgcc/ChangeLog
libgcc/config/sh/t-linux
libgcc/config/sh/t-netbsd
libgcc/config/sh/t-sh

index 7a1c4d33a58017365cad9f7530ba60bde38a74b4..6a619845897e805024b3ffe20ac7bfd4d59f4b62 100644 (file)
 
 (define_insn_and_split "*cmp_div0s_1"
   [(set (match_operand:SI 0 "arith_reg_dest" "")
-       (ge:SI (xor:SI (match_operand:SI 1 "arith_reg_operand" "")
-                      (match_operand:SI 2 "arith_reg_operand" ""))
-              (const_int 0)))
+;;     (ge:SI (xor:SI (match_operand:SI 1 "arith_reg_operand" "")
+;;                    (match_operand:SI 2 "arith_reg_operand" ""))
+;;            (const_int 0)))
+       (xor:SI (lshiftrt:SI (match_operand:SI 1 "arith_reg_operand")
+                            (const_int 31))
+               (ge:SI (match_operand:SI 2 "arith_reg_operand")
+                      (const_int 0))))
    (clobber (reg:SI T_REG))]
   "TARGET_SH1"
   "#"
 
 (define_insn_and_split "*cmp_div0s_1"
   [(set (reg:SI T_REG)
-       (ge:SI (xor:SI (match_operand:SI 0 "arith_reg_operand" "")
-                      (match_operand:SI 1 "arith_reg_operand" ""))
-              (const_int 0)))]
+;;     (ge:SI (xor:SI (match_operand:SI 0 "arith_reg_operand" "")
+;;                    (match_operand:SI 1 "arith_reg_operand" ""))
+;;            (const_int 0)))]
+       (eq:SI (lshiftrt:SI (match_operand:SI 0 "arith_reg_operand")
+                           (const_int 31))
+              (ge:SI (match_operand:SI 1 "arith_reg_operand")
+                     (const_int 0))))]
   "TARGET_SH1"
   "#"
   "&& can_create_pseudo_p ()"
 
 (define_insn_and_split "*cbranch_div0s"
   [(set (pc)
-       (if_then_else (ge (xor:SI (match_operand:SI 0 "arith_reg_operand" "")
-                                 (match_operand:SI 1 "arith_reg_operand" ""))
-                         (const_int 0))
+;;     (if_then_else (ge (xor:SI (match_operand:SI 0 "arith_reg_operand" "")
+;;                               (match_operand:SI 1 "arith_reg_operand" ""))
+;;                       (const_int 0))
+       (if_then_else (eq (lshiftrt:SI (match_operand:SI 0 "arith_reg_operand")
+                                      (const_int 31))
+                         (ge:SI (match_operand:SI 1 "arith_reg_operand")
+                                (const_int 0)))
                      (label_ref (match_operand 2))
                      (pc)))
    (clobber (reg:SI T_REG))]
@@ -10669,6 +10681,19 @@ label:
    DONE;
 })
 
+;; The *cstoresi pattern is for combine, so that it can apply some
+;; comparison canonicalization if it hasn't been done before.
+(define_insn_and_split "*cstoresi"
+  [(set (match_operand:SI 0 "arith_reg_dest")
+       (ge:SI (match_operand:SI 1 "arith_reg_operand")
+              (const_int 0)))
+   (clobber (reg:SI T_REG))]
+  "TARGET_SH1"
+  "#"
+  "&& 1"
+  [(set (reg:SI T_REG) (ge:SI (match_dup 1) (const_int 0)))
+   (set (match_dup 0) (reg:SI T_REG))])
+
 (define_expand "cstoredi4"
   [(set (match_operand:SI 0 "register_operand" "=r")
        (match_operator:SI 1 "comparison_operator"
index 037f916f34f776d35ff1748cc47430ddf4244282..4f2dc9821afe1d3d11dc044cbd8bf7ae0152810f 100644 (file)
@@ -8,7 +8,7 @@
 /* { dg-final { scan-assembler-times "div0s" 25 } } */
 /* { dg-final { scan-assembler-not "tst" } } */
 
-typedef unsigned char bool;
+// typedef unsigned char bool;
 
 int other_func_a (int, int);
 int other_func_b (int, int);
index 683d2d113aacb824650a5d0ca85727eb063f1cb2..693f395b6da134a49168f9dab9242f960129aadb 100644 (file)
@@ -1,3 +1,10 @@
+2012-10-04  Oleg Endo  <olegendo@gcc.gnu.org>
+
+       PR target/33135
+       * config/sh/t-sh (HOST_LIBGCC2_CFLAGS): Delete.
+       * config/sh/t-netbsd (HOST_LIBGCC2_CFLAGS): Delete.
+       * config/sh/t-linux (HOST_LIBGCC2_CFLAGS): Remove mieee option.
+
 2012-10-03  Oleg Endo  <olegendo@gcc.gnu.org>
 
        PR target/50457
index 60dee8de11ac2b76181e147db9b425624a572bd4..d316db937081b8d2e19fc246fbae3a0e4b2e0461 100644 (file)
@@ -2,7 +2,7 @@ LIB1ASMFUNCS_CACHE = _ic_invalidate _ic_invalidate_array
 
 LIB2ADD = $(srcdir)/config/sh/linux-atomic.c
 
-HOST_LIBGCC2_CFLAGS += -mieee -DNO_FPSCR_VALUES
+HOST_LIBGCC2_CFLAGS += -DNO_FPSCR_VALUES
 
 # Silence atomic built-in related warnings in linux-atomic.c.
 # Unfortunately the conflicting types warning can't be disabled selectively.
index 3c5739e2ffc108dc4456848b3ad18fa7c6daae99..93fe287e5c869bb09d2d2a434787b0bdc0fecf2c 100644 (file)
@@ -1,3 +1,2 @@
 LIB1ASMFUNCS_CACHE = _ic_invalidate
 
-HOST_LIBGCC2_CFLAGS += -mieee
index efbaff8479ea62b89598fc62afb772135917bee8..61cfe79a6f824ccd81ff6cea227a958bf0d96f51 100644 (file)
@@ -59,5 +59,3 @@ div_table-4-300.o: $(srcdir)/config/sh/lib1funcs-4-300.S
 libgcc-4-300.a: div_table-4-300.o
        $(AR_CREATE_FOR_TARGET) $@ div_table-4-300.o
 
-HOST_LIBGCC2_CFLAGS += -mieee
-