Commit f8f972fc by Richard Biener

re PR middle-end/49177 (FAIL: gcc.dg/vect/fast-math-ifcvt-1.c)

2011-05-27  Richard Guenther  <rguenther@suse.de>

	PR middle-end/49177
	* fold-const.c (fold_unary_loc): Fold (T)(A CMP B) to
	A CMP B ? (T) true : (T) false for non-integral types T again.

From-SVN: r174326
parent 51a9ed47
2011-05-27 Richard Guenther <rguenther@suse.de>
PR middle-end/49177
* fold-const.c (fold_unary_loc): Fold (T)(A CMP B) to
A CMP B ? (T) true : (T) false for non-integral types T again.
2011-05-27 Jan Hubicka <jh@suse.cz> 2011-05-27 Jan Hubicka <jh@suse.cz>
* lto-streamer-out.c (lto_string_index): break out from...; offset by 1 * lto-streamer-out.c (lto_string_index): break out from...; offset by 1
so 0 means NULL string. so 0 means NULL string.
(lto_output_string_with_length): ... here. (lto_output_string_with_length): ... here.
(lto_output_string, output_string_cst, output_identifier): Update handling (lto_output_string, output_string_cst, output_identifier): Update
of NULL strings. handling of NULL strings.
(lto_output_location_bitpack): New function. (lto_output_location_bitpack): New function.
(lto_output_location): Use it. (lto_output_location): Use it.
(lto_output_tree_ref): Use output_record_start. (lto_output_tree_ref): Use output_record_start.
(pack_ts_type_common_value_fields): Pack aliagn & alias set in var len values. (pack_ts_type_common_value_fields): Pack aliagn & alias set in var
* lto-streamer-in.c (string_for_index): Break out from ...; offset values by 1. len values.
* lto-streamer-in.c (string_for_index): Break out from ...; offset
values by 1.
(input_string_internal): ... here; (input_string_internal): ... here;
(input_string_cst, input_identifier, lto_input_string): Update handling of (input_string_cst, input_identifier, lto_input_string): Update handling
NULL strings. of NULL strings.
(lto_input_location_bitpack): New function (lto_input_location_bitpack): New function
(lto_input_location): Use it. (lto_input_location): Use it.
(unpack_ts_type_common_value_fields): Pack align & alias in var len values. (unpack_ts_type_common_value_fields): Pack align & alias in var len
values.
* lto-streamer.h (bp_pack_val_len_unsigned, bp_pack_val_len_int, * lto-streamer.h (bp_pack_val_len_unsigned, bp_pack_val_len_int,
bp_unpack_val_len_unsigned, bp_unpack_val_len_int): Declare. bp_unpack_val_len_unsigned, bp_unpack_val_len_int): Declare.
(bp_pack_value): Sanity check the value range. (bp_pack_value): Sanity check the value range.
......
...@@ -7657,11 +7657,19 @@ fold_unary_loc (location_t loc, enum tree_code code, tree type, tree op0) ...@@ -7657,11 +7657,19 @@ fold_unary_loc (location_t loc, enum tree_code code, tree type, tree op0)
if (TREE_TYPE (op0) == type) if (TREE_TYPE (op0) == type)
return op0; return op0;
/* If we have (type) (a CMP b) and type is an integral type, return if (COMPARISON_CLASS_P (op0))
new expression involving the new type. */ {
if (COMPARISON_CLASS_P (op0) && INTEGRAL_TYPE_P (type)) /* If we have (type) (a CMP b) and type is an integral type, return
return fold_build2_loc (loc, TREE_CODE (op0), type, TREE_OPERAND (op0, 0), new expression involving the new type. */
TREE_OPERAND (op0, 1)); if (INTEGRAL_TYPE_P (type))
return fold_build2_loc (loc, TREE_CODE (op0), type,
TREE_OPERAND (op0, 0),
TREE_OPERAND (op0, 1));
else
return fold_build3_loc (loc, COND_EXPR, type, op0,
fold_convert (type, boolean_true_node),
fold_convert (type, boolean_false_node));
}
/* Handle cases of two conversions in a row. */ /* Handle cases of two conversions in a row. */
if (CONVERT_EXPR_P (op0)) if (CONVERT_EXPR_P (op0))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment