+2008-03-25 Richard Guenther <rguenther@suse.de>
+
+ Backport from mainline:
+ 2008-02-12 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/35163
+ * fold-const.c (fold_widened_comparison): Use get_unwidened in
+ value-preserving mode. Disallow final truncation.
+
2008-03-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
Backport:
if (TYPE_PRECISION (TREE_TYPE (arg0)) <= TYPE_PRECISION (shorter_type))
return NULL_TREE;
- arg1_unw = get_unwidened (arg1, shorter_type);
+ arg1_unw = get_unwidened (arg1, NULL_TREE);
/* If possible, express the comparison in the shorter mode. */
if ((code == EQ_EXPR || code == NE_EXPR
|| TYPE_UNSIGNED (TREE_TYPE (arg0)) == TYPE_UNSIGNED (shorter_type))
&& (TREE_TYPE (arg1_unw) == shorter_type
+ || (TYPE_PRECISION (shorter_type)
+ >= TYPE_PRECISION (TREE_TYPE (arg1_unw)))
|| (TREE_CODE (arg1_unw) == INTEGER_CST
&& (TREE_CODE (shorter_type) == INTEGER_TYPE
|| TREE_CODE (shorter_type) == BOOLEAN_TYPE)
+2008-03-25 Richard Guenther <rguenther@suse.de>
+
+ Backport from mainline:
+ 2008-02-12 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/35163
+ * gcc.c-torture/execute/pr35163.c: New testcase.
+
2008-02-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
Backport: