X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fconvert.c;h=b97d08fa4f7a544838c9571cbac8852dab174a25;hb=0f92db9e6158b1d5fd2576f269f51b57339c35c6;hp=6eea7d684c60c1374c8c0395ddd075e665f296a8;hpb=8a95ab857c0aa88461aa4f10944825c98f32d0df;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/convert.c b/gcc/convert.c index 6eea7d684c6..b97d08fa4f7 100644 --- a/gcc/convert.c +++ b/gcc/convert.c @@ -310,13 +310,13 @@ convert_to_integer (type, expr) { /* Don't do unsigned arithmetic where signed was wanted, or vice versa. - Exception: if either of the original operands were + Exception: if both of the original operands were unsigned then can safely do the work as unsigned. And we may need to do it as unsigned if we truncate to the original size. */ typex = ((TREE_UNSIGNED (TREE_TYPE (expr)) - || TREE_UNSIGNED (TREE_TYPE (arg0)) - || TREE_UNSIGNED (TREE_TYPE (arg1))) + || (TREE_UNSIGNED (TREE_TYPE (arg0)) + && TREE_UNSIGNED (TREE_TYPE (arg1)))) ? unsigned_type (typex) : signed_type (typex)); return convert (type, fold (build (ex_form, typex, @@ -460,8 +460,6 @@ tree convert_to_vector (type, expr) tree type, expr; { - tree subtype = TREE_TYPE (type); - switch (TREE_CODE (TREE_TYPE (expr))) { case INTEGER_TYPE: