[Haiku-commits] r31054 - buildtools/trunk/legacy/gcc/gcc
zooey at BerliOS
zooey at mail.berlios.de
Sun Jun 14 23:07:41 CEST 2009
Author: zooey
Date: 2009-06-14 23:07:41 +0200 (Sun, 14 Jun 2009)
New Revision: 31054
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=31054&view=rev
Modified:
buildtools/trunk/legacy/gcc/gcc/expr.c
Log:
* 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]
Modified: buildtools/trunk/legacy/gcc/gcc/expr.c
===================================================================
--- buildtools/trunk/legacy/gcc/gcc/expr.c 2009-06-14 19:51:29 UTC (rev 31053)
+++ buildtools/trunk/legacy/gcc/gcc/expr.c 2009-06-14 21:07:41 UTC (rev 31054)
@@ -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)]));
+ }
}
}
}
More information about the Haiku-commits
mailing list