View | Details | Return to bug 53001 | Differences between
and this patch

Collapse All | Expand All

(-)gcc/c-family/c-cppbuiltin.c (-5 / +5 lines)
Lines 157-163 builtin_define_float_constants (const ch Link Here
157
	p log10 b			if b is a power of 10
157
	p log10 b			if b is a power of 10
158
	floor((p - 1) log10 b)		otherwise
158
	floor((p - 1) log10 b)		otherwise
159
  */
159
  */
160
  dig = (fmt->p - 1) * log10_b;
160
  dig = (int)((fmt->p - 1) * log10_b);
161
  sprintf (name, "__%s_DIG__", name_prefix);
161
  sprintf (name, "__%s_DIG__", name_prefix);
162
  builtin_define_with_int_value (name, dig);
162
  builtin_define_with_int_value (name, dig);
163
163
Lines 173-179 builtin_define_float_constants (const ch Link Here
173
173
174
     Recall that emin is negative, so the integer truncation calculates
174
     Recall that emin is negative, so the integer truncation calculates
175
     the ceiling, not the floor, in this case.  */
175
     the ceiling, not the floor, in this case.  */
176
  min_10_exp = (fmt->emin - 1) * log10_b;
176
  min_10_exp = (int)((fmt->emin - 1) * log10_b);
177
  sprintf (name, "__%s_MIN_10_EXP__", name_prefix);
177
  sprintf (name, "__%s_MIN_10_EXP__", name_prefix);
178
  sprintf (buf, "(%d)", min_10_exp);
178
  sprintf (buf, "(%d)", min_10_exp);
179
  builtin_define_with_value (name, buf, 0);
179
  builtin_define_with_value (name, buf, 0);
Lines 208-214 builtin_define_float_constants (const ch Link Here
208
     Hand-waving aside, crunching all of the sets of constants above by hand
208
     Hand-waving aside, crunching all of the sets of constants above by hand
209
     does not yield a case for which the first term is significant, which
209
     does not yield a case for which the first term is significant, which
210
     in the end is all that matters.  */
210
     in the end is all that matters.  */
211
  max_10_exp = fmt->emax * log10_b;
211
  max_10_exp = (int)(fmt->emax * log10_b);
212
  sprintf (name, "__%s_MAX_10_EXP__", name_prefix);
212
  sprintf (name, "__%s_MAX_10_EXP__", name_prefix);
213
  builtin_define_with_int_value (name, max_10_exp);
213
  builtin_define_with_int_value (name, max_10_exp);
214
214
Lines 224-237 builtin_define_float_constants (const ch Link Here
224
  {
224
  {
225
    double d_decimal_dig
225
    double d_decimal_dig
226
      = 1 + (fmt->p < ldfmt->p ? ldfmt->p : fmt->p) * log10_b;
226
      = 1 + (fmt->p < ldfmt->p ? ldfmt->p : fmt->p) * log10_b;
227
    decimal_dig = d_decimal_dig;
227
    decimal_dig = (int)d_decimal_dig;
228
    if (decimal_dig < d_decimal_dig)
228
    if (decimal_dig < d_decimal_dig)
229
      decimal_dig++;
229
      decimal_dig++;
230
  }
230
  }
231
  /* Similar, for this type rather than long double.  */
231
  /* Similar, for this type rather than long double.  */
232
  {
232
  {
233
    double type_d_decimal_dig = 1 + fmt->p * log10_b;
233
    double type_d_decimal_dig = 1 + fmt->p * log10_b;
234
    type_decimal_dig = type_d_decimal_dig;
234
    type_decimal_dig = (int)type_d_decimal_dig;
235
    if (type_decimal_dig < type_d_decimal_dig)
235
    if (type_decimal_dig < type_d_decimal_dig)
236
      type_decimal_dig++;
236
      type_decimal_dig++;
237
  }
237
  }
(-)gcc/mcf.c (-2 / +2 lines)
Lines 348-355 mcf_sqrt (double x) Link Here
348
348
349
  gcc_assert (x >= 0);
349
  gcc_assert (x >= 0);
350
350
351
  convertor.floatPart = x;
351
  convertor.floatPart = (float)x;
352
  convertor2.floatPart = x;
352
  convertor2.floatPart = (float)x;
353
  convertor.intPart = MAGIC_CONST1 + (convertor.intPart >> 1);
353
  convertor.intPart = MAGIC_CONST1 + (convertor.intPart >> 1);
354
  convertor2.intPart = MAGIC_CONST2 - (convertor2.intPart >> 1);
354
  convertor2.intPart = MAGIC_CONST2 - (convertor2.intPart >> 1);
355
355
(-)gcc/predict.c (-2 / +2 lines)
Lines 792-798 combine_predictions_for_insn (rtx insn, Link Here
792
	  /* If one probability is 0% and one 100%, avoid division by zero.  */
792
	  /* If one probability is 0% and one 100%, avoid division by zero.  */
793
	  combined_probability = REG_BR_PROB_BASE / 2;
793
	  combined_probability = REG_BR_PROB_BASE / 2;
794
	else
794
	else
795
	  combined_probability = (((double) combined_probability) * probability
795
	  combined_probability = (int)(((double) combined_probability) * probability
796
				  * REG_BR_PROB_BASE / d + 0.5);
796
				  * REG_BR_PROB_BASE / d + 0.5);
797
      }
797
      }
798
798
Lines 957-963 combine_predictions_for_bb (basic_block Link Here
957
	    /* If one probability is 0% and one 100%, avoid division by zero.  */
957
	    /* If one probability is 0% and one 100%, avoid division by zero.  */
958
	    combined_probability = REG_BR_PROB_BASE / 2;
958
	    combined_probability = REG_BR_PROB_BASE / 2;
959
	  else
959
	  else
960
	    combined_probability = (((double) combined_probability)
960
	    combined_probability = (int)(((double) combined_probability)
961
				    * probability
961
				    * probability
962
		    		    * REG_BR_PROB_BASE / d + 0.5);
962
		    		    * REG_BR_PROB_BASE / d + 0.5);
963
	}
963
	}
(-)gcc/real.c (-4 / +4 lines)
Lines 1550-1563 real_to_decimal_for_mode (char *str, con Link Here
1550
    }
1550
    }
1551
1551
1552
  /* Bound the number of digits printed by the size of the representation.  */
1552
  /* Bound the number of digits printed by the size of the representation.  */
1553
  max_digits = SIGNIFICAND_BITS * M_LOG10_2;
1553
  max_digits = (int)(SIGNIFICAND_BITS * M_LOG10_2);
1554
  if (digits == 0 || digits > max_digits)
1554
  if (digits == 0 || digits > max_digits)
1555
    digits = max_digits;
1555
    digits = max_digits;
1556
1556
1557
  /* Estimate the decimal exponent, and compute the length of the string it
1557
  /* Estimate the decimal exponent, and compute the length of the string it
1558
     will print as.  Be conservative and add one to account for possible
1558
     will print as.  Be conservative and add one to account for possible
1559
     overflow or rounding error.  */
1559
     overflow or rounding error.  */
1560
  dec_exp = REAL_EXP (&r) * M_LOG10_2;
1560
  dec_exp = (int)(REAL_EXP (&r) * M_LOG10_2);
1561
  for (max_digits = 1; dec_exp ; max_digits++)
1561
  for (max_digits = 1; dec_exp ; max_digits++)
1562
    dec_exp /= 10;
1562
    dec_exp /= 10;
1563
1563
Lines 2215-2221 decimal_integer_string (char *str, const Link Here
2215
  sign = r.sign;
2215
  sign = r.sign;
2216
  r.sign = 0;
2216
  r.sign = 0;
2217
2217
2218
  dec_exp = REAL_EXP (&r) * M_LOG10_2;
2218
  dec_exp = (int)(REAL_EXP (&r) * M_LOG10_2);
2219
  digits = dec_exp + 1;
2219
  digits = dec_exp + 1;
2220
  gcc_assert ((digits + 2) < (int)buf_size);
2220
  gcc_assert ((digits + 2) < (int)buf_size);
2221
2221
Lines 2818-2824 significand_size (enum machine_mode mode Link Here
2818
	 than the number of bits required to hold the largest coefficient
2818
	 than the number of bits required to hold the largest coefficient
2819
	 of this mode.  */
2819
	 of this mode.  */
2820
      double log2_10 = 3.3219281;
2820
      double log2_10 = 3.3219281;
2821
      return fmt->p * log2_10;
2821
      return (int)(fmt->p * log2_10);
2822
    }
2822
    }
2823
  return fmt->p;
2823
  return fmt->p;
2824
}
2824
}
(-)libcpp/symtab.c (-1 / +2 lines)
Lines 287-293 ht_dump_statistics (cpp_hash_table *tabl Link Here
287
		     : (x) / (1024*1024))))
287
		     : (x) / (1024*1024))))
288
#define LABEL(x) ((x) < 1024*10 ? ' ' : ((x) < 1024*1024*10 ? 'k' : 'M'))
288
#define LABEL(x) ((x) < 1024*10 ? ' ' : ((x) < 1024*1024*10 ? 'k' : 'M'))
289
289
290
  total_bytes = longest = sum_of_squares = nids = 0;
290
  total_bytes = longest = nids = 0;
291
  sum_of_squares = 0.0;
291
  p = table->entries;
292
  p = table->entries;
292
  limit = p + table->nslots;
293
  limit = p + table->nslots;
293
  do
294
  do

Return to bug 53001