diff options
author | Kyrylo Tkachov <kyrylo.tkachov@arm.com> | 2013-09-09 13:16:44 +0000 |
---|---|---|
committer | Kyrylo Tkachov <ktkachov@gcc.gnu.org> | 2013-09-09 13:16:44 +0000 |
commit | 849107c128378779f133c435d3f76d45b599361b (patch) | |
tree | 61323eed66de3e007b2f654e2cd75169bfda2b4b | |
parent | 088c5368f1f9266a10b900b3ea290ca65b6908a9 (diff) | |
download | gcc-849107c128378779f133c435d3f76d45b599361b.zip gcc-849107c128378779f133c435d3f76d45b599361b.tar.gz gcc-849107c128378779f133c435d3f76d45b599361b.tar.bz2 |
re PR target/57735 (ICE with -mtune=xscale (error: could not split insn) when building webkit)
2013-09-09 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR target/57735
* g++.dg/ext/pr57735.C: New test.
From-SVN: r202398
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/pr57735.C | 145 |
2 files changed, 150 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 51cab1b..9726eb6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-09-09 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + + PR target/57735 + * g++.dg/ext/pr57735.C: New test. + 2013-09-09 Jan Hubicka <jh@suse.cz> PR middle-end/58294 diff --git a/gcc/testsuite/g++.dg/ext/pr57735.C b/gcc/testsuite/g++.dg/ext/pr57735.C new file mode 100644 index 0000000..0eb9500 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/pr57735.C @@ -0,0 +1,145 @@ +/* { dg-do compile { target arm*-*-* } } */ +/* { dg-options "-march=armv5te -marm -mtune=xscale -mfloat-abi=soft -O1" } */ + +typedef unsigned int size_t; +__extension__ +typedef long long int int64_t; +namespace WTF { + template<typename T> class RefPtr { + public: + inline T* operator->() const { return m_ptr; } + T* m_ptr; + }; +} +using WTF::RefPtr; +namespace JSC { + class ExecState; + class JSString; + typedef int64_t EncodedJSValue; + class JSValue { + public: + static EncodedJSValue encode(JSValue); + JSString* toString(ExecState*) const; + }; +} +typedef unsigned char LChar; + typedef short unsigned int UChar; +namespace WTF { + template<typename T, size_t inlineCapacity = 0> + class Vector { + public: + template<typename U> bool tryAppend(const U*, size_t); + }; +} +using WTF::Vector; +namespace WTF { +template<typename CharType> inline bool isASCIIDigit(CharType c) +{ +} +template<typename CharType> inline bool isASCIIHexDigit(CharType c) +{ + return isASCIIDigit(c) || ((c | 0x20) >= 'a' && (c | 0x20) <= 'f'); +} + class StringImpl; +} +using WTF::StringImpl; +namespace WTF { +class StringImpl { +public: + unsigned length() const { return m_length; } + unsigned m_length; +}; +} +namespace JSC { + class Register { + }; +class UString { +public: + unsigned length() const + { + return m_impl->length(); + } + const LChar* characters8() const + { + } + RefPtr<StringImpl> m_impl; +}; + class ExecState : private Register { + public: + JSValue argument(size_t argument) + { + } + }; + class JSCell { + }; + class JSString : public JSCell { + public: + const UString& value(ExecState*) const; + }; +class JSStringBuilder { +public: + void append(const UChar u) + { + m_okay &= buffer16.tryAppend(&u, 1); + } + Vector<UChar, 64> buffer16; + bool m_okay; +}; +template <typename T> +class Lexer { +public: + static unsigned char convertHex(int c1, int c2); +}; +} +namespace WTF { +namespace Unicode { + int UTF8SequenceLength(char); + int decodeUTF8Sequence(const char*); +} +} +using namespace WTF; +using namespace Unicode; +namespace JSC { +template <typename CharType> +static JSValue decode(ExecState* exec, const CharType* characters, int length, const char* doNotUnescape, bool strict) +{ + JSStringBuilder builder; + int k = 0; + UChar u = 0; + while (k < length) { + const CharType* p = characters + k; + CharType c = *p; + if (c == '%') { + int charLen = 0; + if (k <= length - 3 && isASCIIHexDigit(p[1]) && isASCIIHexDigit(p[2])) { + const char b0 = Lexer<CharType>::convertHex(p[1], p[2]); + const int sequenceLen = UTF8SequenceLength(b0); + if (sequenceLen && k <= length - sequenceLen * 3) { + charLen = sequenceLen * 3; + char sequence[5]; + if (charLen != 0) { + const int character = decodeUTF8Sequence(sequence); + if (character < 0 || character >= 0x110000) + charLen = 0; + else if (character >= 0x10000) { + builder.append(static_cast<UChar>(0xD800 | ((character - 0x10000) >> 10))); + } else + u = static_cast<UChar>(character); + } + } + } + } + } +} +static JSValue decode(ExecState* exec, const char* doNotUnescape, bool strict) +{ + UString str = exec->argument(0).toString(exec)->value(exec); + return decode(exec, str.characters8(), str.length(), doNotUnescape, strict); +} +EncodedJSValue globalFuncDecodeURI(ExecState* exec) +{ + static const char do_not_unescape_when_decoding_URI[] = + "#$&+,/:;=?@"; + return JSValue::encode(decode(exec, do_not_unescape_when_decoding_URI, true)); +} +} |