]> gcc.gnu.org Git - gcc.git/commitdiff
*** empty log message ***
authorRichard Kenner <kenner@gcc.gnu.org>
Thu, 2 Apr 1992 11:03:52 +0000 (06:03 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Thu, 2 Apr 1992 11:03:52 +0000 (06:03 -0500)
From-SVN: r666

gcc/fold-const.c
gcc/genattrtab.c
gcc/optabs.c

index 3801fbf8db703227315b72125a6247f0d9bdab71..fab7300650f1cdd51366d61f81a1f75bb1bacebf 100644 (file)
@@ -3680,7 +3680,7 @@ fold (expr)
          /* If this is A != 0 ? A : 0, this is simply A.  For ==, it is
             always zero.  */
 
-         if (integer_zerop (arg2))
+         if (integer_zerop (TREE_OPERAND (arg0, 1)) && integer_zerop (arg2))
            {
              if (comp_code == NE_EXPR)
                return arg1;
index 469c31dd866ef4e11719614e9caf3751d9c9d4fc..a9524a185366509d54294e88ab4e1893eea4047f 100644 (file)
@@ -396,7 +396,7 @@ attr_rtx (va_alist)
     {
       rtx arg0 = va_arg (p, rtx);
 
-      hashcode = (code + RTL_HASH (arg0));
+      hashcode = ((int) code + RTL_HASH (arg0));
       for (h = attr_hash_table[hashcode % RTL_HASH_SIZE]; h; h = h->next)
        if (h->hashcode == hashcode
            && GET_CODE (h->u.rtl) == code
@@ -416,7 +416,7 @@ attr_rtx (va_alist)
       rtx arg0 = va_arg (p, rtx);
       rtx arg1 = va_arg (p, rtx);
 
-      hashcode = (code + RTL_HASH (arg0) + RTL_HASH (arg1));
+      hashcode = ((int) code + RTL_HASH (arg0) + RTL_HASH (arg1));
       for (h = attr_hash_table[hashcode % RTL_HASH_SIZE]; h; h = h->next)
        if (h->hashcode == hashcode
            && GET_CODE (h->u.rtl) == code
@@ -436,7 +436,7 @@ attr_rtx (va_alist)
     {
       char * arg0 = va_arg (p, char *);
 
-      hashcode = (code + RTL_HASH (arg0));
+      hashcode = ((int) code + RTL_HASH (arg0));
       for (h = attr_hash_table[hashcode % RTL_HASH_SIZE]; h; h = h->next)
        if (h->hashcode == hashcode
            && GET_CODE (h->u.rtl) == code
@@ -456,7 +456,7 @@ attr_rtx (va_alist)
       char * arg0 = va_arg (p, char *);
       char * arg1 = va_arg (p, char *);
 
-      hashcode = (code + RTL_HASH (arg0) + RTL_HASH (arg1));
+      hashcode = ((int) code + RTL_HASH (arg0) + RTL_HASH (arg1));
       for (h = attr_hash_table[hashcode % RTL_HASH_SIZE]; h; h = h->next)
        if (h->hashcode == hashcode
            && GET_CODE (h->u.rtl) == code
index b1578531a5043dfd0e36a1b59ca261b7052877da..c345fc9d294fd8b2d9ae6033e17b39a37f4ffdd8 100644 (file)
@@ -1315,6 +1315,16 @@ emit_no_conflict_block (insns, target, op0, op1, equiv)
    an insn to move RESULT to TARGET.  This last insn will have a REQ_EQUAL
    note with an operand of EQUIV.
 
+   Moving assignments to pseudos outside of the block is done to improve
+   the generated code, but is not required to generate correct code,
+   hence being unable to move an assignment is not grounds for not making
+   a libcall block.  There are two reasons why it is safe to leave these
+   insns inside the block: First, we know that these pseudos cannot be
+   used in generated RTL outside the block since they are created for
+   temporary purposes within the block.  Second, CSE will not record the
+   values of anything set inside a libcall block, so we know they must
+   be dead at the end of the block.
+
    Except for the first group of insns (the ones setting pseudos), the
    block is delimited by REG_RETVAL and REG_LIBCALL notes.  */
 
@@ -1328,7 +1338,9 @@ emit_libcall_block (insns, target, result, equiv)
   rtx prev, next, first, last, insn;
 
   /* First emit all insns that set pseudos.  Remove them from the list as
-     we go.  */
+     we go.  Avoid insns that set pseudo which were referenced in previous
+     insns.  These can be generated by move_by_pieces, for example,
+     to update an address.  */
 
   for (insn = insns; insn; insn = next)
     {
@@ -1337,7 +1349,9 @@ emit_libcall_block (insns, target, result, equiv)
       next = NEXT_INSN (insn);
 
       if (set != 0 && GET_CODE (SET_DEST (set)) == REG
-         && REGNO (SET_DEST (set)) >= FIRST_PSEUDO_REGISTER)
+         && REGNO (SET_DEST (set)) >= FIRST_PSEUDO_REGISTER
+         && ! reg_mentioned_p (SET_DEST (set), PATTERN (insns))
+         && ! reg_used_between_p (SET_DEST (set), insns, insn))
        {
          if (PREV_INSN (insn))
            NEXT_INSN (PREV_INSN (insn)) = next;
This page took 0.076553 seconds and 5 git commands to generate.