aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Pinski <andrew_pinski@playstation.sony.com>2007-06-13 07:33:42 +0000
committerAndrew Pinski <andrew_pinski@playstation.sony.com>2007-06-13 07:33:42 +0000
commitbbd4a59b4802d5383870d19a86ba39045868c4a6 (patch)
tree01ebd4caa69a4290b3c986f0ac953e2784abacdb
parenta7a5985d92e8ca4c823f71f2d01f29b9edb9e322 (diff)
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. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/pointer_plus@125672 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog.ptr5
-rw-r--r--gcc/expr.c7
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. */