integrate.c (copy_insn_list): handle NOTE_INSN_DELETED_LABEL, as if it were CODE_LABEL.
authorJan Hubicka <jh@suse.cz>
Fri, 20 Jul 2001 11:30:13 +0000 (13:30 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Fri, 20 Jul 2001 11:30:13 +0000 (11:30 +0000)
* integrate.c (copy_insn_list): handle
NOTE_INSN_DELETED_LABEL, as if it were CODE_LABEL.
(copy_rtx_and_substitute): Likewise; behave to NOTE_INSN_DELETED_LABEL
identically as to CODE_LABEL.

* fold-const (fold): Convert A/B/C to A/(B*C) and
A/(B/C) to (A/B)*C

* except.c (connect_post_landing_pads): Delete the RESX insns.

From-SVN: r44193

gcc/ChangeLog
gcc/except.c
gcc/fold-const.c
gcc/integrate.c

index 51df8fed28a7cd9499ba672636c29189928a0f73..69fd6836c75ba70eb68214d6544b66928e8b393e 100644 (file)
@@ -1,3 +1,15 @@
+Fri Jul 20 13:24:16 CEST 2001  Jan Hubicka  <jh@suse.cz>
+
+       * integrate.c (copy_insn_list): handle
+       NOTE_INSN_DELETED_LABEL, as if it were CODE_LABEL.
+       (copy_rtx_and_substitute): Likewise; behave to NOTE_INSN_DELETED_LABEL
+       identically as to CODE_LABEL.
+
+       * fold-const (fold): Convert A/B/C to A/(B*C) and
+       A/(B/C) to (A/B)*C
+
+       * except.c (connect_post_landing_pads): Delete the RESX insns.
+
 2001-07-20  Aldy Hernandez  <aldyh@redhat.com>
 
         * config/mips/mips.h (ISA_HAS_NMADD_NMSUB): New macro.
index da50101264877560297f06b5e5cfcb5802fd8c7e..01e83f0c4693fb5b7c4158d3579a096d7ec9fe04 100644 (file)
@@ -1846,8 +1846,7 @@ connect_post_landing_pads ()
       seq = get_insns ();
       end_sequence ();
       emit_insns_before (seq, region->resume);
-
-      /* Leave the RESX to be deleted by flow.  */
+      flow_delete_insn (region->resume);
     }
 }
 
index ce96f1138607644f62bbadcee5c0476d6af78596..55480d269f4891c54f56b90b0e7fcff54c6c0938 100644 (file)
@@ -5866,6 +5866,23 @@ fold (expr)
                }
            }
        }
+      /* Convert A/B/C to A/(B*C).  */
+      if (flag_unsafe_math_optimizations
+         && TREE_CODE (arg0) == RDIV_EXPR)
+       {
+         return fold (build (RDIV_EXPR, type, TREE_OPERAND (arg0, 0),
+                             build (MULT_EXPR, type, TREE_OPERAND (arg0, 1),
+                                    arg1)));
+       }
+      /* Convert A/(B/C) to (A/B)*C.  */
+      if (flag_unsafe_math_optimizations
+         && TREE_CODE (arg1) == RDIV_EXPR)
+       {
+         return fold (build (MULT_EXPR, type,
+                             build (RDIV_EXPR, type, arg0,
+                                    TREE_OPERAND (arg1, 0)),
+                             TREE_OPERAND (arg1, 1)));
+       }
       goto binary;
 
     case TRUNC_DIV_EXPR:
index cfab58a6f6e40191dcebbfb0e2cbf4d9b03c141a..83d3819b832dab3752bd8f5421efcf4ff91afa42 100644 (file)
@@ -1555,6 +1555,14 @@ copy_insn_list (insns, map, static_chain_value)
          break;
 
        case NOTE:
+         if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL)
+           {
+             copy = emit_label (get_label_from_map (map,
+                                                   CODE_LABEL_NUMBER (insn)));
+             map->const_age++;
+             break;
+           }
+
          /* NOTE_INSN_FUNCTION_END and NOTE_INSN_FUNCTION_BEG are
             discarded because it is important to have only one of
             each in the current function.
@@ -1992,18 +2000,18 @@ copy_rtx_and_substitute (orig, map, for_lhs)
        copy = SUBREG_REG (copy);
       return gen_rtx_fmt_e (code, VOIDmode, copy);
 
+    /* We need to handle "deleted" labels that appear in the DECL_RTL
+       of a LABEL_DECL.  */
+    case NOTE:
+      if (NOTE_LINE_NUMBER (orig) != NOTE_INSN_DELETED_LABEL)
+       break;
+
+      /* ... FALLTHRU ... */
     case CODE_LABEL:
       LABEL_PRESERVE_P (get_label_from_map (map, CODE_LABEL_NUMBER (orig)))
        = LABEL_PRESERVE_P (orig);
       return get_label_from_map (map, CODE_LABEL_NUMBER (orig));
 
-    /* We need to handle "deleted" labels that appear in the DECL_RTL
-       of a LABEL_DECL.  */
-    case NOTE:
-      if (NOTE_LINE_NUMBER (orig) == NOTE_INSN_DELETED_LABEL)
-       return map->insn_map[INSN_UID (orig)];
-      break;
-
     case LABEL_REF:
       copy
        = gen_rtx_LABEL_REF