PR c/22589
Backport from mainline:
2004-06-16 Alexandre Oliva <aoliva@redhat.com>
* tree.c (get_narrower): Don't narrow integral types into
non-integral types.
From-SVN: r102471
+2005-07-28 Richard Sandiford <richard@codesourcery.com>
+
+ PR c/22589
+ Backport from mainline:
+
+ 2004-06-16 Alexandre Oliva <aoliva@redhat.com>
+ * tree.c (get_narrower): Don't narrow integral types into
+ non-integral types.
+
2005-07-26 Bernardo Innocenti <bernie@develer.com>
Backport from mainline:
+2005-07-28 Richard Sandiford <richard@codesourcery.com>
+
+ PR c/22589
+ * gcc.c-torture/compile/pr22589.c: New test.
+
2005-07-25 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR c++/19208
int uns = 0;
int first = 1;
tree win = op;
+ bool integral_p = INTEGRAL_TYPE_P (TREE_TYPE (op));
while (TREE_CODE (op) == NOP_EXPR)
{
uns = TREE_UNSIGNED (TREE_TYPE (op));
first = 0;
op = TREE_OPERAND (op, 0);
+ /* Keep trying to narrow, but don't assign op to win if it
+ would turn an integral type into something else. */
+ if (INTEGRAL_TYPE_P (TREE_TYPE (op)) != integral_p)
+ continue;
}
win = op;