diff options
author | Kazu Hirata <kazu@codesourcery.com> | 2006-08-28 17:18:29 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@gcc.gnu.org> | 2006-08-28 17:18:29 +0000 |
commit | 03a569a38c07e2094cd76fd1e951a3e52c7568fa (patch) | |
tree | 40343f32693521b2b9002ab7ed701bb4bcc0d94b /gcc/convert.c | |
parent | 1aeceea452b6593223a2874f5b266455ea811297 (diff) | |
download | gcc-03a569a38c07e2094cd76fd1e951a3e52c7568fa.zip gcc-03a569a38c07e2094cd76fd1e951a3e52c7568fa.tar.gz gcc-03a569a38c07e2094cd76fd1e951a3e52c7568fa.tar.bz2 |
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
Diffstat (limited to 'gcc/convert.c')
-rw-r--r-- | gcc/convert.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/convert.c b/gcc/convert.c index 2757195..118889f 100644 --- a/gcc/convert.c +++ b/gcc/convert.c @@ -487,6 +487,7 @@ convert_to_integer (tree type, tree expr) else if (outprec >= inprec) { enum tree_code code; + tree tem; /* If the precision of the EXPR's type is K bits and the destination mode has more bits, and the sign is changing, @@ -504,7 +505,13 @@ convert_to_integer (tree type, tree expr) else 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 |