------- Comment #1 from kkojima at gcc dot gnu dot org  2007-04-20 00:05 -------
I've confirmed that the testcase doesn't fail with 3.4 compiler
and fails with 4.0, 4.1 and 4.2.  Although it doesn't fail with
the current trunk compiler, it might be simply latent.  The segfault
occurs in insn_current_length when evaluating GET_CODE for a null
rtx.  Now I'm testing the patch below.

--- ORIG/trunk/gcc/config/sh/sh.md      2007-03-29 08:44:33.000000000 +0900
+++ LOCAL/trunk/gcc/config/sh/sh.md     2007-04-19 11:02:06.000000000 +0900
@@ -420,10 +420,12 @@
         (eq_attr "type" "jump")
         (cond [(eq_attr "med_branch_p" "yes")
                (const_int 2)
-               (and (eq (symbol_ref "GET_CODE (prev_nonnote_insn (insn))")
-                         (symbol_ref "INSN"))
-                     (eq (symbol_ref "INSN_CODE (prev_nonnote_insn (insn))")
-                         (symbol_ref "code_for_indirect_jump_scratch")))
+               (and (ne (symbol_ref "prev_nonnote_insn (insn)")
+                        (const_int 0))
+                    (and (eq (symbol_ref "GET_CODE (prev_nonnote_insn
(insn))")
+                             (symbol_ref "INSN"))
+                         (eq (symbol_ref "INSN_CODE (prev_nonnote_insn
(insn))")
+                             (symbol_ref "code_for_indirect_jump_scratch"))))
                 (cond [(eq_attr "braf_branch_p" "yes")
                        (const_int 6)
                        (eq (symbol_ref "flag_pic") (const_int 0))


-- 

kkojima at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kkojima at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
      Known to fail|                            |4.0.4 4.1.2 4.2.0
      Known to work|                            |3.4.6
   Last reconfirmed|0000-00-00 00:00:00         |2007-04-20 00:05:05
               date|                            |
            Summary|internal compiler error:    |[4.1/4.2 Regression] ICE
                   |Segmentation fault          |with -O -fomit-frame-pointer
                   |                            |on SH


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31480

Reply via email to