diff options
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/fold-const.c | 16 |
2 files changed, 17 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 231dccd..ef0c632 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2003-06-09 Jason Merrill <jason@redhat.com> + + * fold-const.c (operand_equal_p): Handle ADDR_EXPR and TRUTH_NOT_EXPR. + 2003-06-19 Osku Salerma <osku@iki.fi> * c-format.c (check_format_string, get_constant): New. diff --git a/gcc/fold-const.c b/gcc/fold-const.c index c97213a..1f118e8 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -2000,9 +2000,19 @@ operand_equal_p (arg0, arg1, only_const) } case 'e': - if (TREE_CODE (arg0) == RTL_EXPR) - return rtx_equal_p (RTL_EXPR_RTL (arg0), RTL_EXPR_RTL (arg1)); - return 0; + switch (TREE_CODE (arg0)) + { + case ADDR_EXPR: + case TRUTH_NOT_EXPR: + return operand_equal_p (TREE_OPERAND (arg0, 0), + TREE_OPERAND (arg1, 0), 0); + + case RTL_EXPR: + return rtx_equal_p (RTL_EXPR_RTL (arg0), RTL_EXPR_RTL (arg1)); + + default: + return 0; + } default: return 0; |