This is the mail archive of the 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]

jump.c patch

I was running a recent version of the compiler to which I had
added some basic runtime checking of rtl expression types in the
rtl access macros.  It fairly quickly threw up a problem where it
was trying to apply INTVAL to something that was not a CONST_INT
within jump.c.  The following patch contains two additions to
prevent this happening; the second addition solved my problem,
while the first is a similar addition for an analagous situation
that may occur a couple of lines earlier in the code.


Sat Jul  4 22:10:46 BST 1998	Alasdair Baird	<>

    jump.c (jump_optimize) Check for CONST_INT before using INTVAL.

*** jump.c.orig Sat Jul  4 21:09:29 1998
--- jump.c      Sat Jul  4 21:09:40 1998
*************** jump_optimize (f, cross_jump, noop_moves
*** 1299,1309 ****
--- 1299,1311 ----
                         /* Check that the mask is a power of two,
                            so that it can probably be generated
                            with a shift.  */
+                           && GET_CODE (temp3) == CONST_INT
                            && exact_log2 (INTVAL (temp3)) >= 0))
                       && (reversep = 0, temp2 == const0_rtx))
                      || ((BRANCH_COST >= 2
                           || STORE_FLAG_VALUE == -1
                           || (STORE_FLAG_VALUE == 1
+                              && GET_CODE (temp2) == CONST_INT
                               && exact_log2 (INTVAL (temp2)) >= 0))
                          && temp3 == const0_rtx
                          && (reversep = can_reverse_comparison_p (temp4, insn)))

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