Commit 03a569a3 by Kazu Hirata Committed by Kazu Hirata

re PR middle-end/26632 (spurious warning: value computed is not used)

gcc/
	PR middle-end/26632
	* convert.c (convert_to_integer): Set TREE_NO_WARNING to 1 on
	an implicit conversion.

gcc/testsuite/
	PR middle-end/26632
	* gcc.dg/pr26632.c: New.

From-SVN: r116510
parent 1aeceea4
2006-08-28 Kazu Hirata <kazu@codesourcery.com>
PR middle-end/26632
* convert.c (convert_to_integer): Set TREE_NO_WARNING to 1 on
an implicit conversion.
2006-08-28 Prafulla Thakare <prafullat@kpitcummins.com> 2006-08-28 Prafulla Thakare <prafullat@kpitcummins.com>
* config/h8300/h8300.c (TARGET_DEFAULT_TARGET_FLAGS): New. * config/h8300/h8300.c (TARGET_DEFAULT_TARGET_FLAGS): New.
......
...@@ -487,6 +487,7 @@ convert_to_integer (tree type, tree expr) ...@@ -487,6 +487,7 @@ convert_to_integer (tree type, tree expr)
else if (outprec >= inprec) else if (outprec >= inprec)
{ {
enum tree_code code; enum tree_code code;
tree tem;
/* If the precision of the EXPR's type is K bits and the /* If the precision of the EXPR's type is K bits and the
destination mode has more bits, and the sign is changing, destination mode has more bits, and the sign is changing,
...@@ -504,7 +505,13 @@ convert_to_integer (tree type, tree expr) ...@@ -504,7 +505,13 @@ convert_to_integer (tree type, tree expr)
else else
code = NOP_EXPR; code = NOP_EXPR;
return fold_build1 (code, type, expr); tem = fold_unary (code, type, expr);
if (tem)
return tem;
tem = build1 (code, type, expr);
TREE_NO_WARNING (tem) = 1;
return tem;
} }
/* If TYPE is an enumeral type or a type with a precision less /* If TYPE is an enumeral type or a type with a precision less
......
2006-08-28 Kazu Hirata <kazu@codesourcery.com>
PR middle-end/26632
* gcc.dg/pr26632.c: New.
2006-08-27 Jerry DeLisle <jvdelisle@gcc.gnu.org> 2006-08-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/28354 PR libgfortran/28354
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