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/54938] sh libgcc_unpack_df.o fails to build: ../../../srcw/libgcc/fp-bit.h:221:19: internal compiler error: in emit_cmp_and_jump_insn_1, at optabs.c:4273


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

Oleg Endo <olegendo at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-10-16
                 CC|                            |eraman at google dot com
     Ever Confirmed|0                           |1

--- Comment #3 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-10-16 13:28:10 UTC ---
Thanks JÃrn.
The problem is not related to my changes in PR 51244.  It is caused by the
latest change to optabs.c:

2012-10-15   Easwaran Raman  <eraman@google.com>
    * optabs.c (emit_cmp_and_jump_insn_1): Add a new parameter to
    specificy the probability of taking the jump.
    (emit_cmp_and_jump_insns): Likewise.


In emit_cmp_and_jump_insn_1, the line

      gcc_assert (!find_reg_note (insn, REG_BR_PROB, 0));

blows up, because of config/sh/sh.c (expand_cbranchsi4):

  rtx jump = emit_jump_insn (branch_expander (operands[3]));
  if (probability >= 0)
    add_reg_note (jump, REG_BR_PROB, GEN_INT (probability));


The following seems to fix the problem

Index: gcc/optabs.c
===================================================================
--- gcc/optabs.c    (revision 192494)
+++ gcc/optabs.c    (working copy)
@@ -4270,8 +4270,8 @@
       && JUMP_P (insn)
       && any_condjump_p (insn))
     {
-      gcc_assert (!find_reg_note (insn, REG_BR_PROB, 0));
-      add_reg_note (insn, REG_BR_PROB, GEN_INT (prob));
+      if (!find_reg_note (insn, REG_BR_PROB, 0))
+        add_reg_note (insn, REG_BR_PROB, GEN_INT (prob));
     }
 }


Easwaran, could you please have a look at that?  Does the change above make
sense?


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