re PR rtl-optimization/1823 (-ftrapv aborts with pointer difference due to division...
authorRoger Sayle <roger@eyesopen.com>
Fri, 5 Sep 2003 18:28:48 +0000 (18:28 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Fri, 5 Sep 2003 18:28:48 +0000 (18:28 +0000)
PR optimization/1823
* expmed.c (expand_divmod <EXACT_DIV_EXPR>): Use an unsigned
multiplication to implement division by constant integer.

Co-Authored-By: Richard Henderson <rth@redhat.com>
From-SVN: r71116

gcc/ChangeLog
gcc/expmed.c

index fe1f21b424bd1e69f1555796eb055b6a9a9e76e0..c0b2e2bdfd9269c9ed96902699337172288ea873 100644 (file)
@@ -1,3 +1,10 @@
+2003-09-05  Roger Sayle  <roger@eyesopen.com>
+           Richard Henderson  <rth@redhat.com>
+
+       PR optimization/1823
+       * expmed.c (expand_divmod <EXACT_DIV_EXPR>): Use an unsigned
+       multiplication to implement division by constant integer.
+
 Fri Sep  5 07:35:16 CEST 2003  Jan Hubicka  <jh@suse.cz>
 
        * opts.c (decode_options): Enable unit-at-a-time at -O2.
index 8ccd23804f66813821160b38884aab4c163f42a2..c59f8651b7bfcfa371ab7f4358fb0f8bdb031698 100644 (file)
@@ -3824,7 +3824,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
                               build_int_2 (pre_shift, 0), NULL_RTX, unsignedp);
            quotient = expand_mult (compute_mode, t1,
                                    gen_int_mode (ml, compute_mode),
-                                   NULL_RTX, 0);
+                                   NULL_RTX, 1);
 
            insn = get_last_insn ();
            set_unique_reg_note (insn,