diff options
| author | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-30 16:18:59 +0000 |
|---|---|---|
| committer | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-30 16:18:59 +0000 |
| commit | 2dcc623aa9eeab98c4e4e87bfede7b36c8ff013c (patch) | |
| tree | e9e26d68b3d3e84c0084b2450c7a914de5103eeb | |
| parent | ad25b344dde96781c8f1b1349ba606f34f7f23ff (diff) | |
| download | ppe42-gcc-2dcc623aa9eeab98c4e4e87bfede7b36c8ff013c.tar.gz ppe42-gcc-2dcc623aa9eeab98c4e4e87bfede7b36c8ff013c.zip | |
2004-05-30 Andrew Pinski <pinskia@physics.uc.edu>
* fold-const.c (fold) [case TRUTH_NOT_EXPR]: Make sure the type is
of BOOLEAN_TYPE.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82456 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/fold-const.c | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 79149e498d6..f72a6e274fd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-05-30 Andrew Pinski <pinskia@physics.uc.edu> + + * fold-const.c (fold) [case TRUTH_NOT_EXPR]: Make sure the type is + of BOOLEAN_TYPE. + 2004-05-30 Kazu Hirata <kazu@cs.umass.edu> * c-common.c, calls.c, cfgcleanup.c, cgraph.c, cgraphunit.c, diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 743f4ae47ee..7445408ce52 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -7215,6 +7215,10 @@ fold (tree expr) goto associate; case TRUTH_NOT_EXPR: + /* The argument to invert_truthvalue must have Boolean type. */ + if (TREE_CODE (TREE_TYPE (arg0)) != BOOLEAN_TYPE) + arg0 = fold_convert (boolean_type_node, arg0); + /* Note that the operand of this must be an int and its values must be 0 or 1. ("true" is a fixed value perhaps depending on the language, |

