From: Richard Sandiford Date: Sat, 10 Jan 2004 12:02:34 +0000 (+0000) Subject: tree.c (get_unwidened): Reorder conditions so that the null pointer check is done... X-Git-Tag: releases/gcc-3.4.0~1140 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bb3f5384ba1d5426d1aabe684fe6688c37f50661;p=thirdparty%2Fgcc.git tree.c (get_unwidened): Reorder conditions so that the null pointer check is done first. * tree.c (get_unwidened): Reorder conditions so that the null pointer check is done first. From-SVN: r75639 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a47563353576..13ee5f6b0702 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-01-10 Richard Sandiford + + * tree.c (get_unwidened): Reorder conditions so that the null pointer + check is done first. + 2004-01-09 Eric Christopher * toplev.c (rest_of_handle_cfg): Add reg_scan pass diff --git a/gcc/tree.c b/gcc/tree.c index b252a67c354c..8fffffdca6d3 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -4123,10 +4123,10 @@ get_unwidened (tree op, tree for_type) The resulting extension to its nominal type (a fullword type) must fit the same conditions as for other extensions. */ - if (INT_CST_LT_UNSIGNED (TYPE_SIZE (type), TYPE_SIZE (TREE_TYPE (op))) + if (type != 0 + && INT_CST_LT_UNSIGNED (TYPE_SIZE (type), TYPE_SIZE (TREE_TYPE (op))) && (for_type || ! DECL_BIT_FIELD (TREE_OPERAND (op, 1))) - && (! uns || final_prec <= innerprec || unsignedp) - && type != 0) + && (! uns || final_prec <= innerprec || unsignedp)) { win = build (COMPONENT_REF, type, TREE_OPERAND (op, 0), TREE_OPERAND (op, 1));