diff options
author | Roger Sayle <roger@eyesopen.com> | 2007-01-04 23:00:00 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2007-01-04 23:00:00 +0000 |
commit | bd7e4636d946650249b6c430d33e6ccb70eb302a (patch) | |
tree | 35858a62fe69e81cdcf5d8546b8674776f52a212 /gcc/fold-const.c | |
parent | 7fd453b4a2e9881d74d3081a38d21a5af0c853d6 (diff) | |
download | gcc-bd7e4636d946650249b6c430d33e6ccb70eb302a.zip gcc-bd7e4636d946650249b6c430d33e6ccb70eb302a.tar.gz gcc-bd7e4636d946650249b6c430d33e6ccb70eb302a.tar.bz2 |
fold-const.c (fold_convert): When casting an expression to void...
* 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.
From-SVN: r120451
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 8826908..559acf0 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 (); |