diff options
-rw-r--r-- | gcc/ChangeLog.ptr | 5 | ||||
-rw-r--r-- | gcc/expr.c | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/gcc/ChangeLog.ptr b/gcc/ChangeLog.ptr index b4b67ddaa7d..89a7a26c907 100644 --- a/gcc/ChangeLog.ptr +++ b/gcc/ChangeLog.ptr @@ -1,3 +1,8 @@ +2007-06-13 Andrew Pinski <andrew_pinski@playstation.sony.com> + + * expr.c (expand_expr_real_1 <case POINTER_PLUS_EXPR>): Remove assert + for checking the modes of the operands are the same. + 2007-06-12 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/sparc/sparc.c (sparc_gimplify_va_arg): Use POINTER_PLUS_EXPR diff --git a/gcc/expr.c b/gcc/expr.c index ac1b8e2bb36..c28d0abc7c2 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -8037,10 +8037,9 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, return op0; case POINTER_PLUS_EXPR: - /* FIXME, this can incorrect when - the POINTER_TYPE mode is not the same as the size_type's mode. */ - gcc_assert (TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0))) - == TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 1)))); + /* Even though the sizetype mode and the pointer's mode can be different + expand is able to handle this correct and get the correct result out + from the PLUS_EXPR code. */ case PLUS_EXPR: /* Check if this is a case for multiplication and addition. */ |