diff options
| author | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-04 23:00:00 +0000 |
|---|---|---|
| committer | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-04 23:00:00 +0000 |
| commit | df0137b92d4859863101d5f72d535945dbe7201c (patch) | |
| tree | 35858a62fe69e81cdcf5d8546b8674776f52a212 | |
| parent | 68cf29942c2845632ce65215ef5c17f907347956 (diff) | |
| download | ppe42-gcc-df0137b92d4859863101d5f72d535945dbe7201c.tar.gz ppe42-gcc-df0137b92d4859863101d5f72d535945dbe7201c.zip | |
* fold-const.c (fold_convert): When casting an expression to void,
fold_ignored_result may discover a GIMPLE_MODIFY_STMT which doesn't
have a type. Instead of attempting to build a NOP_EXPR, return
these "special" trees directly.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120451 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 7 | ||||
| -rw-r--r-- | gcc/fold-const.c | 5 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c6b21eb1b69..3f81da50627 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2007-01-04 Roger Sayle <roger@eyesopen.com> + + * fold-const.c (fold_convert): When casting an expression to void, + fold_ignored_result may discover a GIMPLE_MODIFY_STMT which doesn't + have a type. Instead of attempting to build a NOP_EXPR, return + these "special" trees directly. + 2007-01-04 Joseph Myers <joseph@codesourcery.com> * config/rs6000/rs6000.c (rs6000_rtx_costs): Make adjustment for diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 8826908054d..559acf018ad 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -2144,7 +2144,10 @@ fold_convert (tree type, tree arg) return fold_build1 (VIEW_CONVERT_EXPR, type, arg); case VOID_TYPE: - return fold_build1 (NOP_EXPR, type, fold_ignored_result (arg)); + tem = fold_ignored_result (arg); + if (TREE_CODE (tem) == GIMPLE_MODIFY_STMT) + return tem; + return fold_build1 (NOP_EXPR, type, tem); default: gcc_unreachable (); |

