diff --git a/.cvsignore b/.cvsignore index db8a6dd..6dbf7d0 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -gcc-4.4.1-20090902.tar.bz2 +gcc-4.4.2-20091114.tar.bz2 diff --git a/gcc44-hack.patch b/gcc44-hack.patch index c770339..8719d17 100644 --- a/gcc44-hack.patch +++ b/gcc44-hack.patch @@ -1,6 +1,6 @@ --- libada/Makefile.in.jj 2009-01-14 12:07:35.000000000 +0100 +++ libada/Makefile.in 2009-01-15 14:25:33.000000000 +0100 -@@ -67,17 +67,39 @@ version := $(shell cat $(srcdir)/../gcc/ +@@ -69,18 +69,40 @@ version := $(shell cat $(srcdir)/../gcc/ libsubdir := $(libdir)/gcc/$(target_noncanonical)/$(version)$(MULTISUBDIR) ADA_RTS_DIR=$(GCC_DIR)/ada/rts$(subst /,_,$(MULTISUBDIR)) @@ -38,12 +38,14 @@ "SHELL=$(SHELL)" \ - "GNATLIBFLAGS=$(GNATLIBFLAGS) $(MULTIFLAGS)" \ - "GNATLIBCFLAGS=$(GNATLIBCFLAGS) $(MULTIFLAGS)" \ +- "GNATLIBCFLAGS_FOR_C=$(GNATLIBCFLAGS_FOR_C) $(MULTIFLAGS)" \ + "GNATLIBFLAGS=$(strip $(GNATLIBFLAGS) $(MULTIFLAGS) $(DEFAULTMULTIFLAGS))" \ + "GNATLIBCFLAGS=$(strip $(GNATLIBCFLAGS) $(MULTIFLAGS) $(DEFAULTMULTIFLAGS))" \ ++ "GNATLIBCFLAGS_FOR_C=$(strip $(GNATLIBCFLAGS_FOR_C) $(MULTIFLAGS) $(DEFAULTMULTIFLAGS))" \ "TARGET_LIBGCC2_CFLAGS=$(TARGET_LIBGCC2_CFLAGS)" \ "THREAD_KIND=$(THREAD_KIND)" \ "TRACE=$(TRACE)" \ -@@ -88,7 +110,7 @@ LIBADA_FLAGS_TO_PASS = \ +@@ -91,7 +113,7 @@ LIBADA_FLAGS_TO_PASS = \ "exeext=.exeext.should.not.be.used " \ 'CC=the.host.compiler.should.not.be.needed' \ "GCC_FOR_TARGET=$(CC)" \ diff --git a/gcc44-ppc64-aixdesc.patch b/gcc44-ppc64-aixdesc.patch new file mode 100644 index 0000000..b9f4a8b --- /dev/null +++ b/gcc44-ppc64-aixdesc.patch @@ -0,0 +1,24 @@ +2009-09-16 Jakub Jelinek + + * config/rs6000/sysv4.h (FP_SAVE_INLINE, GP_SAVE_INLINE): Disable + out of line gpr/fpr saving for -m64 -Os -mcall-aixdesc. + +--- gcc/config/rs6000/sysv4.h.jj 2009-09-16 14:46:19.000000000 +0200 ++++ gcc/config/rs6000/sysv4.h 2009-09-16 14:46:19.000000000 +0200 +@@ -273,12 +273,14 @@ do { \ + /* Define cutoff for using external functions to save floating point. + When optimizing for size, use external functions when profitable. */ + #define FP_SAVE_INLINE(FIRST_REG) (optimize_size \ ++ && (!TARGET_64BIT || !DOT_SYMBOLS) \ + ? ((FIRST_REG) == 62 \ + || (FIRST_REG) == 63) \ + : (FIRST_REG) < 64) + /* And similarly for general purpose registers. */ +-#define GP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 32 \ +- && !optimize_size) ++#define GP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 32 \ ++ && (!optimize_size \ ++ || (TARGET_64BIT && DOT_SYMBOLS))) + + /* Put jump tables in read-only memory, rather than in .text. */ + #define JUMP_TABLES_IN_TEXT_SECTION 0 diff --git a/gcc44-pr38757.patch b/gcc44-pr38757.patch index c166411..805996f 100644 --- a/gcc44-pr38757.patch +++ b/gcc44-pr38757.patch @@ -90,7 +90,7 @@ const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; --- gcc/dwarf2out.c.jj 2009-03-17 13:06:29.000000000 +0100 +++ gcc/dwarf2out.c 2009-03-18 12:55:36.000000000 +0100 -@@ -12470,9 +12470,18 @@ add_bit_size_attribute (dw_die_ref die, +@@ -14286,9 +14286,18 @@ add_bit_size_attribute (dw_die_ref die, static inline void add_prototyped_attribute (dw_die_ref die, tree func_type) { @@ -112,18 +112,14 @@ } /* Add an 'abstract_origin' attribute below a given DIE. The DIE is found -@@ -14419,7 +14428,13 @@ gen_compile_unit_die (const char *filena - else if (strcmp (language_string, "GNU Objective-C++") == 0) - language = DW_LANG_ObjC_plus_plus; - else -- language = DW_LANG_C89; -+ { -+ if (lang_hooks.source_language -+ && lang_hooks.source_language () >= 1999) +@@ -16290,6 +16299,10 @@ gen_compile_unit_die (const char *filena + language = DW_LANG_ObjC; + else if (strcmp (language_string, "GNU Objective-C++") == 0) + language = DW_LANG_ObjC_plus_plus; ++ else if (strcmp (language_string, "GNU C") == 0 ++ && lang_hooks.source_language ++ && lang_hooks.source_language () >= 1999) + language = DW_LANG_C99; -+ else -+ language = DW_LANG_C89; -+ } + } add_AT_unsigned (die, DW_AT_language, language); - return die; diff --git a/gcc44-raw-string.patch b/gcc44-raw-string.patch deleted file mode 100644 index ecc5c5d..0000000 --- a/gcc44-raw-string.patch +++ /dev/null @@ -1,1495 +0,0 @@ -2008-09-12 Jakub Jelinek - - * charset.c (cpp_init_iconv): Initialize utf8_cset_desc. - (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc - and char32_cset_desc. - (converter_for_type): Handle CPP_UTF8STRING. - (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings. - * directives.c (get__Pragma_string): Handle CPP_UTF8STRING. - * include/cpplib.h (CPP_UTF8STRING): New token type. - * internal.h (struct cpp_reader): Add utf8_cset_desc field. - * lex.c (lex_raw_string): New function. - (lex_string): Handle u8 string literals, call lex_raw_string - for raw string literals. - (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R" - sequences. - * macro.c (stringify_arg): Handle CPP_UTF8STRING. - - * c-common.c (c_parse_error): Handle CPP_UTF8STRING. - * c-lex.c (c_lex_with_flags, lex_string): Likewise. - * c-parser.c (c_parser_postfix_expression): Likewise. - - * parser.c (cp_lexer_print_token, cp_parser_is_string_literal, - cp_parser_string_literal, cp_parser_primary_expression): Likewise. - - * gcc.dg/raw-string-1.c: New test. - * gcc.dg/raw-string-2.c: New test. - * gcc.dg/raw-string-3.c: New test. - * gcc.dg/raw-string-4.c: New test. - * gcc.dg/raw-string-5.c: New test. - * gcc.dg/raw-string-6.c: New test. - * gcc.dg/raw-string-7.c: New test. - * gcc.dg/utf8-1.c: New test. - * gcc.dg/utf8-2.c: New test. - * gcc.dg/utf-badconcat2.c: New test. - * gcc.dg/utf-dflt2.c: New test. - * g++.dg/ext/raw-string-1.C: New test. - * g++.dg/ext/raw-string-2.C: New test. - * g++.dg/ext/raw-string-3.C: New test. - * g++.dg/ext/raw-string-4.C: New test. - * g++.dg/ext/raw-string-5.C: New test. - * g++.dg/ext/raw-string-6.C: New test. - * g++.dg/ext/raw-string-7.C: New test. - * g++.dg/ext/utf8-1.C: New test. - * g++.dg/ext/utf8-2.C: New test. - * g++.dg/ext/utf-badconcat2.C: New test. - * g++.dg/ext/utf-dflt2.C: New test. - ---- libcpp/charset.c.jj 2008-09-05 12:59:49.000000000 +0200 -+++ libcpp/charset.c 2008-09-11 22:11:02.000000000 +0200 -@@ -721,6 +721,8 @@ cpp_init_iconv (cpp_reader *pfile) - - pfile->narrow_cset_desc = init_iconv_desc (pfile, ncset, SOURCE_CHARSET); - pfile->narrow_cset_desc.width = CPP_OPTION (pfile, char_precision); -+ pfile->utf8_cset_desc = init_iconv_desc (pfile, "UTF-8", SOURCE_CHARSET); -+ pfile->utf8_cset_desc.width = CPP_OPTION (pfile, char_precision); - pfile->char16_cset_desc = init_iconv_desc (pfile, - be ? "UTF-16BE" : "UTF-16LE", - SOURCE_CHARSET); -@@ -741,6 +743,12 @@ _cpp_destroy_iconv (cpp_reader *pfile) - { - if (pfile->narrow_cset_desc.func == convert_using_iconv) - iconv_close (pfile->narrow_cset_desc.cd); -+ if (pfile->utf8_cset_desc.func == convert_using_iconv) -+ iconv_close (pfile->utf8_cset_desc.cd); -+ if (pfile->char16_cset_desc.func == convert_using_iconv) -+ iconv_close (pfile->char16_cset_desc.cd); -+ if (pfile->char32_cset_desc.func == convert_using_iconv) -+ iconv_close (pfile->char32_cset_desc.cd); - if (pfile->wide_cset_desc.func == convert_using_iconv) - iconv_close (pfile->wide_cset_desc.cd); - } -@@ -1330,6 +1338,8 @@ converter_for_type (cpp_reader *pfile, e - { - default: - return pfile->narrow_cset_desc; -+ case CPP_UTF8STRING: -+ return pfile->utf8_cset_desc; - case CPP_CHAR16: - case CPP_STRING16: - return pfile->char16_cset_desc; -@@ -1364,7 +1374,47 @@ cpp_interpret_string (cpp_reader *pfile, - for (i = 0; i < count; i++) - { - p = from[i].text; -- if (*p == 'L' || *p == 'u' || *p == 'U') p++; -+ if (*p == 'u') -+ { -+ if (*++p == '8') -+ p++; -+ } -+ else if (*p == 'L' || *p == 'U') p++; -+ if (*p == 'R') -+ { -+ const uchar *prefix; -+ -+ /* Skip over 'R"'. */ -+ p += 2; -+ prefix = p; -+ while (*p != '[') -+ p++; -+ p++; -+ limit = from[i].text + from[i].len; -+ if (limit >= p + (p - prefix) + 1) -+ limit -= (p - prefix) + 1; -+ -+ for (;;) -+ { -+ base = p; -+ while (p < limit && (*p != '\\' || (p[1] != 'u' && p[1] != 'U'))) -+ p++; -+ if (p > base) -+ { -+ /* We have a run of normal characters; these can be fed -+ directly to convert_cset. */ -+ if (!APPLY_CONVERSION (cvt, base, p - base, &tbuf)) -+ goto fail; -+ } -+ if (p == limit) -+ break; -+ -+ p = convert_ucn (pfile, p + 1, limit, &tbuf, cvt); -+ } -+ -+ continue; -+ } -+ - p++; /* Skip leading quote. */ - limit = from[i].text + from[i].len - 1; /* Skip trailing quote. */ - ---- libcpp/directives.c.jj 2008-09-05 12:59:49.000000000 +0200 -+++ libcpp/directives.c 2008-09-11 20:27:32.000000000 +0200 -@@ -1519,7 +1519,8 @@ get__Pragma_string (cpp_reader *pfile) - if (string->type == CPP_EOF) - _cpp_backup_tokens (pfile, 1); - if (string->type != CPP_STRING && string->type != CPP_WSTRING -- && string->type != CPP_STRING32 && string->type != CPP_STRING16) -+ && string->type != CPP_STRING32 && string->type != CPP_STRING16 -+ && string->type != CPP_UTF8STRING) - return NULL; - - paren = get_token_no_padding (pfile); ---- libcpp/include/cpplib.h.jj 2008-09-05 12:59:47.000000000 +0200 -+++ libcpp/include/cpplib.h 2008-09-11 20:23:53.000000000 +0200 -@@ -131,6 +131,7 @@ struct _cpp_file; - TK(WSTRING, LITERAL) /* L"string" */ \ - TK(STRING16, LITERAL) /* u"string" */ \ - TK(STRING32, LITERAL) /* U"string" */ \ -+ TK(UTF8STRING, LITERAL) /* u8"string" */ \ - TK(OBJC_STRING, LITERAL) /* @"string" - Objective-C */ \ - TK(HEADER_NAME, LITERAL) /* in #include */ \ - \ -@@ -724,10 +725,10 @@ extern const unsigned char *cpp_macro_de - extern void _cpp_backup_tokens (cpp_reader *, unsigned int); - extern const cpp_token *cpp_peek_token (cpp_reader *, int); - --/* Evaluate a CPP_CHAR or CPP_WCHAR token. */ -+/* Evaluate a CPP_*CHAR* token. */ - extern cppchar_t cpp_interpret_charconst (cpp_reader *, const cpp_token *, - unsigned int *, int *); --/* Evaluate a vector of CPP_STRING or CPP_WSTRING tokens. */ -+/* Evaluate a vector of CPP_*STRING* tokens. */ - extern bool cpp_interpret_string (cpp_reader *, - const cpp_string *, size_t, - cpp_string *, enum cpp_ttype); ---- libcpp/internal.h.jj 2008-09-05 12:59:49.000000000 +0200 -+++ libcpp/internal.h 2008-09-11 18:23:02.000000000 +0200 -@@ -400,6 +400,10 @@ struct cpp_reader - struct cset_converter narrow_cset_desc; - - /* Descriptor for converting from the source character set to the -+ UTF-8 execution character set. */ -+ struct cset_converter utf8_cset_desc; -+ -+ /* Descriptor for converting from the source character set to the - UTF-16 execution character set. */ - struct cset_converter char16_cset_desc; - ---- libcpp/lex.c.jj 2008-09-05 12:59:49.000000000 +0200 -+++ libcpp/lex.c 2008-09-12 13:54:01.000000000 +0200 -@@ -610,12 +610,186 @@ create_literal (cpp_reader *pfile, cpp_t - token->val.str.text = dest; - } - -+/* Lexes raw a string. The stored string contains the spelling, including -+ double quotes, delimiter string, '[' and ']', any leading -+ 'L', 'u', 'U' or 'u8' and 'R' modifier. It returns the type of the -+ literal, or CPP_OTHER if it was not properly terminated. -+ -+ The spelling is NUL-terminated, but it is not guaranteed that this -+ is the first NUL since embedded NULs are preserved. */ -+ -+static void -+lex_raw_string (cpp_reader *pfile, cpp_token *token, const uchar *base, -+ const uchar *cur) -+{ -+ bool saw_NUL = false; -+ const uchar *raw_prefix; -+ unsigned int raw_prefix_len = 0; -+ enum cpp_ttype type; -+ size_t total_len = 0; -+ _cpp_buff *first_buff = NULL, *last_buff = NULL; -+ -+ type = (*base == 'L' ? CPP_WSTRING : -+ *base == 'U' ? CPP_STRING32 : -+ *base == 'u' ? (base[1] == '8' ? CPP_UTF8STRING : CPP_STRING16) -+ : CPP_STRING); -+ -+ raw_prefix = cur + 1; -+ while (raw_prefix_len < 16) -+ { -+ switch (raw_prefix[raw_prefix_len]) -+ { -+ case ' ': case '[': case ']': case '\t': -+ case '\v': case '\f': case '\n': default: -+ break; -+ /* Basic source charset except the above chars. */ -+ case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': -+ case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': -+ case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': -+ case 's': case 't': case 'u': case 'v': case 'w': case 'x': -+ case 'y': case 'z': -+ case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': -+ case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': -+ case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': -+ case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': -+ case 'Y': case 'Z': -+ case '0': case '1': case '2': case '3': case '4': case '5': -+ case '6': case '7': case '8': case '9': -+ case '_': case '{': case '}': case '#': case '(': case ')': -+ case '<': case '>': case '%': case ':': case ';': case '.': -+ case '?': case '*': case '+': case '-': case '/': case '^': -+ case '&': case '|': case '~': case '!': case '=': case ',': -+ case '\\': case '"': case '\'': -+ raw_prefix_len++; -+ continue; -+ } -+ break; -+ } -+ -+ if (raw_prefix[raw_prefix_len] != '[') -+ { -+ if (raw_prefix_len == 16) -+ cpp_error (pfile, CPP_DL_ERROR, -+ "raw string delimiter longer than 16 characters"); -+ else -+ cpp_error (pfile, CPP_DL_ERROR, -+ "invalid character '%c' in raw string delimiter", -+ (int) raw_prefix[raw_prefix_len]); -+ pfile->buffer->cur = raw_prefix - 1; -+ create_literal (pfile, token, base, raw_prefix - 1 - base, CPP_OTHER); -+ return; -+ } -+ -+ cur = raw_prefix + raw_prefix_len + 1; -+ for (;;) -+ { -+ cppchar_t c = *cur++; -+ -+ if (c == ']' -+ && strncmp ((const char *) cur, (const char *) raw_prefix, -+ raw_prefix_len) == 0 -+ && cur[raw_prefix_len] == '"') -+ { -+ cur += raw_prefix_len + 1; -+ break; -+ } -+ else if (c == '\n') -+ { -+ if (pfile->state.in_directive -+ || pfile->state.parsing_args -+ || pfile->state.in_deferred_pragma) -+ { -+ cur--; -+ type = CPP_OTHER; -+ cpp_error (pfile, CPP_DL_ERROR, "unterminated raw string"); -+ break; -+ } -+ -+ /* raw strings allow embedded non-escaped newlines, which -+ complicates this routine a lot. */ -+ if (first_buff == NULL) -+ { -+ total_len = cur - base; -+ first_buff = last_buff = _cpp_get_buff (pfile, total_len); -+ memcpy (BUFF_FRONT (last_buff), base, total_len); -+ raw_prefix = BUFF_FRONT (last_buff) + (raw_prefix - base); -+ BUFF_FRONT (last_buff) += total_len; -+ } -+ else -+ { -+ size_t len = cur - base; -+ size_t cur_len = len > BUFF_ROOM (last_buff) -+ ? BUFF_ROOM (last_buff) : len; -+ -+ total_len += len; -+ memcpy (BUFF_FRONT (last_buff), base, cur_len); -+ BUFF_FRONT (last_buff) += cur_len; -+ if (len > cur_len) -+ { -+ last_buff = _cpp_append_extend_buff (pfile, last_buff, -+ len - cur_len); -+ memcpy (BUFF_FRONT (last_buff), base + cur_len, -+ len - cur_len); -+ BUFF_FRONT (last_buff) += len - cur_len; -+ } -+ } -+ -+ if (pfile->buffer->cur < pfile->buffer->rlimit) -+ CPP_INCREMENT_LINE (pfile, 0); -+ pfile->buffer->need_line = true; -+ -+ if (!_cpp_get_fresh_line (pfile)) -+ { -+ token->type = CPP_EOF; -+ /* Tell the compiler the line number of the EOF token. */ -+ token->src_loc = pfile->line_table->highest_line; -+ token->flags = BOL; -+ if (first_buff != NULL) -+ _cpp_release_buff (pfile, first_buff); -+ cpp_error (pfile, CPP_DL_ERROR, "unterminated raw string"); -+ return; -+ } -+ -+ cur = base = pfile->buffer->cur; -+ } -+ else if (c == '\0') -+ saw_NUL = true; -+ } -+ -+ if (saw_NUL && !pfile->state.skipping) -+ cpp_error (pfile, CPP_DL_WARNING, -+ "null character(s) preserved in literal"); -+ -+ pfile->buffer->cur = cur; -+ if (first_buff == NULL) -+ create_literal (pfile, token, base, cur - base, type); -+ else -+ { -+ uchar *dest = _cpp_unaligned_alloc (pfile, total_len + (cur - base) + 1); -+ -+ token->type = type; -+ token->val.str.len = total_len + (cur - base); -+ token->val.str.text = dest; -+ last_buff = first_buff; -+ while (last_buff != NULL) -+ { -+ memcpy (dest, last_buff->base, -+ BUFF_FRONT (last_buff) - last_buff->base); -+ dest += BUFF_FRONT (last_buff) - last_buff->base; -+ last_buff = last_buff->next; -+ } -+ _cpp_release_buff (pfile, first_buff); -+ memcpy (dest, base, cur - base); -+ dest[cur - base] = '\0'; -+ } -+} -+ - /* Lexes a string, character constant, or angle-bracketed header file - name. The stored string contains the spelling, including opening -- quote and leading any leading 'L', 'u' or 'U'. It returns the type -- of the literal, or CPP_OTHER if it was not properly terminated, or -- CPP_LESS for an unterminated header name which must be relexed as -- normal tokens. -+ quote and any leading 'L', 'u', 'U' or 'u8' and optional -+ 'R' modifier. It returns the type of the literal, or CPP_OTHER -+ if it was not properly terminated, or CPP_LESS for an unterminated -+ header name which must be relexed as normal tokens. - - The spelling is NUL-terminated, but it is not guaranteed that this - is the first NUL since embedded NULs are preserved. */ -@@ -629,12 +803,24 @@ lex_string (cpp_reader *pfile, cpp_token - - cur = base; - terminator = *cur++; -- if (terminator == 'L' || terminator == 'u' || terminator == 'U') -+ if (terminator == 'L' || terminator == 'U') - terminator = *cur++; -- if (terminator == '\"') -+ else if (terminator == 'u') -+ { -+ terminator = *cur++; -+ if (terminator == '8') -+ terminator = *cur++; -+ } -+ if (terminator == 'R') -+ { -+ lex_raw_string (pfile, token, base, cur); -+ return; -+ } -+ if (terminator == '"') - type = (*base == 'L' ? CPP_WSTRING : - *base == 'U' ? CPP_STRING32 : -- *base == 'u' ? CPP_STRING16 : CPP_STRING); -+ *base == 'u' ? (base[1] == '8' ? CPP_UTF8STRING : CPP_STRING16) -+ : CPP_STRING); - else if (terminator == '\'') - type = (*base == 'L' ? CPP_WCHAR : - *base == 'U' ? CPP_CHAR32 : -@@ -1094,10 +1280,20 @@ _cpp_lex_direct (cpp_reader *pfile) - case 'L': - case 'u': - case 'U': -+ case 'R': - /* 'L', 'u' or 'U' may introduce wide characters or strings. */ - if (c == 'L' || CPP_OPTION (pfile, uliterals)) - { -- if (*buffer->cur == '\'' || *buffer->cur == '"') -+ if ((*buffer->cur == '\'' && c != 'R') -+ || *buffer->cur == '"' -+ || (*buffer->cur == 'R' -+ && c != 'R' -+ && buffer->cur[1] == '"' -+ && CPP_OPTION (pfile, uliterals)) -+ || (*buffer->cur == '8' -+ && c == 'u' -+ && (buffer->cur[1] == '"' -+ || (buffer->cur[1] == 'R' && buffer->cur[2] == '"')))) - { - lex_string (pfile, result, buffer->cur - 1); - break; -@@ -1113,7 +1309,7 @@ _cpp_lex_direct (cpp_reader *pfile) - case 'y': case 'z': - case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': - case 'G': case 'H': case 'I': case 'J': case 'K': -- case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': -+ case 'M': case 'N': case 'O': case 'P': case 'Q': - case 'S': case 'T': case 'V': case 'W': case 'X': - case 'Y': case 'Z': - result->type = CPP_NAME; ---- libcpp/macro.c.jj 2008-09-05 12:59:49.000000000 +0200 -+++ libcpp/macro.c 2008-09-11 20:25:20.000000000 +0200 -@@ -377,7 +377,8 @@ stringify_arg (cpp_reader *pfile, macro_ - escape_it = (token->type == CPP_STRING || token->type == CPP_CHAR - || token->type == CPP_WSTRING || token->type == CPP_STRING - || token->type == CPP_STRING32 || token->type == CPP_CHAR32 -- || token->type == CPP_STRING16 || token->type == CPP_CHAR16); -+ || token->type == CPP_STRING16 || token->type == CPP_CHAR16 -+ || token->type == CPP_UTF8STRING); - - /* Room for each char being written in octal, initial space and - final quote and NUL. */ ---- gcc/c-common.c.jj 2008-09-09 16:08:04.000000000 +0200 -+++ gcc/c-common.c 2008-09-11 20:30:57.000000000 +0200 -@@ -7472,7 +7472,7 @@ c_parse_error (const char *gmsgid, enum - message = NULL; - } - else if (token == CPP_STRING || token == CPP_WSTRING || token == CPP_STRING16 -- || token == CPP_STRING32) -+ || token == CPP_STRING32 || token == CPP_UTF8STRING) - message = catenate_messages (gmsgid, " before string constant"); - else if (token == CPP_NUMBER) - message = catenate_messages (gmsgid, " before numeric constant"); ---- gcc/c-lex.c.jj 2008-09-05 12:56:31.000000000 +0200 -+++ gcc/c-lex.c 2008-09-11 20:34:06.000000000 +0200 -@@ -365,6 +365,7 @@ c_lex_with_flags (tree *value, location_ - case CPP_WSTRING: - case CPP_STRING16: - case CPP_STRING32: -+ case CPP_UTF8STRING: - type = lex_string (tok, value, true, true); - break; - -@@ -423,6 +424,7 @@ c_lex_with_flags (tree *value, location_ - case CPP_WSTRING: - case CPP_STRING16: - case CPP_STRING32: -+ case CPP_UTF8STRING: - if ((lex_flags & C_LEX_RAW_STRINGS) == 0) - { - type = lex_string (tok, value, false, -@@ -830,12 +832,13 @@ interpret_fixed (const cpp_token *token, - return value; - } - --/* Convert a series of STRING, WSTRING, STRING16 and/or STRING32 tokens -- into a tree, performing string constant concatenation. TOK is the -- first of these. VALP is the location to write the string into. -- OBJC_STRING indicates whether an '@' token preceded the incoming token. -+/* Convert a series of STRING, WSTRING, STRING16, STRING32 and/or -+ UTF8STRING tokens into a tree, performing string constant -+ concatenation. TOK is the first of these. VALP is the location -+ to write the string into. OBJC_STRING indicates whether an '@' token -+ preceded the incoming token. - Returns the CPP token type of the result (CPP_STRING, CPP_WSTRING, -- CPP_STRING32, CPP_STRING16, or CPP_OBJC_STRING). -+ CPP_STRING32, CPP_STRING16, CPP_UTF8STRING, or CPP_OBJC_STRING). - - This is unfortunately more work than it should be. If any of the - strings in the series has an L prefix, the result is a wide string -@@ -880,6 +883,7 @@ lex_string (const cpp_token *tok, tree * - case CPP_WSTRING: - case CPP_STRING16: - case CPP_STRING32: -+ case CPP_UTF8STRING: - if (type != tok->type) - { - if (type == CPP_STRING) -@@ -925,6 +929,7 @@ lex_string (const cpp_token *tok, tree * - { - default: - case CPP_STRING: -+ case CPP_UTF8STRING: - value = build_string (1, ""); - break; - case CPP_STRING16: -@@ -950,6 +955,7 @@ lex_string (const cpp_token *tok, tree * - { - default: - case CPP_STRING: -+ case CPP_UTF8STRING: - TREE_TYPE (value) = char_array_type_node; - break; - case CPP_STRING16: ---- gcc/c-parser.c.jj 2008-09-09 16:08:04.000000000 +0200 -+++ gcc/c-parser.c 2008-09-11 20:34:34.000000000 +0200 -@@ -5085,6 +5085,7 @@ c_parser_postfix_expression (c_parser *p - case CPP_STRING16: - case CPP_STRING32: - case CPP_WSTRING: -+ case CPP_UTF8STRING: - expr.value = c_parser_peek_token (parser)->value; - expr.original_code = STRING_CST; - c_parser_consume_token (parser); ---- gcc/cp/parser.c.jj 2008-09-09 16:08:03.000000000 +0200 -+++ gcc/cp/parser.c 2008-09-11 20:36:10.000000000 +0200 -@@ -797,6 +797,7 @@ cp_lexer_print_token (FILE * stream, cp_ - case CPP_STRING16: - case CPP_STRING32: - case CPP_WSTRING: -+ case CPP_UTF8STRING: - fprintf (stream, " \"%s\"", TREE_STRING_POINTER (token->u.value)); - break; - -@@ -2049,7 +2050,8 @@ cp_parser_is_string_literal (cp_token* t - return (token->type == CPP_STRING || - token->type == CPP_STRING16 || - token->type == CPP_STRING32 || -- token->type == CPP_WSTRING); -+ token->type == CPP_WSTRING || -+ token->type == CPP_UTF8STRING); - } - - /* Returns nonzero if TOKEN is the indicated KEYWORD. */ -@@ -2972,6 +2974,7 @@ cp_parser_string_literal (cp_parser *par - { - default: - case CPP_STRING: -+ case CPP_UTF8STRING: - TREE_TYPE (value) = char_array_type_node; - break; - case CPP_STRING16: -@@ -3195,6 +3198,7 @@ cp_parser_primary_expression (cp_parser - case CPP_STRING16: - case CPP_STRING32: - case CPP_WSTRING: -+ case CPP_UTF8STRING: - /* ??? Should wide strings be allowed when parser->translate_strings_p - is false (i.e. in attributes)? If not, we can kill the third - argument to cp_parser_string_literal. */ ---- gcc/testsuite/gcc.dg/raw-string-1.c.jj 2008-09-12 11:48:36.000000000 +0200 -+++ gcc/testsuite/gcc.dg/raw-string-1.c 2008-09-12 14:01:27.000000000 +0200 -@@ -0,0 +1,101 @@ -+/* { dg-do run } */ -+/* { dg-options "-std=gnu99" } */ -+ -+#include -+ -+typedef __CHAR16_TYPE__ char16_t; -+typedef __CHAR32_TYPE__ char32_t; -+ -+const char s0[] = R"[a\ -+\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb -+c]"; -+const char s1[] = "a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc"; -+const char s2[] = R"*|*[a\ -+b -+c]" -+c]*|" -+c]*|*"; -+const char s3[] = "ab\nc]\"\nc]*|\"\nc"; -+ -+const char t0[] = u8R"[a\ -+\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb -+c]"; -+const char t1[] = u8"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc"; -+const char t2[] = u8R"*|*[a\ -+b -+c]" -+c]*|" -+c]*|*"; -+const char t3[] = u8"ab\nc]\"\nc]*|\"\nc"; -+ -+const char16_t u0[] = uR"[a\ -+\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb -+c]"; -+const char16_t u1[] = u"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc"; -+const char16_t u2[] = uR"*|*[a\ -+b -+c]" -+c]*|" -+c]*|*"; -+const char16_t u3[] = u"ab\nc]\"\nc]*|\"\nc"; -+ -+const char32_t U0[] = UR"[a\ -+\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb -+c]"; -+const char32_t U1[] = U"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc"; -+const char32_t U2[] = UR"*|*[a\ -+b -+c]" -+c]*|" -+c]*|*"; -+const char32_t U3[] = U"ab\nc]\"\nc]*|\"\nc"; -+ -+const wchar_t L0[] = LR"[a\ -+\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb -+c]"; -+const wchar_t L1[] = L"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc"; -+const wchar_t L2[] = LR"*|*[a\ -+b -+c]" -+c]*|" -+c]*|*"; -+const wchar_t L3[] = L"ab\nc]\"\nc]*|\"\nc"; -+ -+int -+main (void) -+{ -+ if (sizeof (s0) != sizeof (s1) -+ || __builtin_memcmp (s0, s1, sizeof (s0)) != 0) -+ __builtin_abort (); -+ if (sizeof (s2) != sizeof (s3) -+ || __builtin_memcmp (s2, s3, sizeof (s2)) != 0) -+ __builtin_abort (); -+ if (sizeof (t0) != sizeof (t1) -+ || __builtin_memcmp (t0, t1, sizeof (t0)) != 0) -+ __builtin_abort (); -+ if (sizeof (t2) != sizeof (t3) -+ || __builtin_memcmp (t2, t3, sizeof (t2)) != 0) -+ __builtin_abort (); -+ if (sizeof (u0) != sizeof (u1) -+ || __builtin_memcmp (u0, u1, sizeof (u0)) != 0) -+ __builtin_abort (); -+ if (sizeof (u2) != sizeof (u3) -+ || __builtin_memcmp (u2, u3, sizeof (u2)) != 0) -+ __builtin_abort (); -+ if (sizeof (U0) != sizeof (U1) -+ || __builtin_memcmp (U0, U1, sizeof (U0)) != 0) -+ __builtin_abort (); -+ if (sizeof (U2) != sizeof (U3) -+ || __builtin_memcmp (U2, U3, sizeof (U2)) != 0) -+ __builtin_abort (); -+ if (sizeof (L0) != sizeof (L1) -+ || __builtin_memcmp (L0, L1, sizeof (L0)) != 0) -+ __builtin_abort (); -+ if (sizeof (L2) != sizeof (L3) -+ || __builtin_memcmp (L2, L3, sizeof (L2)) != 0) -+ __builtin_abort (); -+ if (sizeof (R"*[]*") != 1 -+ || __builtin_memcmp (R"*[]*", "", 1) != 0) -+ __builtin_abort (); -+ return 0; -+} ---- gcc/testsuite/gcc.dg/raw-string-2.c.jj 2008-09-12 12:14:42.000000000 +0200 -+++ gcc/testsuite/gcc.dg/raw-string-2.c 2008-09-12 13:37:10.000000000 +0200 -@@ -0,0 +1,109 @@ -+/* { dg-do run } */ -+/* { dg-options "-std=gnu99" } */ -+ -+#include -+ -+typedef __CHAR16_TYPE__ char16_t; -+typedef __CHAR32_TYPE__ char32_t; -+ -+#define R -+#define u -+#define uR -+#define U -+#define UR -+#define u8 -+#define u8R -+#define L -+#define LR -+ -+const char s00[] = R"[a]" "[b]"; -+const char s01[] = "[a]" R"*[b]*"; -+const char s02[] = R"[a]" R"[b]"; -+const char s03[] = R"-[a]-" u8"[b]"; -+const char s04[] = "[a]" u8R"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ"; -+const char s05[] = R"[a]" u8R"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL"; -+const char s06[] = u8R";([a];(" "[b]"; -+const char s07[] = u8"[a]" R"[b]"; -+const char s08[] = u8R"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-"; -+const char s09[] = u8R"/^&|~!=,"'\[a]/^&|~!=,"'\" u8"[b]"; -+const char s10[] = u8"[a]" u8R"0123456789abcdef[b]0123456789abcdef"; -+const char s11[] = u8R"ghijklmnopqrstuv[a]ghijklmnopqrstuv" u8R"w[b]w"; -+ -+const char16_t u03[] = R"-[a]-" u"[b]"; -+const char16_t u04[] = "[a]" uR"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ"; -+const char16_t u05[] = R"[a]" uR"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL"; -+const char16_t u06[] = uR";([a];(" "[b]"; -+const char16_t u07[] = u"[a]" R"[b]"; -+const char16_t u08[] = uR"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-"; -+const char16_t u09[] = uR"/^&|~!=,"'\[a]/^&|~!=,"'\" u"[b]"; -+const char16_t u10[] = u"[a]" uR"0123456789abcdef[b]0123456789abcdef"; -+const char16_t u11[] = uR"ghijklmnopqrstuv[a]ghijklmnopqrstuv" uR"w[b]w"; -+ -+const char32_t U03[] = R"-[a]-" U"[b]"; -+const char32_t U04[] = "[a]" UR"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ"; -+const char32_t U05[] = R"[a]" UR"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL"; -+const char32_t U06[] = UR";([a];(" "[b]"; -+const char32_t U07[] = U"[a]" R"[b]"; -+const char32_t U08[] = UR"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-"; -+const char32_t U09[] = UR"/^&|~!=,"'\[a]/^&|~!=,"'\" U"[b]"; -+const char32_t U10[] = U"[a]" UR"0123456789abcdef[b]0123456789abcdef"; -+const char32_t U11[] = UR"ghijklmnopqrstuv[a]ghijklmnopqrstuv" UR"w[b]w"; -+ -+const wchar_t L03[] = R"-[a]-" L"[b]"; -+const wchar_t L04[] = "[a]" LR"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ"; -+const wchar_t L05[] = R"[a]" LR"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL"; -+const wchar_t L06[] = LR";([a];(" "[b]"; -+const wchar_t L07[] = L"[a]" R"[b]"; -+const wchar_t L08[] = LR"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-"; -+const wchar_t L09[] = LR"/^&|~!=,"'\[a]/^&|~!=,"'\" L"[b]"; -+const wchar_t L10[] = L"[a]" LR"0123456789abcdef[b]0123456789abcdef"; -+const wchar_t L11[] = LR"ghijklmnopqrstuv[a]ghijklmnopqrstuv" LR"w[b]w"; -+ -+int -+main (void) -+{ -+#define TEST(str, val) \ -+ if (sizeof (str) != sizeof (val) \ -+ || __builtin_memcmp (str, val, sizeof (str)) != 0) \ -+ __builtin_abort () -+ TEST (s00, "a[b]"); -+ TEST (s01, "[a]b"); -+ TEST (s02, "ab"); -+ TEST (s03, "a[b]"); -+ TEST (s04, "[a]b"); -+ TEST (s05, "ab"); -+ TEST (s06, "a[b]"); -+ TEST (s07, "[a]b"); -+ TEST (s08, "ab"); -+ TEST (s09, "a[b]"); -+ TEST (s10, "[a]b"); -+ TEST (s11, "ab"); -+ TEST (u03, u"a[b]"); -+ TEST (u04, u"[a]b"); -+ TEST (u05, u"ab"); -+ TEST (u06, u"a[b]"); -+ TEST (u07, u"[a]b"); -+ TEST (u08, u"ab"); -+ TEST (u09, u"a[b]"); -+ TEST (u10, u"[a]b"); -+ TEST (u11, u"ab"); -+ TEST (U03, U"a[b]"); -+ TEST (U04, U"[a]b"); -+ TEST (U05, U"ab"); -+ TEST (U06, U"a[b]"); -+ TEST (U07, U"[a]b"); -+ TEST (U08, U"ab"); -+ TEST (U09, U"a[b]"); -+ TEST (U10, U"[a]b"); -+ TEST (U11, U"ab"); -+ TEST (L03, L"a[b]"); -+ TEST (L04, L"[a]b"); -+ TEST (L05, L"ab"); -+ TEST (L06, L"a[b]"); -+ TEST (L07, L"[a]b"); -+ TEST (L08, L"ab"); -+ TEST (L09, L"a[b]"); -+ TEST (L10, L"[a]b"); -+ TEST (L11, L"ab"); -+ return 0; -+} ---- gcc/testsuite/gcc.dg/raw-string-3.c.jj 2008-09-12 13:27:09.000000000 +0200 -+++ gcc/testsuite/gcc.dg/raw-string-3.c 2008-09-12 13:42:55.000000000 +0200 -@@ -0,0 +1,53 @@ -+/* If not gnu99, the {,u,u8,U,L}R prefix should be parsed as separate -+ token. */ -+/* { dg-do compile } */ -+/* { dg-options "" } */ -+ -+const void *s0 = R"[a]"; /* { dg-error "undeclared" } */ -+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 6 } */ -+const void *s1 = uR"[a]"; /* { dg-error "undeclared" } */ -+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 8 } */ -+const void *s2 = UR"[a]"; /* { dg-error "undeclared" } */ -+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 10 } */ -+const void *s3 = u8R"[a]"; /* { dg-error "undeclared" } */ -+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 12 } */ -+const void *s4 = LR"[a]"; /* { dg-error "undeclared" } */ -+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 14 } */ -+ -+const int i0 = R'a'; /* { dg-error "expected ',' or ';'" } */ -+const int i1 = uR'a'; /* { dg-error "expected ',' or ';'" } */ -+const int i2 = UR'a'; /* { dg-error "expected ',' or ';'" } */ -+const int i3 = u8R'a'; /* { dg-error "expected ',' or ';'" } */ -+const int i4 = LR'a'; /* { dg-error "expected ',' or ';'" } */ -+ -+#define R "a" -+#define uR "b" -+#define UR "c" -+#define u8R "d" -+#define LR "e" -+ -+const void *s5 = R"[a]"; -+const void *s6 = uR"[a]"; -+const void *s7 = UR"[a]"; -+const void *s8 = u8R"[a]"; -+const void *s9 = LR"[a]"; -+ -+#undef R -+#undef uR -+#undef UR -+#undef u8R -+#undef LR -+ -+#define R 1 + -+#define uR 2 + -+#define UR 3 + -+#define u8R 4 + -+#define LR 5 + -+ -+const int i5 = R'a'; -+const int i6 = uR'a'; -+const int i7 = UR'a'; -+const int i8 = u8R'a'; -+const int i9 = LR'a'; -+ -+int main () {} ---- gcc/testsuite/gcc.dg/raw-string-4.c.jj 2008-09-12 13:27:09.000000000 +0200 -+++ gcc/testsuite/gcc.dg/raw-string-4.c 2008-09-12 13:33:43.000000000 +0200 -@@ -0,0 +1,28 @@ -+/* R is not applicable for character literals. */ -+/* { dg-do compile } */ -+/* { dg-options "-std=gnu99" } */ -+ -+const int i0 = R'a'; /* { dg-error "undeclared" } */ -+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 5 } */ -+const int i1 = uR'a'; /* { dg-error "undeclared" } */ -+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 7 } */ -+const int i2 = UR'a'; /* { dg-error "undeclared" } */ -+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 9 } */ -+const int i3 = u8R'a'; /* { dg-error "undeclared" } */ -+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 11 } */ -+const int i4 = LR'a'; /* { dg-error "undeclared" } */ -+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 13 } */ -+ -+#define R 1 + -+#define uR 2 + -+#define UR 3 + -+#define u8R 4 + -+#define LR 5 + -+ -+const int i5 = R'a'; -+const int i6 = uR'a'; -+const int i7 = UR'a'; -+const int i8 = u8R'a'; -+const int i9 = LR'a'; -+ -+int main () {} ---- gcc/testsuite/gcc.dg/raw-string-5.c.jj 2008-09-12 13:49:58.000000000 +0200 -+++ gcc/testsuite/gcc.dg/raw-string-5.c 2008-09-12 13:59:14.000000000 +0200 -@@ -0,0 +1,23 @@ -+/* { dg-do compile } */ -+/* { dg-options "-std=gnu99" } */ -+ -+const void *s0 = R"0123456789abcdefg[]0123456789abcdefg"; -+ /* { dg-error "raw string delimiter longer" "" { target *-*-* } 4 } */ -+ /* { dg-error "stray" "" { target *-*-* } 4 } */ -+const void *s1 = R" [] "; -+ /* { dg-error "invalid character" "" { target *-*-* } 7 } */ -+ /* { dg-error "stray" "" { target *-*-* } 7 } */ -+const void *s2 = R" [] "; -+ /* { dg-error "invalid character" "" { target *-*-* } 10 } */ -+ /* { dg-error "stray" "" { target *-*-* } 10 } */ -+const void *s3 = R"][]]"; -+ /* { dg-error "invalid character" "" { target *-*-* } 13 } */ -+ /* { dg-error "stray" "" { target *-*-* } 13 } */ -+const void *s4 = R"@[]@"; -+ /* { dg-error "invalid character" "" { target *-*-* } 16 } */ -+ /* { dg-error "stray" "" { target *-*-* } 16 } */ -+const void *s5 = R"$[]$"; -+ /* { dg-error "invalid character" "" { target *-*-* } 19 } */ -+ /* { dg-error "stray" "" { target *-*-* } 19 } */ -+ -+int main () {} ---- gcc/testsuite/gcc.dg/raw-string-6.c.jj 2008-09-12 13:59:33.000000000 +0200 -+++ gcc/testsuite/gcc.dg/raw-string-6.c 2008-09-12 14:03:46.000000000 +0200 -@@ -0,0 +1,5 @@ -+/* { dg-do compile } */ -+/* { dg-options "-std=gnu99" } */ -+ -+const void *s0 = R"ouch[]ouCh"; /* { dg-error "expected expression at end of input" } */ -+ /* { dg-error "unterminated raw string" "" { target *-*-* } 6 } */ ---- gcc/testsuite/gcc.dg/raw-string-7.c.jj 2008-09-12 14:27:39.000000000 +0200 -+++ gcc/testsuite/gcc.dg/raw-string-7.c 2008-09-12 14:34:17.000000000 +0200 -@@ -0,0 +1,23 @@ -+/* The trailing whitespace after \ and before newline extension -+ breaks full compliance for raw strings. */ -+/* { dg-do run { xfail *-*-* } } */ -+/* { dg-options "-std=gnu99" } */ -+ -+/* Note, there is a single space after \ on the following line. */ -+const void *s0 = R"[\ -+]"; -+/* { dg-bogus "backslash and newline separated by space" "" { xfail *-*-* } 7 } */ -+ -+/* Note, there is a single tab after \ on the following line. */ -+const void *s1 = R"[\ -+]"; -+/* { dg-bogus "backslash and newline separated by space" "" { xfail *-*-* } 12 } */ -+ -+int -+main (void) -+{ -+ if (__builtin_strcmp (s0, "\\ \n") != 0 -+ || __builtin_strcmp (s1, "\\\t\n") != 0) -+ __builtin_abort (); -+ return 0; -+} ---- gcc/testsuite/gcc.dg/utf8-1.c.jj 2008-09-12 10:01:47.000000000 +0200 -+++ gcc/testsuite/gcc.dg/utf8-1.c 2008-09-12 11:45:48.000000000 +0200 -@@ -0,0 +1,45 @@ -+/* { dg-do run } */ -+/* { dg-require-iconv "ISO-8859-2" } */ -+/* { dg-options "-std=gnu99 -fexec-charset=ISO-8859-2" } */ -+ -+const char *str1 = "h\u00e1\U0000010Dky "; -+const char *str2 = "\u010d\u00E1rky\n"; -+const char *str3 = u8"h\u00e1\U0000010Dky "; -+const char *str4 = u8"\u010d\u00E1rky\n"; -+const char *str5 = "h\u00e1\U0000010Dky " "\u010d\u00E1rky\n"; -+const char *str6 = u8"h\u00e1\U0000010Dky " "\u010d\u00E1rky\n"; -+const char *str7 = "h\u00e1\U0000010Dky " u8"\u010d\u00E1rky\n"; -+#define u8 -+const char *str8 = u8"h\u00e1\U0000010Dky " u8"\u010d\u00E1rky\n"; -+ -+const char latin2_1[] = "\x68\xe1\xe8\x6b\x79\x20"; -+const char latin2_2[] = "\xe8\xe1\x72\x6b\x79\n"; -+const char utf8_1[] = "\x68\xc3\xa1\xc4\x8d\x6b\x79\x20"; -+const char utf8_2[] = "\xc4\x8d\xc3\xa1\x72\x6b\x79\n"; -+ -+int -+main (void) -+{ -+ if (__builtin_strcmp (str1, latin2_1) != 0 -+ || __builtin_strcmp (str2, latin2_2) != 0 -+ || __builtin_strcmp (str3, utf8_1) != 0 -+ || __builtin_strcmp (str4, utf8_2) != 0 -+ || __builtin_strncmp (str5, latin2_1, sizeof (latin2_1) - 1) != 0 -+ || __builtin_strcmp (str5 + sizeof (latin2_1) - 1, latin2_2) != 0 -+ || __builtin_strncmp (str6, utf8_1, sizeof (utf8_1) - 1) != 0 -+ || __builtin_strcmp (str6 + sizeof (utf8_1) - 1, utf8_2) != 0 -+ || __builtin_strncmp (str7, utf8_1, sizeof (utf8_1) - 1) != 0 -+ || __builtin_strcmp (str7 + sizeof (utf8_1) - 1, utf8_2) != 0 -+ || __builtin_strncmp (str8, utf8_1, sizeof (utf8_1) - 1) != 0 -+ || __builtin_strcmp (str8 + sizeof (utf8_1) - 1, utf8_2) != 0) -+ __builtin_abort (); -+ if (sizeof ("a" u8"b"[0]) != 1 -+ || sizeof (u8"a" "b"[0]) != 1 -+ || sizeof (u8"a" u8"b"[0]) != 1 -+ || sizeof ("a" "\u010d") != 3 -+ || sizeof ("a" u8"\u010d") != 4 -+ || sizeof (u8"a" "\u010d") != 4 -+ || sizeof (u8"a" "\u010d") != 4) -+ __builtin_abort (); -+ return 0; -+} ---- gcc/testsuite/gcc.dg/utf8-2.c.jj 2008-09-12 11:27:51.000000000 +0200 -+++ gcc/testsuite/gcc.dg/utf8-2.c 2008-09-12 11:36:48.000000000 +0200 -@@ -0,0 +1,26 @@ -+/* { dg-do compile } */ -+/* { dg-options "-std=gnu99" } */ -+ -+#include -+ -+typedef __CHAR16_TYPE__ char16_t; -+typedef __CHAR32_TYPE__ char32_t; -+ -+const char s0[] = u8"ab"; -+const char16_t s1[] = u8"ab"; /* { dg-error "from non-wide" } */ -+const char32_t s2[] = u8"ab"; /* { dg-error "from non-wide" } */ -+const wchar_t s3[] = u8"ab"; /* { dg-error "from non-wide" } */ -+ -+const char t0[0] = u8"ab"; /* { dg-warning "chars is too long" } */ -+const char t1[1] = u8"ab"; /* { dg-warning "chars is too long" } */ -+const char t2[2] = u8"ab"; -+const char t3[3] = u8"ab"; -+const char t4[4] = u8"ab"; -+ -+const char u0[0] = u8"\u2160."; /* { dg-warning "chars is too long" } */ -+const char u1[1] = u8"\u2160."; /* { dg-warning "chars is too long" } */ -+const char u2[2] = u8"\u2160."; /* { dg-warning "chars is too long" } */ -+const char u3[3] = u8"\u2160."; /* { dg-warning "chars is too long" } */ -+const char u4[4] = u8"\u2160."; -+const char u5[5] = u8"\u2160."; -+const char u6[6] = u8"\u2160."; ---- gcc/testsuite/gcc.dg/utf-badconcat2.c.jj 2008-09-12 11:28:26.000000000 +0200 -+++ gcc/testsuite/gcc.dg/utf-badconcat2.c 2008-09-12 11:30:53.000000000 +0200 -@@ -0,0 +1,15 @@ -+/* Test unsupported concatenation of UTF-8 string literals. */ -+/* { dg-do compile } */ -+/* { dg-options "-std=gnu99" } */ -+ -+void *s0 = u8"a" "b"; -+void *s1 = "a" u8"b"; -+void *s2 = u8"a" u8"b"; -+void *s3 = u8"a" u"b"; /* { dg-error "non-standard concatenation" } */ -+void *s4 = u"a" u8"b"; /* { dg-error "non-standard concatenation" } */ -+void *s5 = u8"a" U"b"; /* { dg-error "non-standard concatenation" } */ -+void *s6 = U"a" u8"b"; /* { dg-error "non-standard concatenation" } */ -+void *s7 = u8"a" L"b"; /* { dg-error "non-standard concatenation" } */ -+void *s8 = L"a" u8"b"; /* { dg-error "non-standard concatenation" } */ -+ -+int main () {} ---- gcc/testsuite/gcc.dg/utf-dflt2.c.jj 2008-09-12 11:32:03.000000000 +0200 -+++ gcc/testsuite/gcc.dg/utf-dflt2.c 2008-09-12 13:24:39.000000000 +0200 -@@ -0,0 +1,12 @@ -+/* If not gnu99, the u8 prefix should be parsed as separate tokens. */ -+/* { dg-do compile } */ -+/* { dg-options "" } */ -+ -+const void *s0 = u8"a"; /* { dg-error "undeclared" } */ -+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 5 } */ -+ -+#define u8 "a" -+ -+const void *s1 = u8"a"; -+ -+int main () {} ---- gcc/testsuite/g++.dg/ext/raw-string-1.C.jj 2008-09-12 11:48:36.000000000 +0200 -+++ gcc/testsuite/g++.dg/ext/raw-string-1.C 2008-09-12 14:18:07.000000000 +0200 -@@ -0,0 +1,96 @@ -+// { dg-do run } -+// { dg-options "-std=c++0x" } -+ -+const char s0[] = R"[a\ -+\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb -+c]"; -+const char s1[] = "a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc"; -+const char s2[] = R"*|*[a\ -+b -+c]" -+c]*|" -+c]*|*"; -+const char s3[] = "ab\nc]\"\nc]*|\"\nc"; -+ -+const char t0[] = u8R"[a\ -+\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb -+c]"; -+const char t1[] = u8"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc"; -+const char t2[] = u8R"*|*[a\ -+b -+c]" -+c]*|" -+c]*|*"; -+const char t3[] = u8"ab\nc]\"\nc]*|\"\nc"; -+ -+const char16_t u0[] = uR"[a\ -+\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb -+c]"; -+const char16_t u1[] = u"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc"; -+const char16_t u2[] = uR"*|*[a\ -+b -+c]" -+c]*|" -+c]*|*"; -+const char16_t u3[] = u"ab\nc]\"\nc]*|\"\nc"; -+ -+const char32_t U0[] = UR"[a\ -+\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb -+c]"; -+const char32_t U1[] = U"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc"; -+const char32_t U2[] = UR"*|*[a\ -+b -+c]" -+c]*|" -+c]*|*"; -+const char32_t U3[] = U"ab\nc]\"\nc]*|\"\nc"; -+ -+const wchar_t L0[] = LR"[a\ -+\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb -+c]"; -+const wchar_t L1[] = L"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc"; -+const wchar_t L2[] = LR"*|*[a\ -+b -+c]" -+c]*|" -+c]*|*"; -+const wchar_t L3[] = L"ab\nc]\"\nc]*|\"\nc"; -+ -+int -+main (void) -+{ -+ if (sizeof (s0) != sizeof (s1) -+ || __builtin_memcmp (s0, s1, sizeof (s0)) != 0) -+ __builtin_abort (); -+ if (sizeof (s2) != sizeof (s3) -+ || __builtin_memcmp (s2, s3, sizeof (s2)) != 0) -+ __builtin_abort (); -+ if (sizeof (t0) != sizeof (t1) -+ || __builtin_memcmp (t0, t1, sizeof (t0)) != 0) -+ __builtin_abort (); -+ if (sizeof (t2) != sizeof (t3) -+ || __builtin_memcmp (t2, t3, sizeof (t2)) != 0) -+ __builtin_abort (); -+ if (sizeof (u0) != sizeof (u1) -+ || __builtin_memcmp (u0, u1, sizeof (u0)) != 0) -+ __builtin_abort (); -+ if (sizeof (u2) != sizeof (u3) -+ || __builtin_memcmp (u2, u3, sizeof (u2)) != 0) -+ __builtin_abort (); -+ if (sizeof (U0) != sizeof (U1) -+ || __builtin_memcmp (U0, U1, sizeof (U0)) != 0) -+ __builtin_abort (); -+ if (sizeof (U2) != sizeof (U3) -+ || __builtin_memcmp (U2, U3, sizeof (U2)) != 0) -+ __builtin_abort (); -+ if (sizeof (L0) != sizeof (L1) -+ || __builtin_memcmp (L0, L1, sizeof (L0)) != 0) -+ __builtin_abort (); -+ if (sizeof (L2) != sizeof (L3) -+ || __builtin_memcmp (L2, L3, sizeof (L2)) != 0) -+ __builtin_abort (); -+ if (sizeof (R"*[]*") != 1 -+ || __builtin_memcmp (R"*[]*", "", 1) != 0) -+ __builtin_abort (); -+ return 0; -+} ---- gcc/testsuite/g++.dg/ext/raw-string-2.C.jj 2008-09-12 12:14:42.000000000 +0200 -+++ gcc/testsuite/g++.dg/ext/raw-string-2.C 2008-09-12 14:18:14.000000000 +0200 -@@ -0,0 +1,104 @@ -+// { dg-do run } -+// { dg-options "-std=c++0x" } -+ -+#define R -+#define u -+#define uR -+#define U -+#define UR -+#define u8 -+#define u8R -+#define L -+#define LR -+ -+const char s00[] = R"[a]" "[b]"; -+const char s01[] = "[a]" R"*[b]*"; -+const char s02[] = R"[a]" R"[b]"; -+const char s03[] = R"-[a]-" u8"[b]"; -+const char s04[] = "[a]" u8R"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ"; -+const char s05[] = R"[a]" u8R"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL"; -+const char s06[] = u8R";([a];(" "[b]"; -+const char s07[] = u8"[a]" R"[b]"; -+const char s08[] = u8R"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-"; -+const char s09[] = u8R"/^&|~!=,"'\[a]/^&|~!=,"'\" u8"[b]"; -+const char s10[] = u8"[a]" u8R"0123456789abcdef[b]0123456789abcdef"; -+const char s11[] = u8R"ghijklmnopqrstuv[a]ghijklmnopqrstuv" u8R"w[b]w"; -+ -+const char16_t u03[] = R"-[a]-" u"[b]"; -+const char16_t u04[] = "[a]" uR"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ"; -+const char16_t u05[] = R"[a]" uR"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL"; -+const char16_t u06[] = uR";([a];(" "[b]"; -+const char16_t u07[] = u"[a]" R"[b]"; -+const char16_t u08[] = uR"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-"; -+const char16_t u09[] = uR"/^&|~!=,"'\[a]/^&|~!=,"'\" u"[b]"; -+const char16_t u10[] = u"[a]" uR"0123456789abcdef[b]0123456789abcdef"; -+const char16_t u11[] = uR"ghijklmnopqrstuv[a]ghijklmnopqrstuv" uR"w[b]w"; -+ -+const char32_t U03[] = R"-[a]-" U"[b]"; -+const char32_t U04[] = "[a]" UR"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ"; -+const char32_t U05[] = R"[a]" UR"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL"; -+const char32_t U06[] = UR";([a];(" "[b]"; -+const char32_t U07[] = U"[a]" R"[b]"; -+const char32_t U08[] = UR"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-"; -+const char32_t U09[] = UR"/^&|~!=,"'\[a]/^&|~!=,"'\" U"[b]"; -+const char32_t U10[] = U"[a]" UR"0123456789abcdef[b]0123456789abcdef"; -+const char32_t U11[] = UR"ghijklmnopqrstuv[a]ghijklmnopqrstuv" UR"w[b]w"; -+ -+const wchar_t L03[] = R"-[a]-" L"[b]"; -+const wchar_t L04[] = "[a]" LR"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ"; -+const wchar_t L05[] = R"[a]" LR"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL"; -+const wchar_t L06[] = LR";([a];(" "[b]"; -+const wchar_t L07[] = L"[a]" R"[b]"; -+const wchar_t L08[] = LR"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-"; -+const wchar_t L09[] = LR"/^&|~!=,"'\[a]/^&|~!=,"'\" L"[b]"; -+const wchar_t L10[] = L"[a]" LR"0123456789abcdef[b]0123456789abcdef"; -+const wchar_t L11[] = LR"ghijklmnopqrstuv[a]ghijklmnopqrstuv" LR"w[b]w"; -+ -+int -+main (void) -+{ -+#define TEST(str, val) \ -+ if (sizeof (str) != sizeof (val) \ -+ || __builtin_memcmp (str, val, sizeof (str)) != 0) \ -+ __builtin_abort () -+ TEST (s00, "a[b]"); -+ TEST (s01, "[a]b"); -+ TEST (s02, "ab"); -+ TEST (s03, "a[b]"); -+ TEST (s04, "[a]b"); -+ TEST (s05, "ab"); -+ TEST (s06, "a[b]"); -+ TEST (s07, "[a]b"); -+ TEST (s08, "ab"); -+ TEST (s09, "a[b]"); -+ TEST (s10, "[a]b"); -+ TEST (s11, "ab"); -+ TEST (u03, u"a[b]"); -+ TEST (u04, u"[a]b"); -+ TEST (u05, u"ab"); -+ TEST (u06, u"a[b]"); -+ TEST (u07, u"[a]b"); -+ TEST (u08, u"ab"); -+ TEST (u09, u"a[b]"); -+ TEST (u10, u"[a]b"); -+ TEST (u11, u"ab"); -+ TEST (U03, U"a[b]"); -+ TEST (U04, U"[a]b"); -+ TEST (U05, U"ab"); -+ TEST (U06, U"a[b]"); -+ TEST (U07, U"[a]b"); -+ TEST (U08, U"ab"); -+ TEST (U09, U"a[b]"); -+ TEST (U10, U"[a]b"); -+ TEST (U11, U"ab"); -+ TEST (L03, L"a[b]"); -+ TEST (L04, L"[a]b"); -+ TEST (L05, L"ab"); -+ TEST (L06, L"a[b]"); -+ TEST (L07, L"[a]b"); -+ TEST (L08, L"ab"); -+ TEST (L09, L"a[b]"); -+ TEST (L10, L"[a]b"); -+ TEST (L11, L"ab"); -+ return 0; -+} ---- gcc/testsuite/g++.dg/ext/raw-string-3.C.jj 2008-09-12 13:27:09.000000000 +0200 -+++ gcc/testsuite/g++.dg/ext/raw-string-3.C 2008-09-12 14:17:57.000000000 +0200 -@@ -0,0 +1,58 @@ -+// If c++98, the {,u,u8,U,L}R prefix should be parsed as separate -+// token. -+// { dg-do compile } -+// { dg-options "-std=c++98" } -+ -+const void *s0 = R"[a]"; // { dg-error "was not declared" } -+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 6 } -+const void *s1 = uR"[a]"; // { dg-error "was not declared" } -+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 8 } -+const void *s2 = UR"[a]"; // { dg-error "was not declared" } -+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 10 } -+const void *s3 = u8R"[a]"; // { dg-error "was not declared" } -+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 12 } -+const void *s4 = LR"[a]"; // { dg-error "was not declared" } -+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 14 } -+ -+const int i0 = R'a'; // { dg-error "was not declared" } -+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 17 } -+const int i1 = uR'a'; // { dg-error "was not declared" } -+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 19 } -+const int i2 = UR'a'; // { dg-error "was not declared" } -+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 21 } -+const int i3 = u8R'a'; // { dg-error "was not declared" } -+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 23 } -+const int i4 = LR'a'; // { dg-error "was not declared" } -+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 25 } -+ -+#define R "a" -+#define uR "b" -+#define UR "c" -+#define u8R "d" -+#define LR "e" -+ -+const void *s5 = R"[a]"; -+const void *s6 = uR"[a]"; -+const void *s7 = UR"[a]"; -+const void *s8 = u8R"[a]"; -+const void *s9 = LR"[a]"; -+ -+#undef R -+#undef uR -+#undef UR -+#undef u8R -+#undef LR -+ -+#define R 1 + -+#define uR 2 + -+#define UR 3 + -+#define u8R 4 + -+#define LR 5 + -+ -+const int i5 = R'a'; -+const int i6 = uR'a'; -+const int i7 = UR'a'; -+const int i8 = u8R'a'; -+const int i9 = LR'a'; -+ -+int main () {} ---- gcc/testsuite/g++.dg/ext/raw-string-4.C.jj 2008-09-12 13:27:09.000000000 +0200 -+++ gcc/testsuite/g++.dg/ext/raw-string-4.C 2008-09-12 14:18:23.000000000 +0200 -@@ -0,0 +1,28 @@ -+// R is not applicable for character literals. -+// { dg-do compile } -+// { dg-options "-std=c++0x" } -+ -+const int i0 = R'a'; // { dg-error "was not declared" } -+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 5 } -+const int i1 = uR'a'; // { dg-error "was not declared" } -+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 7 } -+const int i2 = UR'a'; // { dg-error "was not declared" } -+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 9 } -+const int i3 = u8R'a'; // { dg-error "was not declared" } -+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 11 } -+const int i4 = LR'a'; // { dg-error "was not declared" } -+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 13 } -+ -+#define R 1 + -+#define uR 2 + -+#define UR 3 + -+#define u8R 4 + -+#define LR 5 + -+ -+const int i5 = R'a'; -+const int i6 = uR'a'; -+const int i7 = UR'a'; -+const int i8 = u8R'a'; -+const int i9 = LR'a'; -+ -+int main () {} ---- gcc/testsuite/g++.dg/ext/raw-string-5.C.jj 2008-09-12 13:49:58.000000000 +0200 -+++ gcc/testsuite/g++.dg/ext/raw-string-5.C 2008-09-12 14:18:32.000000000 +0200 -@@ -0,0 +1,23 @@ -+// { dg-do compile } -+// { dg-options "-std=c++0x" } -+ -+const void *s0 = R"0123456789abcdefg[]0123456789abcdefg"; -+ // { dg-error "raw string delimiter longer" "" { target *-*-* } 4 } -+ // { dg-error "stray" "" { target *-*-* } 4 } -+const void *s1 = R" [] "; -+ // { dg-error "invalid character" "" { target *-*-* } 7 } -+ // { dg-error "stray" "" { target *-*-* } 7 } -+const void *s2 = R" [] "; -+ // { dg-error "invalid character" "" { target *-*-* } 10 } -+ // { dg-error "stray" "" { target *-*-* } 10 } -+const void *s3 = R"][]]"; -+ // { dg-error "invalid character" "" { target *-*-* } 13 } -+ // { dg-error "stray" "" { target *-*-* } 13 } -+const void *s4 = R"@[]@"; -+ // { dg-error "invalid character" "" { target *-*-* } 16 } -+ // { dg-error "stray" "" { target *-*-* } 16 } -+const void *s5 = R"$[]$"; -+ // { dg-error "invalid character" "" { target *-*-* } 19 } -+ // { dg-error "stray" "" { target *-*-* } 19 } -+ -+int main () {} ---- gcc/testsuite/g++.dg/ext/raw-string-6.C.jj 2008-09-12 13:59:33.000000000 +0200 -+++ gcc/testsuite/g++.dg/ext/raw-string-6.C 2008-09-12 14:20:21.000000000 +0200 -@@ -0,0 +1,5 @@ -+// { dg-do compile } -+// { dg-options "-std=c++0x" } -+ -+const void *s0 = R"ouch[]ouCh"; // { dg-error "at end of input" } -+ // { dg-error "unterminated raw string" "" { target *-*-* } 6 } ---- gcc/testsuite/g++.dg/ext/raw-string-7.C.jj 2008-09-12 14:34:54.000000000 +0200 -+++ gcc/testsuite/g++.dg/ext/raw-string-7.C 2008-09-12 14:36:40.000000000 +0200 -@@ -0,0 +1,23 @@ -+// The trailing whitespace after \ and before newline extension -+// breaks full compliance for raw strings. -+// { dg-do run { xfail *-*-* } } -+// { dg-options "-std=c++0x" } -+ -+// Note, there is a single space after \ on the following line. -+const char *s0 = R"[\ -+]"; -+// { dg-bogus "backslash and newline separated by space" "" { xfail *-*-* } 7 } -+ -+// Note, there is a single tab after \ on the following line. -+const char *s1 = R"[\ -+]"; -+// { dg-bogus "backslash and newline separated by space" "" { xfail *-*-* } 12 } -+ -+int -+main (void) -+{ -+ if (__builtin_strcmp (s0, "\\ \n") != 0 -+ || __builtin_strcmp (s1, "\\\t\n") != 0) -+ __builtin_abort (); -+ return 0; -+} ---- gcc/testsuite/g++.dg/ext/utf8-1.C.jj 2008-09-12 10:01:47.000000000 +0200 -+++ gcc/testsuite/g++.dg/ext/utf8-1.C 2008-09-12 14:18:53.000000000 +0200 -@@ -0,0 +1,45 @@ -+// { dg-do run } -+// { dg-require-iconv "ISO-8859-2" } -+// { dg-options "-std=c++0x -fexec-charset=ISO-8859-2" } -+ -+const char *str1 = "h\u00e1\U0000010Dky "; -+const char *str2 = "\u010d\u00E1rky\n"; -+const char *str3 = u8"h\u00e1\U0000010Dky "; -+const char *str4 = u8"\u010d\u00E1rky\n"; -+const char *str5 = "h\u00e1\U0000010Dky " "\u010d\u00E1rky\n"; -+const char *str6 = u8"h\u00e1\U0000010Dky " "\u010d\u00E1rky\n"; -+const char *str7 = "h\u00e1\U0000010Dky " u8"\u010d\u00E1rky\n"; -+#define u8 -+const char *str8 = u8"h\u00e1\U0000010Dky " u8"\u010d\u00E1rky\n"; -+ -+const char latin2_1[] = "\x68\xe1\xe8\x6b\x79\x20"; -+const char latin2_2[] = "\xe8\xe1\x72\x6b\x79\n"; -+const char utf8_1[] = "\x68\xc3\xa1\xc4\x8d\x6b\x79\x20"; -+const char utf8_2[] = "\xc4\x8d\xc3\xa1\x72\x6b\x79\n"; -+ -+int -+main (void) -+{ -+ if (__builtin_strcmp (str1, latin2_1) != 0 -+ || __builtin_strcmp (str2, latin2_2) != 0 -+ || __builtin_strcmp (str3, utf8_1) != 0 -+ || __builtin_strcmp (str4, utf8_2) != 0 -+ || __builtin_strncmp (str5, latin2_1, sizeof (latin2_1) - 1) != 0 -+ || __builtin_strcmp (str5 + sizeof (latin2_1) - 1, latin2_2) != 0 -+ || __builtin_strncmp (str6, utf8_1, sizeof (utf8_1) - 1) != 0 -+ || __builtin_strcmp (str6 + sizeof (utf8_1) - 1, utf8_2) != 0 -+ || __builtin_strncmp (str7, utf8_1, sizeof (utf8_1) - 1) != 0 -+ || __builtin_strcmp (str7 + sizeof (utf8_1) - 1, utf8_2) != 0 -+ || __builtin_strncmp (str8, utf8_1, sizeof (utf8_1) - 1) != 0 -+ || __builtin_strcmp (str8 + sizeof (utf8_1) - 1, utf8_2) != 0) -+ __builtin_abort (); -+ if (sizeof ("a" u8"b"[0]) != 1 -+ || sizeof (u8"a" "b"[0]) != 1 -+ || sizeof (u8"a" u8"b"[0]) != 1 -+ || sizeof ("a" "\u010d") != 3 -+ || sizeof ("a" u8"\u010d") != 4 -+ || sizeof (u8"a" "\u010d") != 4 -+ || sizeof (u8"a" "\u010d") != 4) -+ __builtin_abort (); -+ return 0; -+} ---- gcc/testsuite/g++.dg/ext/utf8-2.C.jj 2008-09-12 11:27:51.000000000 +0200 -+++ gcc/testsuite/g++.dg/ext/utf8-2.C 2008-09-12 14:19:01.000000000 +0200 -@@ -0,0 +1,21 @@ -+// { dg-do compile } -+// { dg-options "-std=c++0x" } -+ -+const char s0[] = u8"ab"; -+const char16_t s1[] = u8"ab"; // { dg-error "from non-wide" } -+const char32_t s2[] = u8"ab"; // { dg-error "from non-wide" } -+const wchar_t s3[] = u8"ab"; // { dg-error "from non-wide" } -+ -+const char t0[0] = u8"ab"; // { dg-error "chars is too long" } -+const char t1[1] = u8"ab"; // { dg-error "chars is too long" } -+const char t2[2] = u8"ab"; // { dg-error "chars is too long" } -+const char t3[3] = u8"ab"; -+const char t4[4] = u8"ab"; -+ -+const char u0[0] = u8"\u2160."; // { dg-error "chars is too long" } -+const char u1[1] = u8"\u2160."; // { dg-error "chars is too long" } -+const char u2[2] = u8"\u2160."; // { dg-error "chars is too long" } -+const char u3[3] = u8"\u2160."; // { dg-error "chars is too long" } -+const char u4[4] = u8"\u2160."; // { dg-error "chars is too long" } -+const char u5[5] = u8"\u2160."; -+const char u6[6] = u8"\u2160."; ---- gcc/testsuite/g++.dg/ext/utf-badconcat2.C.jj 2008-09-12 11:28:26.000000000 +0200 -+++ gcc/testsuite/g++.dg/ext/utf-badconcat2.C 2008-09-12 14:19:17.000000000 +0200 -@@ -0,0 +1,15 @@ -+// Test unsupported concatenation of UTF-8 string literals. -+// { dg-do compile } -+// { dg-options "-std=c++0x" } -+ -+const void *s0 = u8"a" "b"; -+const void *s1 = "a" u8"b"; -+const void *s2 = u8"a" u8"b"; -+const void *s3 = u8"a" u"b"; // { dg-error "non-standard concatenation" } -+const void *s4 = u"a" u8"b"; // { dg-error "non-standard concatenation" } -+const void *s5 = u8"a" U"b"; // { dg-error "non-standard concatenation" } -+const void *s6 = U"a" u8"b"; // { dg-error "non-standard concatenation" } -+const void *s7 = u8"a" L"b"; // { dg-error "non-standard concatenation" } -+const void *s8 = L"a" u8"b"; // { dg-error "non-standard concatenation" } -+ -+int main () {} ---- gcc/testsuite/g++.dg/ext/utf-dflt2.C.jj 2008-09-12 11:32:03.000000000 +0200 -+++ gcc/testsuite/g++.dg/ext/utf-dflt2.C 2008-09-12 14:19:28.000000000 +0200 -@@ -0,0 +1,12 @@ -+// In C++0x, the u8 prefix should be parsed as separate tokens. -+// { dg-do compile } -+// { dg-options "-std=c++98" } -+ -+const void *s0 = u8"a"; // { dg-error "was not declared" } -+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 5 } -+ -+#define u8 "a" -+ -+const void *s1 = u8"a"; -+ -+int main () {} diff --git a/gcc44-rh503816-1.patch b/gcc44-rh503816-1.patch deleted file mode 100644 index 7516f85..0000000 --- a/gcc44-rh503816-1.patch +++ /dev/null @@ -1,827 +0,0 @@ -2009-06-21 Jakub Jelinek - - * var-tracking.c (struct shared_hash_def, shared_hash): New types. - (dataflow_set): Change vars type from htab_t to shared_hash. - (shared_hash_pool, empty_shared_hash): New variables. - (vars_clear): Removed. - (shared_hash_shared, shared_hash_htab, shared_hash_copy, - shared_hash_find_slot_unshare, shared_hash_find_slot, - shared_hash_find_slot_noinsert, shared_hash_find): New - static inlines. - (shared_hash_unshare, shared_hash_destroy): New functions. - (unshare_variable): Unshare set->vars if shared, use - shared_hash_htab. - (vars_copy): Use htab_traverse_noresize instead of htab_traverse. - (get_init_value, find_src_set_src, dump_dataflow_set, - clobber_variable_part, emit_notes_for_differences): Use - shared_hash_htab. - (dataflow_set_init): Remove second argument, set vars to - empty_shared_hash instead of creating a new htab. - (dataflow_set_clear): Call shared_hash_destroy and set vars - to empty_shared_hash instead of calling vars_clear. - (dataflow_set_copy): Don't call vars_copy, instead just share - the src htab with dst. - (variable_union): Use shared_hash_*, use initially NO_INSERT - lookup if set->vars is shared. Don't keep slot cleared before - calling unshare_variable. Unshare set->vars if needed. - Even ->refcount == 1 vars must be unshared if set->vars is shared - and var needs to be modified. - (variable_canonicalize): New function. - (dataflow_set_union): If dst->vars is empty, just share src->vars - with dst->vars and traverse with variable_canonicalize to canonicalize - and unshare what is needed. - (dataflow_set_different): If old_set and new_set use the same shared - htab, they aren't different. If number of htab elements is different, - htabs are different. Use shared_hash_*. - (dataflow_set_destroy): Call shared_hash_destroy instead of - htab_delete. - (compute_bb_dataflow, emit_notes_in_bb, vt_emit_notes): Don't pass - second argument to dataflow_set_init. - (vt_initialize): Likewise. Initialize shared_hash_pool and - empty_shared_hash, move bb in/out initialization afterwards. - Use variable_htab_free instead of NULL as changed_variables del hook. - (variable_was_changed): Change type of second argument to pointer to - dataflow_set. When inserting var into changed_variables, bump - refcount. Unshare set->vars if set is shared htab and slot needs to - be cleared. - (set_variable_part): Use shared_hash_*, use initially NO_INSERT - lookup if set->vars is shared. Unshare set->vars if needed. - Even ->refcount == 1 vars must be unshared if set->vars is shared - and var needs to be modified. Adjust variable_was_changed caller. - (delete_variable_part): Use shared_hash_*. Even ->refcount == 1 - vars must be unshared if set->vars is shared and var needs to be - modified. Adjust variable_was_changed caller. - (emit_note_insn_var_location): Don't pool_free var. - (emit_notes_for_differences_1): Initialize empty_var->refcount to 0 - instead of 1. - (vt_finalize): Call htab_delete on empty_shared_hash->htab and - free_alloc_pool on shared_hash_pool. - - * hashtab.c (htab_traverse): Don't call htab_expand for - nearly empty hashtabs with sizes 7, 13 or 31. - ---- gcc/var-tracking.c (revision 148758) -+++ gcc/var-tracking.c (revision 148760) -@@ -182,6 +182,17 @@ typedef struct attrs_def - HOST_WIDE_INT offset; - } *attrs; - -+/* Structure holding a refcounted hash table. If refcount > 1, -+ it must be first unshared before modified. */ -+typedef struct shared_hash_def -+{ -+ /* Reference count. */ -+ int refcount; -+ -+ /* Actual hash table. */ -+ htab_t htab; -+} *shared_hash; -+ - /* Structure holding the IN or OUT set for a basic block. */ - typedef struct dataflow_set_def - { -@@ -192,7 +203,7 @@ typedef struct dataflow_set_def - attrs regs[FIRST_PSEUDO_REGISTER]; - - /* Variable locations. */ -- htab_t vars; -+ shared_hash vars; - } dataflow_set; - - /* The structure (one for each basic block) containing the information -@@ -280,12 +291,18 @@ static alloc_pool var_pool; - /* Alloc pool for struct location_chain_def. */ - static alloc_pool loc_chain_pool; - -+/* Alloc pool for struct shared_hash_def. */ -+static alloc_pool shared_hash_pool; -+ - /* Changed variables, notes will be emitted for them. */ - static htab_t changed_variables; - - /* Shall notes be emitted? */ - static bool emit_notes; - -+/* Empty shared hashtable. */ -+static shared_hash empty_shared_hash; -+ - /* Local function prototypes. */ - static void stack_adjust_offset_pre_post (rtx, HOST_WIDE_INT *, - HOST_WIDE_INT *); -@@ -305,7 +322,6 @@ static void attrs_list_insert (attrs *, - static void attrs_list_copy (attrs *, attrs); - static void attrs_list_union (attrs *, attrs); - --static void vars_clear (htab_t); - static variable unshare_variable (dataflow_set *set, variable var, - enum var_init_status); - static int vars_copy_1 (void **, void *); -@@ -321,11 +337,12 @@ static void var_mem_delete_and_set (data - enum var_init_status, rtx); - static void var_mem_delete (dataflow_set *, rtx, bool); - --static void dataflow_set_init (dataflow_set *, int); -+static void dataflow_set_init (dataflow_set *); - static void dataflow_set_clear (dataflow_set *); - static void dataflow_set_copy (dataflow_set *, dataflow_set *); - static int variable_union_info_cmp_pos (const void *, const void *); - static int variable_union (void **, void *); -+static int variable_canonicalize (void **, void *); - static void dataflow_set_union (dataflow_set *, dataflow_set *); - static bool variable_part_different_p (variable_part *, variable_part *); - static bool variable_different_p (variable, variable, bool); -@@ -352,7 +369,7 @@ static void dump_vars (htab_t); - static void dump_dataflow_set (dataflow_set *); - static void dump_dataflow_sets (void); - --static void variable_was_changed (variable, htab_t); -+static void variable_was_changed (variable, dataflow_set *); - static void set_variable_part (dataflow_set *, rtx, tree, HOST_WIDE_INT, - enum var_init_status, rtx); - static void clobber_variable_part (dataflow_set *, rtx, tree, HOST_WIDE_INT, -@@ -742,12 +759,107 @@ attrs_list_union (attrs *dstp, attrs src - } - } - --/* Delete all variables from hash table VARS. */ -+/* Shared hashtable support. */ -+ -+/* Return true if VARS is shared. */ -+ -+static inline bool -+shared_hash_shared (shared_hash vars) -+{ -+ return vars->refcount > 1; -+} -+ -+/* Return the hash table for VARS. */ -+ -+static inline htab_t -+shared_hash_htab (shared_hash vars) -+{ -+ return vars->htab; -+} -+ -+/* Copy variables into a new hash table. */ -+ -+static shared_hash -+shared_hash_unshare (shared_hash vars) -+{ -+ shared_hash new_vars = (shared_hash) pool_alloc (shared_hash_pool); -+ gcc_assert (vars->refcount > 1); -+ new_vars->refcount = 1; -+ new_vars->htab -+ = htab_create (htab_elements (vars->htab) + 3, variable_htab_hash, -+ variable_htab_eq, variable_htab_free); -+ vars_copy (new_vars->htab, vars->htab); -+ vars->refcount--; -+ return new_vars; -+} -+ -+/* Increment reference counter on VARS and return it. */ -+ -+static inline shared_hash -+shared_hash_copy (shared_hash vars) -+{ -+ vars->refcount++; -+ return vars; -+} -+ -+/* Decrement reference counter and destroy hash table if not shared -+ anymore. */ - - static void --vars_clear (htab_t vars) -+shared_hash_destroy (shared_hash vars) - { -- htab_empty (vars); -+ gcc_assert (vars->refcount > 0); -+ if (--vars->refcount == 0) -+ { -+ htab_delete (vars->htab); -+ pool_free (shared_hash_pool, vars); -+ } -+} -+ -+/* Unshare *PVARS if shared and return slot for DECL. If INS is -+ INSERT, insert it if not already present. */ -+ -+static inline void ** -+shared_hash_find_slot_unshare (shared_hash *pvars, tree decl, -+ enum insert_option ins) -+{ -+ if (shared_hash_shared (*pvars)) -+ *pvars = shared_hash_unshare (*pvars); -+ return htab_find_slot_with_hash (shared_hash_htab (*pvars), decl, -+ VARIABLE_HASH_VAL (decl), ins); -+} -+ -+/* Return slot for DECL, if it is already present in the hash table. -+ If it is not present, insert it only VARS is not shared, otherwise -+ return NULL. */ -+ -+static inline void ** -+shared_hash_find_slot (shared_hash vars, tree decl) -+{ -+ return htab_find_slot_with_hash (shared_hash_htab (vars), decl, -+ VARIABLE_HASH_VAL (decl), -+ shared_hash_shared (vars) -+ ? NO_INSERT : INSERT); -+} -+ -+/* Return slot for DECL only if it is already present in the hash table. */ -+ -+static inline void ** -+shared_hash_find_slot_noinsert (shared_hash vars, tree decl) -+{ -+ return htab_find_slot_with_hash (shared_hash_htab (vars), decl, -+ VARIABLE_HASH_VAL (decl), NO_INSERT); -+} -+ -+/* Return variable for DECL or NULL if not already present in the hash -+ table. */ -+ -+static inline variable -+shared_hash_find (shared_hash vars, tree decl) -+{ -+ return (variable) -+ htab_find_with_hash (shared_hash_htab (vars), decl, -+ VARIABLE_HASH_VAL (decl)); - } - - /* Return a copy of a variable VAR and insert it to dataflow set SET. */ -@@ -801,9 +913,7 @@ unshare_variable (dataflow_set *set, var - new_var->var_part[i].cur_loc = NULL; - } - -- slot = htab_find_slot_with_hash (set->vars, new_var->decl, -- VARIABLE_HASH_VAL (new_var->decl), -- INSERT); -+ slot = shared_hash_find_slot_unshare (&set->vars, new_var->decl, INSERT); - *slot = new_var; - return new_var; - } -@@ -834,8 +944,7 @@ vars_copy_1 (void **slot, void *data) - static void - vars_copy (htab_t dst, htab_t src) - { -- vars_clear (dst); -- htab_traverse (src, vars_copy_1, dst); -+ htab_traverse_noresize (src, vars_copy_1, dst); - } - - /* Map a decl to its main debug decl. */ -@@ -874,7 +983,6 @@ var_reg_set (dataflow_set *set, rtx loc, - static int - get_init_value (dataflow_set *set, rtx loc, tree decl) - { -- void **slot; - variable var; - int i; - int ret_val = VAR_INIT_STATUS_UNKNOWN; -@@ -882,11 +990,9 @@ get_init_value (dataflow_set *set, rtx l - if (! flag_var_tracking_uninit) - return VAR_INIT_STATUS_INITIALIZED; - -- slot = htab_find_slot_with_hash (set->vars, decl, VARIABLE_HASH_VAL (decl), -- NO_INSERT); -- if (slot) -+ var = shared_hash_find (set->vars, decl); -+ if (var) - { -- var = * (variable *) slot; - for (i = 0; i < var->n_var_parts && ret_val == VAR_INIT_STATUS_UNKNOWN; i++) - { - location_chain nextp; -@@ -1050,11 +1156,10 @@ var_mem_delete (dataflow_set *set, rtx l - VARS_SIZE is the initial size of hash table VARS. */ - - static void --dataflow_set_init (dataflow_set *set, int vars_size) -+dataflow_set_init (dataflow_set *set) - { - init_attrs_list_set (set->regs); -- set->vars = htab_create (vars_size, variable_htab_hash, variable_htab_eq, -- variable_htab_free); -+ set->vars = shared_hash_copy (empty_shared_hash); - set->stack_adjust = 0; - } - -@@ -1068,7 +1173,8 @@ dataflow_set_clear (dataflow_set *set) - for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) - attrs_list_clear (&set->regs[i]); - -- vars_clear (set->vars); -+ shared_hash_destroy (set->vars); -+ set->vars = shared_hash_copy (empty_shared_hash); - } - - /* Copy the contents of dataflow set SRC to DST. */ -@@ -1081,7 +1187,8 @@ dataflow_set_copy (dataflow_set *dst, da - for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) - attrs_list_copy (&dst->regs[i], src->regs[i]); - -- vars_copy (dst->vars, src->vars); -+ shared_hash_destroy (dst->vars); -+ dst->vars = shared_hash_copy (src->vars); - dst->stack_adjust = src->stack_adjust; - } - -@@ -1129,15 +1236,14 @@ variable_union_info_cmp_pos (const void - static int - variable_union (void **slot, void *data) - { -- variable src, dst, *dstp; -+ variable src, dst; -+ void **dstp; - dataflow_set *set = (dataflow_set *) data; - int i, j, k; - - src = *(variable *) slot; -- dstp = (variable *) htab_find_slot_with_hash (set->vars, src->decl, -- VARIABLE_HASH_VAL (src->decl), -- INSERT); -- if (!*dstp) -+ dstp = shared_hash_find_slot (set->vars, src->decl); -+ if (!dstp || !*dstp) - { - src->refcount++; - -@@ -1162,16 +1268,23 @@ variable_union (void **slot, void *data) - if (! flag_var_tracking_uninit) - status = VAR_INIT_STATUS_INITIALIZED; - -+ if (dstp) -+ *dstp = (void *) src; - unshare_variable (set, src, status); - } - else -- *dstp = src; -+ { -+ if (!dstp) -+ dstp = shared_hash_find_slot_unshare (&set->vars, src->decl, -+ INSERT); -+ *dstp = (void *) src; -+ } - - /* Continue traversing the hash table. */ - return 1; - } - else -- dst = *dstp; -+ dst = (variable) *dstp; - - gcc_assert (src->n_var_parts); - -@@ -1196,7 +1309,8 @@ variable_union (void **slot, void *data) - thus there are at most MAX_VAR_PARTS different offsets. */ - gcc_assert (k <= MAX_VAR_PARTS); - -- if (dst->refcount > 1 && dst->n_var_parts != k) -+ if ((dst->refcount > 1 || shared_hash_shared (set->vars)) -+ && dst->n_var_parts != k) - { - enum var_init_status status = VAR_INIT_STATUS_UNKNOWN; - -@@ -1226,7 +1340,7 @@ variable_union (void **slot, void *data) - /* If DST is shared compare the location chains. - If they are different we will modify the chain in DST with - high probability so make a copy of DST. */ -- if (dst->refcount > 1) -+ if (dst->refcount > 1 || shared_hash_shared (set->vars)) - { - for (node = src->var_part[i].loc_chain, - node2 = dst->var_part[j].loc_chain; node && node2; -@@ -1379,6 +1493,46 @@ variable_union (void **slot, void *data) - return 1; - } - -+/* Like variable_union, but only used when doing dataflow_set_union -+ into an empty hashtab. To allow sharing, dst is initially shared -+ with src (so all variables are "copied" from src to dst hashtab), -+ so only unshare_variable for variables that need canonicalization -+ are needed. */ -+ -+static int -+variable_canonicalize (void **slot, void *data) -+{ -+ variable src; -+ dataflow_set *set = (dataflow_set *) data; -+ int k; -+ -+ src = *(variable *) slot; -+ -+ /* If CUR_LOC of some variable part is not the first element of -+ the location chain we are going to change it so we have to make -+ a copy of the variable. */ -+ for (k = 0; k < src->n_var_parts; k++) -+ { -+ gcc_assert (!src->var_part[k].loc_chain == !src->var_part[k].cur_loc); -+ if (src->var_part[k].loc_chain) -+ { -+ gcc_assert (src->var_part[k].cur_loc); -+ if (src->var_part[k].cur_loc != src->var_part[k].loc_chain->loc) -+ break; -+ } -+ } -+ if (k < src->n_var_parts) -+ { -+ enum var_init_status status = VAR_INIT_STATUS_UNKNOWN; -+ -+ if (! flag_var_tracking_uninit) -+ status = VAR_INIT_STATUS_INITIALIZED; -+ -+ unshare_variable (set, src, status); -+ } -+ return 1; -+} -+ - /* Compute union of dataflow sets SRC and DST and store it to DST. */ - - static void -@@ -1389,7 +1543,14 @@ dataflow_set_union (dataflow_set *dst, d - for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) - attrs_list_union (&dst->regs[i], src->regs[i]); - -- htab_traverse (src->vars, variable_union, dst); -+ if (dst->vars == empty_shared_hash) -+ { -+ shared_hash_destroy (dst->vars); -+ dst->vars = shared_hash_copy (src->vars); -+ htab_traverse (shared_hash_htab (src->vars), variable_canonicalize, dst); -+ } -+ else -+ htab_traverse (shared_hash_htab (src->vars), variable_union, dst); - } - - /* Flag whether two dataflow sets being compared contain different data. */ -@@ -1522,15 +1683,24 @@ dataflow_set_different_2 (void **slot, v - static bool - dataflow_set_different (dataflow_set *old_set, dataflow_set *new_set) - { -+ if (old_set->vars == new_set->vars) -+ return false; -+ -+ if (htab_elements (shared_hash_htab (old_set->vars)) -+ != htab_elements (shared_hash_htab (new_set->vars))) -+ return true; -+ - dataflow_set_different_value = false; - -- htab_traverse (old_set->vars, dataflow_set_different_1, new_set->vars); -+ htab_traverse (shared_hash_htab (old_set->vars), dataflow_set_different_1, -+ shared_hash_htab (new_set->vars)); - if (!dataflow_set_different_value) - { - /* We have compared the variables which are in both hash tables - so now only check whether there are some variables in NEW_SET->VARS - which are not in OLD_SET->VARS. */ -- htab_traverse (new_set->vars, dataflow_set_different_2, old_set->vars); -+ htab_traverse (shared_hash_htab (new_set->vars), dataflow_set_different_2, -+ shared_hash_htab (old_set->vars)); - } - return dataflow_set_different_value; - } -@@ -1545,7 +1715,7 @@ dataflow_set_destroy (dataflow_set *set) - for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) - attrs_list_clear (&set->regs[i]); - -- htab_delete (set->vars); -+ shared_hash_destroy (set->vars); - set->vars = NULL; - } - -@@ -1985,7 +2155,6 @@ find_src_set_src (dataflow_set *set, rtx - { - tree decl = NULL_TREE; /* The variable being copied around. */ - rtx set_src = NULL_RTX; /* The value for "decl" stored in "src". */ -- void **slot; - variable var; - location_chain nextp; - int i; -@@ -1998,12 +2167,9 @@ find_src_set_src (dataflow_set *set, rtx - - if (src && decl) - { -- slot = htab_find_slot_with_hash (set->vars, decl, -- VARIABLE_HASH_VAL (decl), NO_INSERT); -- -- if (slot) -+ var = shared_hash_find (set->vars, decl); -+ if (var) - { -- var = *(variable *) slot; - found = false; - for (i = 0; i < var->n_var_parts && !found; i++) - for (nextp = var->var_part[i].loc_chain; nextp && !found; -@@ -2031,7 +2197,7 @@ compute_bb_dataflow (basic_block bb) - dataflow_set *in = &VTI (bb)->in; - dataflow_set *out = &VTI (bb)->out; - -- dataflow_set_init (&old_out, htab_elements (VTI (bb)->out.vars) + 3); -+ dataflow_set_init (&old_out); - dataflow_set_copy (&old_out, out); - dataflow_set_copy (out, in); - -@@ -2323,7 +2489,7 @@ dump_dataflow_set (dataflow_set *set) - dump_attrs_list (set->regs[i]); - } - } -- dump_vars (set->vars); -+ dump_vars (shared_hash_htab (set->vars)); - fprintf (dump_file, "\n"); - } - -@@ -2345,10 +2511,10 @@ dump_dataflow_sets (void) - } - - /* Add variable VAR to the hash table of changed variables and -- if it has no locations delete it from hash table HTAB. */ -+ if it has no locations delete it from SET's hash table. */ - - static void --variable_was_changed (variable var, htab_t htab) -+variable_was_changed (variable var, dataflow_set *set) - { - hashval_t hash = VARIABLE_HASH_VAL (var->decl); - -@@ -2359,36 +2525,39 @@ variable_was_changed (variable var, htab - slot = (variable *) htab_find_slot_with_hash (changed_variables, - var->decl, hash, INSERT); - -- if (htab && var->n_var_parts == 0) -+ if (set && var->n_var_parts == 0) - { - variable empty_var; -- void **old; - - empty_var = (variable) pool_alloc (var_pool); - empty_var->decl = var->decl; - empty_var->refcount = 1; - empty_var->n_var_parts = 0; - *slot = empty_var; -- -- old = htab_find_slot_with_hash (htab, var->decl, hash, -- NO_INSERT); -- if (old) -- htab_clear_slot (htab, old); -+ goto drop_var; - } - else - { -+ var->refcount++; - *slot = var; - } - } - else - { -- gcc_assert (htab); -+ gcc_assert (set); - if (var->n_var_parts == 0) - { -- void **slot = htab_find_slot_with_hash (htab, var->decl, hash, -- NO_INSERT); -+ void **slot; -+ -+ drop_var: -+ slot = shared_hash_find_slot_noinsert (set->vars, var->decl); - if (slot) -- htab_clear_slot (htab, slot); -+ { -+ if (shared_hash_shared (set->vars)) -+ slot = shared_hash_find_slot_unshare (&set->vars, var->decl, -+ NO_INSERT); -+ htab_clear_slot (shared_hash_htab (set->vars), slot); -+ } - } - } - } -@@ -2438,12 +2607,12 @@ set_variable_part (dataflow_set *set, rt - location_chain node, next; - location_chain *nextp; - variable var; -- void **slot; -- -- slot = htab_find_slot_with_hash (set->vars, decl, -- VARIABLE_HASH_VAL (decl), INSERT); -- if (!*slot) -+ void **slot = shared_hash_find_slot (set->vars, decl); -+ -+ if (!slot || !*slot) - { -+ if (!slot) -+ slot = shared_hash_find_slot_unshare (&set->vars, decl, INSERT); - /* Create new variable information. */ - var = (variable) pool_alloc (var_pool); - var->decl = decl; -@@ -2479,13 +2648,12 @@ set_variable_part (dataflow_set *set, rt - if (set_src != NULL) - node->set_src = set_src; - -- *slot = var; - return; - } - else - { - /* We have to make a copy of a shared variable. */ -- if (var->refcount > 1) -+ if (var->refcount > 1 || shared_hash_shared (set->vars)) - var = unshare_variable (set, var, initialized); - } - } -@@ -2494,7 +2662,7 @@ set_variable_part (dataflow_set *set, rt - /* We have not found the location part, new one will be created. */ - - /* We have to make a copy of the shared variable. */ -- if (var->refcount > 1) -+ if (var->refcount > 1 || shared_hash_shared (set->vars)) - var = unshare_variable (set, var, initialized); - - /* We track only variables whose size is <= MAX_VAR_PARTS bytes -@@ -2548,7 +2716,7 @@ set_variable_part (dataflow_set *set, rt - if (var->var_part[pos].cur_loc == NULL) - { - var->var_part[pos].cur_loc = loc; -- variable_was_changed (var, set->vars); -+ variable_was_changed (var, set); - } - } - -@@ -2561,16 +2729,14 @@ static void - clobber_variable_part (dataflow_set *set, rtx loc, tree decl, - HOST_WIDE_INT offset, rtx set_src) - { -- void **slot; -+ variable var; - - if (! decl || ! DECL_P (decl)) - return; - -- slot = htab_find_slot_with_hash (set->vars, decl, VARIABLE_HASH_VAL (decl), -- NO_INSERT); -- if (slot) -+ var = shared_hash_find (set->vars, decl); -+ if (var) - { -- variable var = (variable) *slot; - int pos = find_variable_location_part (var, offset, NULL); - - if (pos >= 0) -@@ -2627,13 +2793,9 @@ static void - delete_variable_part (dataflow_set *set, rtx loc, tree decl, - HOST_WIDE_INT offset) - { -- void **slot; -- -- slot = htab_find_slot_with_hash (set->vars, decl, VARIABLE_HASH_VAL (decl), -- NO_INSERT); -- if (slot) -+ variable var = shared_hash_find (set->vars, decl);; -+ if (var) - { -- variable var = (variable) *slot; - int pos = find_variable_location_part (var, offset, NULL); - - if (pos >= 0) -@@ -2642,7 +2804,7 @@ delete_variable_part (dataflow_set *set, - location_chain *nextp; - bool changed; - -- if (var->refcount > 1) -+ if (var->refcount > 1 || shared_hash_shared (set->vars)) - { - /* If the variable contains the location part we have to - make a copy of the variable. */ -@@ -2705,7 +2867,7 @@ delete_variable_part (dataflow_set *set, - } - } - if (changed) -- variable_was_changed (var, set->vars); -+ variable_was_changed (var, set); - } - } - } -@@ -2864,14 +3026,6 @@ emit_note_insn_var_location (void **varp - - htab_clear_slot (changed_variables, varp); - -- /* When there are no location parts the variable has been already -- removed from hash table and a new empty variable was created. -- Free the empty variable. */ -- if (var->n_var_parts == 0) -- { -- pool_free (var_pool, var); -- } -- - /* Continue traversing the hash table. */ - return 1; - } -@@ -2910,7 +3064,7 @@ emit_notes_for_differences_1 (void **slo - - empty_var = (variable) pool_alloc (var_pool); - empty_var->decl = old_var->decl; -- empty_var->refcount = 1; -+ empty_var->refcount = 0; - empty_var->n_var_parts = 0; - variable_was_changed (empty_var, NULL); - } -@@ -2952,8 +3106,12 @@ static void - emit_notes_for_differences (rtx insn, dataflow_set *old_set, - dataflow_set *new_set) - { -- htab_traverse (old_set->vars, emit_notes_for_differences_1, new_set->vars); -- htab_traverse (new_set->vars, emit_notes_for_differences_2, old_set->vars); -+ htab_traverse (shared_hash_htab (old_set->vars), -+ emit_notes_for_differences_1, -+ shared_hash_htab (new_set->vars)); -+ htab_traverse (shared_hash_htab (new_set->vars), -+ emit_notes_for_differences_2, -+ shared_hash_htab (old_set->vars)); - emit_notes_for_changes (insn, EMIT_NOTE_BEFORE_INSN); - } - -@@ -2965,7 +3123,7 @@ emit_notes_in_bb (basic_block bb) - int i; - dataflow_set set; - -- dataflow_set_init (&set, htab_elements (VTI (bb)->in.vars) + 3); -+ dataflow_set_init (&set); - dataflow_set_copy (&set, &VTI (bb)->in); - - for (i = 0; i < VTI (bb)->n_mos; i++) -@@ -3098,7 +3256,7 @@ vt_emit_notes (void) - delete_variable_part). */ - emit_notes = true; - -- dataflow_set_init (&empty, 7); -+ dataflow_set_init (&empty); - last_out = ∅ - - FOR_EACH_BB (bb) -@@ -3343,14 +3501,6 @@ vt_initialize (void) - } - } - -- /* Init the IN and OUT sets. */ -- FOR_ALL_BB (bb) -- { -- VTI (bb)->visited = false; -- dataflow_set_init (&VTI (bb)->in, 7); -- dataflow_set_init (&VTI (bb)->out, 7); -- } -- - attrs_pool = create_alloc_pool ("attrs_def pool", - sizeof (struct attrs_def), 1024); - var_pool = create_alloc_pool ("variable_def pool", -@@ -3358,8 +3508,24 @@ vt_initialize (void) - loc_chain_pool = create_alloc_pool ("location_chain_def pool", - sizeof (struct location_chain_def), - 1024); -+ shared_hash_pool = create_alloc_pool ("shared_hash_def pool", -+ sizeof (struct shared_hash_def), 256); -+ empty_shared_hash = (shared_hash) pool_alloc (shared_hash_pool); -+ empty_shared_hash->refcount = 1; -+ empty_shared_hash->htab -+ = htab_create (1, variable_htab_hash, variable_htab_eq, -+ variable_htab_free); - changed_variables = htab_create (10, variable_htab_hash, variable_htab_eq, -- NULL); -+ variable_htab_free); -+ -+ /* Init the IN and OUT sets. */ -+ FOR_ALL_BB (bb) -+ { -+ VTI (bb)->visited = false; -+ dataflow_set_init (&VTI (bb)->in); -+ dataflow_set_init (&VTI (bb)->out); -+ } -+ - vt_add_function_parameters (); - } - -@@ -3381,10 +3547,12 @@ vt_finalize (void) - dataflow_set_destroy (&VTI (bb)->out); - } - free_aux_for_blocks (); -+ htab_delete (empty_shared_hash->htab); -+ htab_delete (changed_variables); - free_alloc_pool (attrs_pool); - free_alloc_pool (var_pool); - free_alloc_pool (loc_chain_pool); -- htab_delete (changed_variables); -+ free_alloc_pool (shared_hash_pool); - } - - /* The entry point to variable tracking pass. */ ---- libiberty/hashtab.c (revision 148758) -+++ libiberty/hashtab.c (revision 148760) -@@ -759,7 +759,8 @@ htab_traverse_noresize (htab_t htab, hta - void - htab_traverse (htab_t htab, htab_trav callback, PTR info) - { -- if (htab_elements (htab) * 8 < htab_size (htab)) -+ size_t size = htab_size (htab); -+ if (htab_elements (htab) * 8 < size && size > 32) - htab_expand (htab); - - htab_traverse_noresize (htab, callback, info); diff --git a/gcc44-rh503816-2.patch b/gcc44-rh503816-2.patch deleted file mode 100644 index 5ee452a..0000000 --- a/gcc44-rh503816-2.patch +++ /dev/null @@ -1,491 +0,0 @@ -2009-06-23 Jakub Jelinek - - * var-tracking.c (unshare_variable): Force initialized to - be VAR_INIT_STATUS_INITIALIZED unless flag_var_tracking_uninit. - (set_variable_part): Likewise. - (struct variable_union_info): Remove pos_src field. - (vui_vec, vui_allocated): New variables. - (variable_union): Pass VAR_INIT_STATUS_UNKNOWN to unshare_variable - unconditionally. Avoid XCVECNEW/free for every sorting, for dst_l - == 1 use a simpler sorting algorithm. Compute pos field right - away, don't fill in pos_src. For dst_l == 2 avoid qsort. - Avoid quadratic comparison if !flag_var_tracking_uninit. - (variable_canonicalize): Pass VAR_INIT_STATUS_UNKNOWN to - unshare_variable unconditionally. - (dataflow_set_different_2): Removed. - (dataflow_set_different): Don't traverse second hash table. - (compute_bb_dataflow): Pass VAR_INIT_STATUS_UNINITIALIZED - unconditionally to var_reg_set or var_mem_set. - (emit_notes_in_bb): Likewise. - (delete_variable_part): Pass VAR_INIT_STATUS_UNKNOWN to - unshare_variable. - (emit_note_insn_var_location): Don't set initialized to - VAR_INIT_STATUS_INITIALIZED early. - (vt_finalize): Free vui_vec if needed, clear vui_vec and - vui_allocated. - ---- gcc/var-tracking.c (revision 148851) -+++ gcc/var-tracking.c (revision 148852) -@@ -347,7 +347,6 @@ static void dataflow_set_union (dataflow - static bool variable_part_different_p (variable_part *, variable_part *); - static bool variable_different_p (variable, variable, bool); - static int dataflow_set_different_1 (void **, void *); --static int dataflow_set_different_2 (void **, void *); - static bool dataflow_set_different (dataflow_set *, dataflow_set *); - static void dataflow_set_destroy (dataflow_set *); - -@@ -878,6 +877,9 @@ unshare_variable (dataflow_set *set, var - var->refcount--; - new_var->n_var_parts = var->n_var_parts; - -+ if (! flag_var_tracking_uninit) -+ initialized = VAR_INIT_STATUS_INITIALIZED; -+ - for (i = 0; i < var->n_var_parts; i++) - { - location_chain node; -@@ -1202,11 +1204,14 @@ struct variable_union_info - /* The sum of positions in the input chains. */ - int pos; - -- /* The position in the chains of SRC and DST dataflow sets. */ -- int pos_src; -+ /* The position in the chain of DST dataflow set. */ - int pos_dst; - }; - -+/* Buffer for location list sorting and its allocated size. */ -+static struct variable_union_info *vui_vec; -+static int vui_allocated; -+ - /* Compare function for qsort, order the structures by POS element. */ - - static int -@@ -1263,14 +1268,9 @@ variable_union (void **slot, void *data) - } - if (k < src->n_var_parts) - { -- enum var_init_status status = VAR_INIT_STATUS_UNKNOWN; -- -- if (! flag_var_tracking_uninit) -- status = VAR_INIT_STATUS_INITIALIZED; -- - if (dstp) - *dstp = (void *) src; -- unshare_variable (set, src, status); -+ unshare_variable (set, src, VAR_INIT_STATUS_UNKNOWN); - } - else - { -@@ -1311,13 +1311,7 @@ variable_union (void **slot, void *data) - - if ((dst->refcount > 1 || shared_hash_shared (set->vars)) - && dst->n_var_parts != k) -- { -- enum var_init_status status = VAR_INIT_STATUS_UNKNOWN; -- -- if (! flag_var_tracking_uninit) -- status = VAR_INIT_STATUS_INITIALIZED; -- dst = unshare_variable (set, dst, status); -- } -+ dst = unshare_variable (set, dst, VAR_INIT_STATUS_UNKNOWN); - - i = src->n_var_parts - 1; - j = dst->n_var_parts - 1; -@@ -1366,70 +1360,152 @@ variable_union (void **slot, void *data) - dst_l = 0; - for (node = dst->var_part[j].loc_chain; node; node = node->next) - dst_l++; -- vui = XCNEWVEC (struct variable_union_info, src_l + dst_l); - -- /* Fill in the locations from DST. */ -- for (node = dst->var_part[j].loc_chain, jj = 0; node; -- node = node->next, jj++) -+ if (dst_l == 1) - { -- vui[jj].lc = node; -- vui[jj].pos_dst = jj; -+ /* The most common case, much simpler, no qsort is needed. */ -+ location_chain dstnode = dst->var_part[j].loc_chain; -+ dst->var_part[k].loc_chain = dstnode; -+ dst->var_part[k].offset = dst->var_part[j].offset; -+ node2 = dstnode; -+ for (node = src->var_part[i].loc_chain; node; node = node->next) -+ if (!((REG_P (dstnode->loc) -+ && REG_P (node->loc) -+ && REGNO (dstnode->loc) == REGNO (node->loc)) -+ || rtx_equal_p (dstnode->loc, node->loc))) -+ { -+ location_chain new_node; - -- /* Value larger than a sum of 2 valid positions. */ -- vui[jj].pos_src = src_l + dst_l; -+ /* Copy the location from SRC. */ -+ new_node = (location_chain) pool_alloc (loc_chain_pool); -+ new_node->loc = node->loc; -+ new_node->init = node->init; -+ if (!node->set_src || MEM_P (node->set_src)) -+ new_node->set_src = NULL; -+ else -+ new_node->set_src = node->set_src; -+ node2->next = new_node; -+ node2 = new_node; -+ } -+ node2->next = NULL; - } -- -- /* Fill in the locations from SRC. */ -- n = dst_l; -- for (node = src->var_part[i].loc_chain, ii = 0; node; -- node = node->next, ii++) -+ else - { -- /* Find location from NODE. */ -- for (jj = 0; jj < dst_l; jj++) -+ if (src_l + dst_l > vui_allocated) - { -- if ((REG_P (vui[jj].lc->loc) -- && REG_P (node->loc) -- && REGNO (vui[jj].lc->loc) == REGNO (node->loc)) -- || rtx_equal_p (vui[jj].lc->loc, node->loc)) -- { -- vui[jj].pos_src = ii; -- break; -- } -+ vui_allocated = MAX (vui_allocated * 2, src_l + dst_l); -+ vui_vec = XRESIZEVEC (struct variable_union_info, vui_vec, -+ vui_allocated); - } -- if (jj >= dst_l) /* The location has not been found. */ -+ vui = vui_vec; -+ -+ /* Fill in the locations from DST. */ -+ for (node = dst->var_part[j].loc_chain, jj = 0; node; -+ node = node->next, jj++) - { -- location_chain new_node; -+ vui[jj].lc = node; -+ vui[jj].pos_dst = jj; - -- /* Copy the location from SRC. */ -- new_node = (location_chain) pool_alloc (loc_chain_pool); -- new_node->loc = node->loc; -- new_node->init = node->init; -- if (!node->set_src || MEM_P (node->set_src)) -- new_node->set_src = NULL; -- else -- new_node->set_src = node->set_src; -- vui[n].lc = new_node; -- vui[n].pos_src = ii; -- vui[n].pos_dst = src_l + dst_l; -- n++; -+ /* Pos plus value larger than a sum of 2 valid positions. */ -+ vui[jj].pos = jj + src_l + dst_l; - } -- } - -- for (ii = 0; ii < src_l + dst_l; ii++) -- vui[ii].pos = vui[ii].pos_src + vui[ii].pos_dst; -+ /* Fill in the locations from SRC. */ -+ n = dst_l; -+ for (node = src->var_part[i].loc_chain, ii = 0; node; -+ node = node->next, ii++) -+ { -+ /* Find location from NODE. */ -+ for (jj = 0; jj < dst_l; jj++) -+ { -+ if ((REG_P (vui[jj].lc->loc) -+ && REG_P (node->loc) -+ && REGNO (vui[jj].lc->loc) == REGNO (node->loc)) -+ || rtx_equal_p (vui[jj].lc->loc, node->loc)) -+ { -+ vui[jj].pos = jj + ii; -+ break; -+ } -+ } -+ if (jj >= dst_l) /* The location has not been found. */ -+ { -+ location_chain new_node; - -- qsort (vui, n, sizeof (struct variable_union_info), -- variable_union_info_cmp_pos); -+ /* Copy the location from SRC. */ -+ new_node = (location_chain) pool_alloc (loc_chain_pool); -+ new_node->loc = node->loc; -+ new_node->init = node->init; -+ if (!node->set_src || MEM_P (node->set_src)) -+ new_node->set_src = NULL; -+ else -+ new_node->set_src = node->set_src; -+ vui[n].lc = new_node; -+ vui[n].pos_dst = src_l + dst_l; -+ vui[n].pos = ii + src_l + dst_l; -+ n++; -+ } -+ } - -- /* Reconnect the nodes in sorted order. */ -- for (ii = 1; ii < n; ii++) -- vui[ii - 1].lc->next = vui[ii].lc; -- vui[n - 1].lc->next = NULL; -+ if (dst_l == 2) -+ { -+ /* Special case still very common case. For dst_l == 2 -+ all entries dst_l ... n-1 are sorted, with for i >= dst_l -+ vui[i].pos == i + src_l + dst_l. */ -+ if (vui[0].pos > vui[1].pos) -+ { -+ /* Order should be 1, 0, 2... */ -+ dst->var_part[k].loc_chain = vui[1].lc; -+ vui[1].lc->next = vui[0].lc; -+ if (n >= 3) -+ { -+ vui[0].lc->next = vui[2].lc; -+ vui[n - 1].lc->next = NULL; -+ } -+ else -+ vui[0].lc->next = NULL; -+ ii = 3; -+ } -+ else -+ { -+ dst->var_part[k].loc_chain = vui[0].lc; -+ if (n >= 3 && vui[2].pos < vui[1].pos) -+ { -+ /* Order should be 0, 2, 1, 3... */ -+ vui[0].lc->next = vui[2].lc; -+ vui[2].lc->next = vui[1].lc; -+ if (n >= 4) -+ { -+ vui[1].lc->next = vui[3].lc; -+ vui[n - 1].lc->next = NULL; -+ } -+ else -+ vui[1].lc->next = NULL; -+ ii = 4; -+ } -+ else -+ { -+ /* Order should be 0, 1, 2... */ -+ ii = 1; -+ vui[n - 1].lc->next = NULL; -+ } -+ } -+ for (; ii < n; ii++) -+ vui[ii - 1].lc->next = vui[ii].lc; -+ } -+ else -+ { -+ qsort (vui, n, sizeof (struct variable_union_info), -+ variable_union_info_cmp_pos); - -- dst->var_part[k].loc_chain = vui[0].lc; -- dst->var_part[k].offset = dst->var_part[j].offset; -+ /* Reconnect the nodes in sorted order. */ -+ for (ii = 1; ii < n; ii++) -+ vui[ii - 1].lc->next = vui[ii].lc; -+ vui[n - 1].lc->next = NULL; -+ dst->var_part[k].loc_chain = vui[0].lc; -+ } - -- free (vui); -+ dst->var_part[k].offset = dst->var_part[j].offset; -+ } - i--; - j--; - } -@@ -1477,17 +1553,18 @@ variable_union (void **slot, void *data) - dst->var_part[k].cur_loc = NULL; - } - -- for (i = 0; i < src->n_var_parts && i < dst->n_var_parts; i++) -- { -- location_chain node, node2; -- for (node = src->var_part[i].loc_chain; node; node = node->next) -- for (node2 = dst->var_part[i].loc_chain; node2; node2 = node2->next) -- if (rtx_equal_p (node->loc, node2->loc)) -- { -- if (node->init > node2->init) -- node2->init = node->init; -- } -- } -+ if (flag_var_tracking_uninit) -+ for (i = 0; i < src->n_var_parts && i < dst->n_var_parts; i++) -+ { -+ location_chain node, node2; -+ for (node = src->var_part[i].loc_chain; node; node = node->next) -+ for (node2 = dst->var_part[i].loc_chain; node2; node2 = node2->next) -+ if (rtx_equal_p (node->loc, node2->loc)) -+ { -+ if (node->init > node2->init) -+ node2->init = node->init; -+ } -+ } - - /* Continue traversing the hash table. */ - return 1; -@@ -1522,14 +1599,7 @@ variable_canonicalize (void **slot, void - } - } - if (k < src->n_var_parts) -- { -- enum var_init_status status = VAR_INIT_STATUS_UNKNOWN; -- -- if (! flag_var_tracking_uninit) -- status = VAR_INIT_STATUS_INITIALIZED; -- -- unshare_variable (set, src, status); -- } -+ unshare_variable (set, src, VAR_INIT_STATUS_UNKNOWN); - return 1; - } - -@@ -1650,34 +1720,6 @@ dataflow_set_different_1 (void **slot, v - return 1; - } - --/* Compare variable *SLOT with the same variable in hash table DATA -- and set DATAFLOW_SET_DIFFERENT_VALUE if they are different. */ -- --static int --dataflow_set_different_2 (void **slot, void *data) --{ -- htab_t htab = (htab_t) data; -- variable var1, var2; -- -- var1 = *(variable *) slot; -- var2 = (variable) htab_find_with_hash (htab, var1->decl, -- VARIABLE_HASH_VAL (var1->decl)); -- if (!var2) -- { -- dataflow_set_different_value = true; -- -- /* Stop traversing the hash table. */ -- return 0; -- } -- -- /* If both variables are defined they have been already checked for -- equivalence. */ -- gcc_assert (!variable_different_p (var1, var2, false)); -- -- /* Continue traversing the hash table. */ -- return 1; --} -- - /* Return true if dataflow sets OLD_SET and NEW_SET differ. */ - - static bool -@@ -1694,14 +1736,9 @@ dataflow_set_different (dataflow_set *ol - - htab_traverse (shared_hash_htab (old_set->vars), dataflow_set_different_1, - shared_hash_htab (new_set->vars)); -- if (!dataflow_set_different_value) -- { -- /* We have compared the variables which are in both hash tables -- so now only check whether there are some variables in NEW_SET->VARS -- which are not in OLD_SET->VARS. */ -- htab_traverse (shared_hash_htab (new_set->vars), dataflow_set_different_2, -- shared_hash_htab (old_set->vars)); -- } -+ /* No need to traverse the second hashtab, if both have the same number -+ of elements and the second one had all entries found in the first one, -+ then it can't have any extra entries. */ - return dataflow_set_different_value; - } - -@@ -2215,15 +2252,11 @@ compute_bb_dataflow (basic_block bb) - case MO_USE: - { - rtx loc = VTI (bb)->mos[i].u.loc; -- enum var_init_status status = VAR_INIT_STATUS_UNINITIALIZED; -- -- if (! flag_var_tracking_uninit) -- status = VAR_INIT_STATUS_INITIALIZED; - - if (GET_CODE (loc) == REG) -- var_reg_set (out, loc, status, NULL); -+ var_reg_set (out, loc, VAR_INIT_STATUS_UNINITIALIZED, NULL); - else if (GET_CODE (loc) == MEM) -- var_mem_set (out, loc, status, NULL); -+ var_mem_set (out, loc, VAR_INIT_STATUS_UNINITIALIZED, NULL); - } - break; - -@@ -2262,10 +2295,12 @@ compute_bb_dataflow (basic_block bb) - if (! flag_var_tracking_uninit) - src_status = VAR_INIT_STATUS_INITIALIZED; - else -- src_status = find_src_status (in, set_src); -+ { -+ src_status = find_src_status (in, set_src); - -- if (src_status == VAR_INIT_STATUS_UNKNOWN) -- src_status = find_src_status (out, set_src); -+ if (src_status == VAR_INIT_STATUS_UNKNOWN) -+ src_status = find_src_status (out, set_src); -+ } - - set_src = find_src_set_src (in, set_src); - -@@ -2609,6 +2644,9 @@ set_variable_part (dataflow_set *set, rt - variable var; - void **slot = shared_hash_find_slot (set->vars, decl); - -+ if (! flag_var_tracking_uninit) -+ initialized = VAR_INIT_STATUS_INITIALIZED; -+ - if (!slot || !*slot) - { - if (!slot) -@@ -2815,10 +2853,8 @@ delete_variable_part (dataflow_set *set, - && REGNO (node->loc) == REGNO (loc)) - || rtx_equal_p (node->loc, loc)) - { -- enum var_init_status status = VAR_INIT_STATUS_UNKNOWN; -- if (! flag_var_tracking_uninit) -- status = VAR_INIT_STATUS_INITIALIZED; -- var = unshare_variable (set, var, status); -+ var = unshare_variable (set, var, -+ VAR_INIT_STATUS_UNKNOWN); - break; - } - } -@@ -2893,9 +2929,6 @@ emit_note_insn_var_location (void **varp - - gcc_assert (var->decl); - -- if (! flag_var_tracking_uninit) -- initialized = VAR_INIT_STATUS_INITIALIZED; -- - complete = true; - last_limit = 0; - n_var_parts = 0; -@@ -3148,14 +3181,11 @@ emit_notes_in_bb (basic_block bb) - case MO_USE: - { - rtx loc = VTI (bb)->mos[i].u.loc; -- -- enum var_init_status status = VAR_INIT_STATUS_UNINITIALIZED; -- if (! flag_var_tracking_uninit) -- status = VAR_INIT_STATUS_INITIALIZED; -+ - if (GET_CODE (loc) == REG) -- var_reg_set (&set, loc, status, NULL); -+ var_reg_set (&set, loc, VAR_INIT_STATUS_UNINITIALIZED, NULL); - else -- var_mem_set (&set, loc, status, NULL); -+ var_mem_set (&set, loc, VAR_INIT_STATUS_UNINITIALIZED, NULL); - - emit_notes_for_changes (insn, EMIT_NOTE_AFTER_INSN); - } -@@ -3553,6 +3583,10 @@ vt_finalize (void) - free_alloc_pool (var_pool); - free_alloc_pool (loc_chain_pool); - free_alloc_pool (shared_hash_pool); -+ if (vui_vec) -+ free (vui_vec); -+ vui_vec = NULL; -+ vui_allocated = 0; - } - - /* The entry point to variable tracking pass. */ diff --git a/mingw32-gcc.spec b/mingw32-gcc.spec index 80e30c6..4bb99e4 100644 --- a/mingw32-gcc.spec +++ b/mingw32-gcc.spec @@ -1,11 +1,11 @@ %global __os_install_post /usr/lib/rpm/brp-compress %{nil} -%global DATE 20090902 -%global SVNREV 151328 +%global DATE 20091114 +%global SVNREV 154179 Name: mingw32-gcc -Version: 4.4.1 -Release: 3%{?dist} +Version: 4.4.2 +Release: 1%{?dist} Summary: MinGW Windows cross-compiler (GCC) for C License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions @@ -34,12 +34,10 @@ Patch11: gcc44-sparc-config-detection.patch Patch12: gcc44-libgomp-omp_h-multilib.patch Patch13: gcc44-libtool-no-rpath.patch Patch14: gcc44-cloog-dl.patch -Patch15: gcc44-raw-string.patch Patch16: gcc44-unwind-debug-hook.patch Patch17: gcc44-pr38757.patch Patch18: gcc44-libstdc++-docs.patch -Patch19: gcc44-rh503816-1.patch -Patch20: gcc44-rh503816-2.patch +Patch19: gcc44-ppc64-aixdesc.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -134,14 +132,12 @@ MinGW Windows cross-compiler for FORTRAN. %patch12 -p0 -b .libgomp-omp_h-multilib~ %patch13 -p0 -b .libtool-no-rpath~ %patch14 -p0 -b .cloog-dl~ -%patch15 -p0 -b .raw-string~ %patch16 -p0 -b .unwind-debug-hook~ %patch17 -p0 -b .pr38757~ %patch18 -p0 -b .libstdc++-docs~ -%patch19 -p0 -b .rh503816-1~ -%patch20 -p0 -b .rh503816-2~ +%patch19 -p0 -b .ppc64-aixdesc~ -sed -i -e 's/4\.4\.2/%{version}/' gcc/BASE-VER +sed -i -e 's/4\.4\.3/%{version}/' gcc/BASE-VER echo 'Fedora MinGW %{version}-%{release}' > gcc/DEV-PHASE @@ -292,6 +288,11 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Sun Nov 22 2009 Kalev Lember - 4.4.2-1 +- Update to gcc 4.4.2 20091114 svn 154179, which includes + VTA backport from 4.5 branch. +- Patches taken from native Fedora gcc-4.4.2-10. + * Fri Sep 18 2009 Kalev Lember - 4.4.1-3 - Require mingw32-binutils >= 2.19.51.0.14 for %%gnu_unique_object support. diff --git a/sources b/sources index 8b21222..5044d7b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -eb2fb0d2c073de0b4edf78dab958aca4 gcc-4.4.1-20090902.tar.bz2 +bcc990c4eafa005e2e15db24e8745cd1 gcc-4.4.2-20091114.tar.bz2