When the optab causes the actual mode to be wider we have to re-check
whether we still fulfill the gimple constraints we verify.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.

Richard.

2012-03-07  Richard Guenther  <rguent...@suse.de>

        * tree-ssa-math-opts.c (convert_mult_to_widen): Check actual
        precision against gimple constraints.

Index: gcc/tree-ssa-math-opts.c
===================================================================
*** gcc/tree-ssa-math-opts.c    (revision 185025)
--- gcc/tree-ssa-math-opts.c    (working copy)
*************** convert_mult_to_widen (gimple stmt, gimp
*** 2158,2163 ****
--- 2158,2165 ----
    /* Ensure that the inputs to the handler are in the correct precison
       for the opcode.  This will be the full mode size.  */
    actual_precision = GET_MODE_PRECISION (actual_mode);
+   if (2 * actual_precision > TYPE_PRECISION (type))
+     return false;
    if (actual_precision != TYPE_PRECISION (type1)
        || from_unsigned1 != TYPE_UNSIGNED (type1))
      {

Reply via email to