From 3126d774bf1bad25855fe3c5eeca3dc5f4c134f4 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sun, 14 Jun 2009 21:07:41 +0000 Subject: [PATCH] * applied fix for optimization of wchar_t constants which is mentioned in the ICU configuration for BeOS, since otherwise we could not use optimization for ICU at all. [see http://gcc.gnu.org/ml/gcc-patches/2000-09/msg00454.html] git-svn-id: file:///srv/svn/repos/haiku/buildtools/trunk@31054 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- legacy/gcc/gcc/expr.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/legacy/gcc/gcc/expr.c b/legacy/gcc/gcc/expr.c index 5eebc01..ab8a82c 100644 --- a/legacy/gcc/gcc/expr.c +++ b/legacy/gcc/gcc/expr.c @@ -6448,9 +6448,16 @@ && TREE_INT_CST_HIGH (index) == 0 && (TREE_INT_CST_LOW (index) < TREE_STRING_LENGTH (init))) - return (GEN_INT - (TREE_STRING_POINTER - (init)[TREE_INT_CST_LOW (index)])); + { + tree type = TREE_TYPE (TREE_TYPE (init)); + enum machine_mode mode = TYPE_MODE (type); + + if (GET_MODE_CLASS (mode) == MODE_INT + && GET_MODE_SIZE (mode) == 1) + return (GEN_INT + (TREE_STRING_POINTER + (init)[TREE_INT_CST_LOW (index)])); + } } } } -- gitore 0.2.2