diff options
author | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-08-28 17:18:29 +0000 |
---|---|---|
committer | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-08-28 17:18:29 +0000 |
commit | 9c6fee9d552a6c6b26fbce9858633807f0932c19 (patch) | |
tree | 40343f32693521b2b9002ab7ed701bb4bcc0d94b /gcc | |
parent | 51136ff46e09f46ee20b94dc1c5b09ddc7bd9b49 (diff) | |
download | gcc-9c6fee9d552a6c6b26fbce9858633807f0932c19.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116510 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/convert.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 |
3 files changed, 19 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 745c64217fe..733fa47e7f4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +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> * config/h8300/h8300.c (TARGET_DEFAULT_TARGET_FLAGS): New. diff --git a/gcc/convert.c b/gcc/convert.c index 27571956a1e..118889fad44 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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 65900a7e8b3..767f94e3a84 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +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> PR libgfortran/28354 |