From 51454468e8e0daca23325f5c7ed82ecfe9289c5a Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 19 Oct 2009 22:22:08 +0000 Subject: [PATCH] 4.4.2-5 --- .cvsignore | 2 +- gcc.spec | 30 +- gcc44-ppc-const-builtins.patch | 25 + gcc44-pr40521-2.patch | 143 --- gcc44-pr40521.patch | 139 -- gcc44-raw-string.patch | 1495 ---------------------- gcc44-rh529512.patch | 39 - gcc44-unwind-leltgegt.patch | 360 ------ gcc44-vta-dce-debug-stmt-no-change.patch | 18 + gcc44-vta-sched-deps-debug-spec.patch | 19 + sources | 2 +- 11 files changed, 81 insertions(+), 2191 deletions(-) create mode 100644 gcc44-ppc-const-builtins.patch delete mode 100644 gcc44-pr40521-2.patch delete mode 100644 gcc44-pr40521.patch delete mode 100644 gcc44-raw-string.patch delete mode 100644 gcc44-rh529512.patch delete mode 100644 gcc44-unwind-leltgegt.patch create mode 100644 gcc44-vta-dce-debug-stmt-no-change.patch create mode 100644 gcc44-vta-sched-deps-debug-spec.patch diff --git a/.cvsignore b/.cvsignore index 21c7cfc..99c27f5 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,2 +1,2 @@ fastjar-0.97.tar.gz -gcc-4.4.2-20091018.tar.bz2 +gcc-4.4.2-20091019.tar.bz2 diff --git a/gcc.spec b/gcc.spec index 3cf011f..4a2e08f 100644 --- a/gcc.spec +++ b/gcc.spec @@ -1,9 +1,9 @@ -%global DATE 20091018 -%global SVNREV 152967 +%global DATE 20091019 +%global SVNREV 152998 %global gcc_version 4.4.2 # Note, gcc_release must be integer, if you want to add suffixes to # %{release}, append them after %{gcc_release} on Release: line. -%global gcc_release 4 +%global gcc_release 5 %global _unpackaged_files_terminate_build 0 %global multilib_64_archs sparc64 ppc64 s390x x86_64 %global include_gappletviewer 1 @@ -157,15 +157,13 @@ 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-ppc64-aixdesc.patch -Patch20: gcc44-pr40521.patch -Patch21: gcc44-unwind-leltgegt.patch -Patch22: gcc44-pr40521-2.patch -Patch23: gcc44-rh529512.patch +Patch20: gcc44-ppc-const-builtins.patch +Patch21: gcc44-vta-dce-debug-stmt-no-change.patch +Patch22: gcc44-vta-sched-deps-debug-spec.patch Patch1000: fastjar-0.97-segfault.patch @@ -465,17 +463,15 @@ which are required to compile with the GNAT. %if %{build_cloog} %patch14 -p0 -b .cloog-dl~ %endif -%patch15 -p0 -b .raw-string~ %patch16 -p0 -b .unwind-debug-hook~ %patch17 -p0 -b .pr38757~ %if %{build_libstdcxx_docs} %patch18 -p0 -b .libstdc++-docs~ %endif %patch19 -p0 -b .ppc64-aixdesc~ -%patch20 -p0 -b .pr40521~ -%patch21 -p0 -b .unwind-leltgegt~ -%patch22 -p0 -b .pr40521-2~ -%patch23 -p0 -b .rh529512~ +%patch20 -p0 -b .ppc-const-builtins~ +%patch21 -p0 -b .vta-dce-debug-stmt-no-change~ +%patch22 -p0 -b .vta-sched-deps-debug-spec~ # This testcase doesn't compile. rm libjava/testsuite/libjava.lang/PR35020* @@ -1857,6 +1853,14 @@ fi %doc rpm.doc/changelogs/libmudflap/ChangeLog* %changelog +* Mon Oct 19 2009 Jakub Jelinek 4.4.2-5 +- update from gcc-4_4-branch + - PR fortran/41755 + - s390 z10 tuning fixes +- provide accurate attributes for powerpc builtins (PR target/23983) +- fix -fcompare-debug differences caused by DCE removal of debug stmts +- fix updating of speculation status with VTA (PR debug/41739) + * Sun Oct 18 2009 Jakub Jelinek 4.4.2-4 - update from gcc-4_4-branch - PRs c++/37204, c++/37766, c++/37875, c++/38798, c++/40092, diff --git a/gcc44-ppc-const-builtins.patch b/gcc44-ppc-const-builtins.patch new file mode 100644 index 0000000..892a483 --- /dev/null +++ b/gcc44-ppc-const-builtins.patch @@ -0,0 +1,25 @@ +2009-10-19 Jakub Jelinek + + * config/rs6000/rs6000.c (def_builtin): Set TREE_READONLY instead + of TREE_CONSTANT. + +--- gcc/config/rs6000/rs6000.c 2009-10-15 23:23:25.000000000 +0200 ++++ gcc/config/rs6000/rs6000.c 2009-10-19 23:51:26.000000000 +0200 +@@ -8530,7 +8530,7 @@ def_builtin (int mask, const char *name, + + /* const function, function only depends on the inputs. */ + case RS6000_BTC_CONST: +- TREE_CONSTANT (t) = 1; ++ TREE_READONLY (t) = 1; + TREE_NOTHROW (t) = 1; + break; + +@@ -8554,7 +8554,7 @@ def_builtin (int mask, const char *name, + DECL_IS_NOVOPS (t) = 1; + } + else +- TREE_CONSTANT (t) = 1; ++ TREE_READONLY (t) = 1; + break; + } + } diff --git a/gcc44-pr40521-2.patch b/gcc44-pr40521-2.patch deleted file mode 100644 index 15af976..0000000 --- a/gcc44-pr40521-2.patch +++ /dev/null @@ -1,143 +0,0 @@ -2009-10-16 Jakub Jelinek - - PR debug/40521 - * debug.h (struct gcc_debug_hooks): Add assembly_start hook. - * cgraphunit.c (cgraph_optimize): Call it. - * dwarf2out.c (dwarf2out_init): Move .cfi_sections printing into... - (dwarf2out_assembly_start): ... here. New hook. - (dwarf2out_debug_hooks): Add dwarf2out_assembly_start. - * debug.c (do_nothing_debug_hooks): Do nothing for assembly_start - hook. - * dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Likewise. - * sdbout.c (sdb_debug_hooks): Likewise. - * vmsdbgout.c (vmsdbg_debug_hooks): Add vmsdbgout_assembly_start. - (vmsdbgout_assembly_start): New hook. - ---- gcc/debug.h.jj 2009-10-13 16:20:12.000000000 +0200 -+++ gcc/debug.h 2009-10-16 17:48:10.000000000 +0200 -@@ -31,6 +31,10 @@ struct gcc_debug_hooks - /* Output debug symbols. */ - void (* finish) (const char *main_filename); - -+ /* Called from cgraph_optimize before starting to assemble -+ functions/variables/toplevel asms. */ -+ void (* assembly_start) (void); -+ - /* Macro defined on line LINE with name and expansion TEXT. */ - void (* define) (unsigned int line, const char *text); - ---- gcc/cgraphunit.c.jj 2009-10-13 16:20:12.000000000 +0200 -+++ gcc/cgraphunit.c 2009-10-16 17:57:06.000000000 +0200 -@@ -1441,6 +1441,7 @@ cgraph_optimize (void) - timevar_pop (TV_CGRAPHOPT); - - /* Output everything. */ -+ (*debug_hooks->assembly_start) (); - if (!quiet_flag) - fprintf (stderr, "Assembling functions:\n"); - #ifdef ENABLE_CHECKING ---- gcc/dwarf2out.c.jj 2009-10-16 01:51:02.000000000 +0200 -+++ gcc/dwarf2out.c 2009-10-16 18:00:31.000000000 +0200 -@@ -5401,6 +5401,7 @@ static int output_indirect_string (void - - static void dwarf2out_init (const char *); - static void dwarf2out_finish (const char *); -+static void dwarf2out_assembly_start (void); - static void dwarf2out_define (unsigned int, const char *); - static void dwarf2out_undef (unsigned int, const char *); - static void dwarf2out_start_source_file (unsigned, const char *); -@@ -5427,6 +5428,7 @@ const struct gcc_debug_hooks dwarf2_debu - { - dwarf2out_init, - dwarf2out_finish, -+ dwarf2out_assembly_start, - dwarf2out_define, - dwarf2out_undef, - dwarf2out_start_source_file, -@@ -20392,6 +20394,14 @@ dwarf2out_init (const char *filename ATT - ASM_OUTPUT_LABEL (asm_out_file, cold_text_section_label); - } - -+} -+ -+/* Called before cgraph_optimize starts outputtting functions, variables -+ and toplevel asms into assembly. */ -+ -+static void -+dwarf2out_assembly_start (void) -+{ - if (HAVE_GAS_CFI_SECTIONS_DIRECTIVE && dwarf2out_do_cfi_asm ()) - { - #ifndef TARGET_UNWIND_INFO ---- gcc/debug.c.jj 2009-10-13 16:20:12.000000000 +0200 -+++ gcc/debug.c 2009-10-16 17:49:02.000000000 +0200 -@@ -27,6 +27,7 @@ const struct gcc_debug_hooks do_nothing_ - { - debug_nothing_charstar, - debug_nothing_charstar, -+ debug_nothing_void, - debug_nothing_int_charstar, - debug_nothing_int_charstar, - debug_nothing_int_charstar, ---- gcc/dbxout.c.jj 2009-10-13 16:20:12.000000000 +0200 -+++ gcc/dbxout.c 2009-10-16 17:50:58.000000000 +0200 -@@ -346,6 +346,7 @@ const struct gcc_debug_hooks dbx_debug_h - { - dbxout_init, - dbxout_finish, -+ debug_nothing_void, - debug_nothing_int_charstar, - debug_nothing_int_charstar, - dbxout_start_source_file, -@@ -386,6 +387,7 @@ const struct gcc_debug_hooks xcoff_debug - { - dbxout_init, - dbxout_finish, -+ debug_nothing_void, - debug_nothing_int_charstar, - debug_nothing_int_charstar, - dbxout_start_source_file, ---- gcc/sdbout.c.jj 2009-10-13 16:20:12.000000000 +0200 -+++ gcc/sdbout.c 2009-10-16 17:53:15.000000000 +0200 -@@ -307,6 +307,7 @@ const struct gcc_debug_hooks sdb_debug_h - { - sdbout_init, /* init */ - sdbout_finish, /* finish */ -+ debug_nothing_void, /* assembly_start */ - debug_nothing_int_charstar, /* define */ - debug_nothing_int_charstar, /* undef */ - sdbout_start_source_file, /* start_source_file */ ---- gcc/vmsdbgout.c.jj 2009-10-13 16:20:11.000000000 +0200 -+++ gcc/vmsdbgout.c 2009-10-16 18:01:46.000000000 +0200 -@@ -168,6 +168,7 @@ static int write_srccorrs (int); - - static void vmsdbgout_init (const char *); - static void vmsdbgout_finish (const char *); -+static void vmsdbgout_assembly_start (void); - static void vmsdbgout_define (unsigned int, const char *); - static void vmsdbgout_undef (unsigned int, const char *); - static void vmsdbgout_start_source_file (unsigned int, const char *); -@@ -190,6 +191,7 @@ static void vmsdbgout_abstract_function - const struct gcc_debug_hooks vmsdbg_debug_hooks - = {vmsdbgout_init, - vmsdbgout_finish, -+ vmsdbgout_assembly_start, - vmsdbgout_define, - vmsdbgout_undef, - vmsdbgout_start_source_file, -@@ -1618,6 +1620,15 @@ vmsdbgout_init (const char *main_input_f - /* Not implemented in VMS Debug. */ - - static void -+vmsdbgout_assembly_start (void) -+{ -+ if (write_symbols == VMS_AND_DWARF2_DEBUG) -+ (*dwarf2_debug_hooks.assembly_start) (); -+} -+ -+/* Not implemented in VMS Debug. */ -+ -+static void - vmsdbgout_define (unsigned int lineno, const char *buffer) - { - if (write_symbols == VMS_AND_DWARF2_DEBUG) diff --git a/gcc44-pr40521.patch b/gcc44-pr40521.patch deleted file mode 100644 index 2a93452..0000000 --- a/gcc44-pr40521.patch +++ /dev/null @@ -1,139 +0,0 @@ -2009-10-13 Mikael Pettersson - - Backport from mainline: - 2009-10-02 Jakub Jelinek - - PR debug/40521 - * configure.ac (HAVE_GAS_CFI_SECTIONS_DIRECTIVE): New test. - * configure: Regenerated. - * config.in: Regenerated. - * dwarf2out.c (dwarf2out_do_cfi_asm): Return false if - !HAVE_GAS_CFI_SECTIONS_DIRECTIVE and not emitting .eh_frame. - (dwarf2out_init): If HAVE_GAS_CFI_SECTIONS_DIRECTIVE and - not emitting .eh_frame, emit .cfi_sections .debug_frame - directive. - - 2009-10-09 Jakub Jelinek - - PR debug/40521 - * dwarf2out.c (dwarf2out_init): Test whether - HAVE_GAS_CFI_SECTIONS_DIRECTIVE is non-zero instead of checking - it is defined. - ---- gcc/configure.ac 2009-03-24 18:46:03.000000000 +0100 -+++ gcc/configure.ac 2009-10-13 12:00:31.000000000 +0200 -@@ -2297,6 +2297,17 @@ AC_DEFINE_UNQUOTED(HAVE_GAS_CFI_PERSONAL - then echo 1; else echo 0; fi`], - [Define 0/1 if your assembler supports .cfi_personality.]) - -+gcc_GAS_CHECK_FEATURE([cfi sections directive], -+ gcc_cv_as_cfi_sections_directive, ,, -+[ .text -+ .cfi_sections .debug_frame, .eh_frame -+ .cfi_startproc -+ .cfi_endproc]) -+AC_DEFINE_UNQUOTED(HAVE_GAS_CFI_SECTIONS_DIRECTIVE, -+ [`if test $gcc_cv_as_cfi_sections_directive = yes; -+ then echo 1; else echo 0; fi`], -+ [Define 0/1 if your assembler supports .cfi_sections.]) -+ - # GAS versions up to and including 2.11.0 may mis-optimize - # .eh_frame data. - gcc_GAS_CHECK_FEATURE(eh_frame optimization, gcc_cv_as_eh_frame, ---- gcc/config.in 2009-07-22 09:43:59.000000000 +0200 -+++ gcc/config.in 2009-10-13 12:00:31.000000000 +0200 -@@ -839,6 +839,12 @@ - #endif - - -+/* Define 0/1 if your assembler supports .cfi_sections. */ -+#ifndef USED_FOR_TARGET -+#undef HAVE_GAS_CFI_SECTIONS_DIRECTIVE -+#endif -+ -+ - /* Define if your assembler uses the new HImode fild and fist notation. */ - #ifndef USED_FOR_TARGET - #undef HAVE_GAS_FILDS_FISTS ---- gcc/configure 2009-03-24 18:46:03.000000000 +0100 -+++ gcc/configure 2009-10-13 12:00:31.000000000 +0200 -@@ -21680,6 +21680,42 @@ cat >>confdefs.h <<_ACEOF - _ACEOF - - -+echo "$as_me:$LINENO: checking assembler for cfi sections directive" >&5 -+echo $ECHO_N "checking assembler for cfi sections directive... $ECHO_C" >&6 -+if test "${gcc_cv_as_cfi_sections_directive+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ gcc_cv_as_cfi_sections_directive=no -+ if test x$gcc_cv_as != x; then -+ echo ' .text -+ .cfi_sections .debug_frame, .eh_frame -+ .cfi_startproc -+ .cfi_endproc' > conftest.s -+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } -+ then -+ gcc_cv_as_cfi_sections_directive=yes -+ else -+ echo "configure: failed program was" >&5 -+ cat conftest.s >&5 -+ fi -+ rm -f conftest.o conftest.s -+ fi -+fi -+echo "$as_me:$LINENO: result: $gcc_cv_as_cfi_sections_directive" >&5 -+echo "${ECHO_T}$gcc_cv_as_cfi_sections_directive" >&6 -+ -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_GAS_CFI_SECTIONS_DIRECTIVE `if test $gcc_cv_as_cfi_sections_directive = yes; -+ then echo 1; else echo 0; fi` -+_ACEOF -+ -+ - # GAS versions up to and including 2.11.0 may mis-optimize - # .eh_frame data. - echo "$as_me:$LINENO: checking assembler for eh_frame optimization" >&5 ---- gcc/dwarf2out.c 2009-06-03 19:32:45.000000000 +0200 -+++ gcc/dwarf2out.c 2009-10-13 12:00:39.000000000 +0200 -@@ -145,7 +145,18 @@ dwarf2out_do_cfi_asm (void) - #endif - if (!flag_dwarf2_cfi_asm || !dwarf2out_do_frame ()) - return false; -- if (saved_do_cfi_asm || !eh_personality_libfunc) -+ if (saved_do_cfi_asm) -+ return true; -+ if (!HAVE_GAS_CFI_SECTIONS_DIRECTIVE) -+ { -+#ifdef TARGET_UNWIND_INFO -+ return false; -+#else -+ if (USING_SJLJ_EXCEPTIONS || (!flag_unwind_tables && !flag_exceptions)) -+ return false; -+#endif -+ } -+ if (!eh_personality_libfunc) - return true; - if (!HAVE_GAS_CFI_PERSONALITY_DIRECTIVE) - return false; -@@ -16133,6 +16144,14 @@ dwarf2out_init (const char *filename ATT - switch_to_section (cold_text_section); - ASM_OUTPUT_LABEL (asm_out_file, cold_text_section_label); - } -+ -+ if (HAVE_GAS_CFI_SECTIONS_DIRECTIVE && dwarf2out_do_cfi_asm ()) -+ { -+#ifndef TARGET_UNWIND_INFO -+ if (USING_SJLJ_EXCEPTIONS || (!flag_unwind_tables && !flag_exceptions)) -+#endif -+ fprintf (asm_out_file, "\t.cfi_sections\t.debug_frame\n"); -+ } - } - - /* A helper function for dwarf2out_finish called through diff --git a/gcc44-raw-string.patch b/gcc44-raw-string.patch deleted file mode 100644 index 92a2d57..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_WCHAR - || 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-rh529512.patch b/gcc44-rh529512.patch deleted file mode 100644 index 5b1feb0..0000000 --- a/gcc44-rh529512.patch +++ /dev/null @@ -1,39 +0,0 @@ -2009-10-18 Jakub Jelinek - - * cfgexpand.c (expand_debug_expr): Fail if bitpos < 0 for non-MEM - op0. - - * gcc.dg/debug/vta-3.c: New test. - ---- gcc/cfgexpand.c.jj 2009-10-16 01:45:11.000000000 +0200 -+++ gcc/cfgexpand.c 2009-10-18 14:02:25.000000000 +0200 -@@ -2593,6 +2593,9 @@ expand_debug_expr (tree exp) - if (bitpos == 0 && mode == GET_MODE (op0)) - return op0; - -+ if (bitpos < 0) -+ return NULL; -+ - if ((bitpos % BITS_PER_UNIT) == 0 - && bitsize == GET_MODE_BITSIZE (mode1)) - { ---- gcc/testsuite/gcc.dg/debug/vta-3.c.jj 2009-10-18 14:44:12.000000000 +0200 -+++ gcc/testsuite/gcc.dg/debug/vta-3.c 2009-10-18 14:44:32.000000000 +0200 -@@ -0,0 +1,17 @@ -+/* { dg-do compile } */ -+ -+int -+foo (void) -+{ -+ union { char e[8]; int i; } a, b; -+ char *c, *d; -+ unsigned int i; -+ c = a.e; -+ d = &b.e[sizeof (int) - 1]; -+ for (i = 0; i < sizeof (int); i++) -+ { -+ *d = *c++; -+ --d; -+ } -+ return b.i; -+} diff --git a/gcc44-unwind-leltgegt.patch b/gcc44-unwind-leltgegt.patch deleted file mode 100644 index 098943f..0000000 --- a/gcc44-unwind-leltgegt.patch +++ /dev/null @@ -1,360 +0,0 @@ -2009-10-13 Jakub Jelinek - - * unwind-dw2.c (execute_stack_op): Fix operand order for - DW_OP_le, DW_OP_ge, DW_OP_lt and DW_OP_gt. - - * gcc.dg/cleanup-13.c: New test. - ---- gcc/unwind-dw2.c.jj 2009-09-08 15:16:11.000000000 +0200 -+++ gcc/unwind-dw2.c 2009-10-13 19:13:31.000000000 +0200 -@@ -789,22 +789,22 @@ execute_stack_op (const unsigned char *o - result = second ^ first; - break; - case DW_OP_le: -- result = (_Unwind_Sword) first <= (_Unwind_Sword) second; -+ result = (_Unwind_Sword) second <= (_Unwind_Sword) first; - break; - case DW_OP_ge: -- result = (_Unwind_Sword) first >= (_Unwind_Sword) second; -+ result = (_Unwind_Sword) second >= (_Unwind_Sword) first; - break; - case DW_OP_eq: -- result = (_Unwind_Sword) first == (_Unwind_Sword) second; -+ result = (_Unwind_Sword) second == (_Unwind_Sword) first; - break; - case DW_OP_lt: -- result = (_Unwind_Sword) first < (_Unwind_Sword) second; -+ result = (_Unwind_Sword) second < (_Unwind_Sword) first; - break; - case DW_OP_gt: -- result = (_Unwind_Sword) first > (_Unwind_Sword) second; -+ result = (_Unwind_Sword) second > (_Unwind_Sword) first; - break; - case DW_OP_ne: -- result = (_Unwind_Sword) first != (_Unwind_Sword) second; -+ result = (_Unwind_Sword) second != (_Unwind_Sword) first; - break; - - default: ---- gcc/testsuite/gcc.dg/cleanup-13.c.jj 2009-10-13 16:46:54.000000000 +0200 -+++ gcc/testsuite/gcc.dg/cleanup-13.c 2009-10-13 19:20:07.000000000 +0200 -@@ -0,0 +1,319 @@ -+/* HP-UX libunwind.so doesn't provide _UA_END_OF_STACK */ -+/* { dg-do run } */ -+/* { dg-options "-fexceptions" } */ -+/* { dg-skip-if "" { "ia64-*-hpux11.*" } { "*" } { "" } } */ -+/* Verify DW_OP_* handling in the unwinder. */ -+ -+#include -+#include -+#include -+ -+/* #define OP_addr(x) 0x06, ... */ -+#define OP_deref 0x06, -+#define SLEB128(x) (x)&0x7f /* Assume here the value is -0x40 ... 0x3f. */ -+#define ULEB128(x) (x)&0x7f /* Assume here the value is 0 ... 0x7f. */ -+#define VAL1(x) (x)&0xff -+#if defined (__BIG_ENDIAN__) -+#define VAL2(x) ((x)>>8)&0xff,(x)&0xff -+#define VAL4(x) ((x)>>24)&0xff,((x)>>16)&0xff,((x)>>8)&0xff,(x)&0xff -+#define VAL8(x) ((x)>>56)&0xff,((x)>>48)&0xff,((x)>>40)&0xff,((x)>>32)&0xff,((x)>>24)&0xff,((x)>>16)&0xff,((x)>>8)&0xff,(x)&0xff -+#elif defined(__LITTLE_ENDIAN__) || defined(__x86_64__) || defined(__i386__) -+#define VAL2(x) (x)&0xff,((x)>>8)&0xff -+#define VAL4(x) (x)&0xff,((x)>>8)&0xff,((x)>>16)&0xff,((x)>>24)&0xff -+#define VAL8(x) (x)&0xff,((x)>>8)&0xff,((x)>>16)&0xff,((x)>>24)&0xff,((x)>>32)&0xff,((x)>>40)&0xff,((x)>>48)&0xff,((x)>>56)&0xff -+#endif -+#define OP_const1u(x) 0x08,VAL1(x), -+#define OP_const1s(x) 0x09,VAL1(x), -+#define OP_const2u(x) 0x0a,VAL2(x), -+#define OP_const2s(x) 0x0b,VAL2(x), -+#define OP_const4u(x) 0x0c,VAL4(x), -+#define OP_const4s(x) 0x0d,VAL4(x), -+#define OP_const8u(x) 0x0e,VAL8(x), -+#define OP_const8s(x) 0x0f,VAL8(x), -+#define OP_constu(x) 0x10,ULEB128(x), -+#define OP_consts(x) 0x11,SLEB128(x), -+#define OP_dup 0x12, -+#define OP_drop 0x13, -+#define OP_over 0x14, -+#define OP_pick(x) 0x15,VAL1(x), -+#define OP_swap 0x16, -+#define OP_rot 0x17, -+#define OP_xderef 0x18, -+#define OP_abs 0x19, -+#define OP_and 0x1a, -+#define OP_div 0x1b, -+#define OP_minus 0x1c, -+#define OP_mod 0x1d, -+#define OP_mul 0x1e, -+#define OP_neg 0x1f, -+#define OP_not 0x20, -+#define OP_or 0x21, -+#define OP_plus 0x22, -+#define OP_plus_uconst(x) 0x23,ULEB128(x), -+#define OP_shl 0x24, -+#define OP_shr 0x25, -+#define OP_shra 0x26, -+#define OP_xor 0x27, -+#define OP_bra(x) 0x28,VAL2(x), -+#define OP_eq 0x29, -+#define OP_ge 0x2a, -+#define OP_gt 0x2b, -+#define OP_le 0x2c, -+#define OP_lt 0x2d, -+#define OP_ne 0x2e, -+#define OP_skip(x) 0x2f,VAL2(x), -+#define OP_lit0 0x30, -+#define OP_lit1 0x31, -+#define OP_lit2 0x32, -+#define OP_lit3 0x33, -+#define OP_lit4 0x34, -+#define OP_lit5 0x35, -+#define OP_lit6 0x36, -+#define OP_lit7 0x37, -+#define OP_lit8 0x38, -+#define OP_lit9 0x39, -+#define OP_lit10 0x3a, -+#define OP_lit11 0x3b, -+#define OP_lit12 0x3c, -+#define OP_lit13 0x3d, -+#define OP_lit14 0x3e, -+#define OP_lit15 0x3f, -+#define OP_lit16 0x40, -+#define OP_lit17 0x41, -+#define OP_lit18 0x42, -+#define OP_lit19 0x43, -+#define OP_lit20 0x44, -+#define OP_lit21 0x45, -+#define OP_lit22 0x46, -+#define OP_lit23 0x47, -+#define OP_lit24 0x48, -+#define OP_lit25 0x49, -+#define OP_lit26 0x4a, -+#define OP_lit27 0x4b, -+#define OP_lit28 0x4c, -+#define OP_lit29 0x4d, -+#define OP_lit30 0x4e, -+#define OP_lit31 0x4f, -+#define OP_reg0 0x50, -+#define OP_reg1 0x51, -+#define OP_reg2 0x52, -+#define OP_reg3 0x53, -+#define OP_reg4 0x54, -+#define OP_reg5 0x55, -+#define OP_reg6 0x56, -+#define OP_reg7 0x57, -+#define OP_reg8 0x58, -+#define OP_reg9 0x59, -+#define OP_reg10 0x5a, -+#define OP_reg11 0x5b, -+#define OP_reg12 0x5c, -+#define OP_reg13 0x5d, -+#define OP_reg14 0x5e, -+#define OP_reg15 0x5f, -+#define OP_reg16 0x60, -+#define OP_reg17 0x61, -+#define OP_reg18 0x62, -+#define OP_reg19 0x63, -+#define OP_reg20 0x64, -+#define OP_reg21 0x65, -+#define OP_reg22 0x66, -+#define OP_reg23 0x67, -+#define OP_reg24 0x68, -+#define OP_reg25 0x69, -+#define OP_reg26 0x6a, -+#define OP_reg27 0x6b, -+#define OP_reg28 0x6c, -+#define OP_reg29 0x6d, -+#define OP_reg30 0x6e, -+#define OP_reg31 0x6f, -+#define OP_breg0(x) 0x70,SLEB128(x), -+#define OP_breg1(x) 0x71,SLEB128(x), -+#define OP_breg2(x) 0x72,SLEB128(x), -+#define OP_breg3(x) 0x73,SLEB128(x), -+#define OP_breg4(x) 0x74,SLEB128(x), -+#define OP_breg5(x) 0x75,SLEB128(x), -+#define OP_breg6(x) 0x76,SLEB128(x), -+#define OP_breg7(x) 0x77,SLEB128(x), -+#define OP_breg8(x) 0x78,SLEB128(x), -+#define OP_breg9(x) 0x79,SLEB128(x), -+#define OP_breg10(x) 0x7a,SLEB128(x), -+#define OP_breg11(x) 0x7b,SLEB128(x), -+#define OP_breg12(x) 0x7c,SLEB128(x), -+#define OP_breg13(x) 0x7d,SLEB128(x), -+#define OP_breg14(x) 0x7e,SLEB128(x), -+#define OP_breg15(x) 0x7f,SLEB128(x), -+#define OP_breg16(x) 0x80,SLEB128(x), -+#define OP_breg17(x) 0x81,SLEB128(x), -+#define OP_breg18(x) 0x82,SLEB128(x), -+#define OP_breg19(x) 0x83,SLEB128(x), -+#define OP_breg20(x) 0x84,SLEB128(x), -+#define OP_breg21(x) 0x85,SLEB128(x), -+#define OP_breg22(x) 0x86,SLEB128(x), -+#define OP_breg23(x) 0x87,SLEB128(x), -+#define OP_breg24(x) 0x88,SLEB128(x), -+#define OP_breg25(x) 0x89,SLEB128(x), -+#define OP_breg26(x) 0x8a,SLEB128(x), -+#define OP_breg27(x) 0x8b,SLEB128(x), -+#define OP_breg28(x) 0x8c,SLEB128(x), -+#define OP_breg29(x) 0x8d,SLEB128(x), -+#define OP_breg30(x) 0x8e,SLEB128(x), -+#define OP_breg31(x) 0x8f,SLEB128(x), -+#define OP_regx(x) 0x90,SLEB128(x), -+#define OP_fbreg(x) 0x91,SLEB128(x), -+#define OP_bregx(x,y) 0x92,ULEB128(x),SLEB128(y), -+#define OP_piece(x) 0x93,ULEB128(x), -+#define OP_deref_size(x) 0x94,VAL1(x), -+#define OP_xderef_size(x) 0x95,VAL1(x), -+#define OP_nop 0x96, -+#define OP_nop_termination 0x96 -+#define OP_push_object_address 0x97, -+#define OP_call2(x) 0x98,VAL2(x), -+#define OP_call4(x) 0x99,VAL4(x), -+/* #define OP_call_ref(x) 0x9a,... */ -+#define OP_form_tls_address(x) 0x9b, -+#define OP_call_frame_cfa 0x9c, -+#define OP_bit_piece(x) 0x9d,ULEB128(x), -+/* #define OP_implicit_value(x...) 0x9e,... */ -+#define OP_stack_value 0x9f, -+#define OP_GNU_push_tls_address 0xe0, -+/* #define OP_GNU_encoded_addr(x...) 0xf1, */ -+ -+#define ASSERT_TOS_NON0 OP_bra(3) OP_skip(-3) -+#define ASSERT_TOS_0 OP_lit0 OP_eq ASSERT_TOS_NON0 -+ -+/* Initially there is CFA value on the stack, we want to -+ keep it there at the end. */ -+#define CFI_PROGRAM \ -+OP_lit0 OP_nop ASSERT_TOS_0 \ -+OP_lit1 ASSERT_TOS_NON0 \ -+OP_lit1 OP_const1u(1) OP_eq ASSERT_TOS_NON0 \ -+OP_lit16 OP_const2u(16) OP_eq ASSERT_TOS_NON0 \ -+OP_lit31 OP_const4u(31) OP_ne ASSERT_TOS_0 \ -+OP_lit1 OP_neg OP_const1s(-1) OP_eq ASSERT_TOS_NON0 \ -+OP_lit16 OP_neg OP_const2s(-16) OP_ne ASSERT_TOS_0 \ -+OP_lit31 OP_const4s(-31) OP_neg OP_ne ASSERT_TOS_0 \ -+OP_lit7 OP_dup OP_plus_uconst(2) OP_lit9 OP_eq ASSERT_TOS_NON0 \ -+ OP_lit7 OP_eq ASSERT_TOS_NON0 \ -+OP_lit20 OP_lit1 OP_drop OP_lit20 OP_eq ASSERT_TOS_NON0 \ -+OP_lit17 OP_lit19 OP_over OP_lit17 OP_eq ASSERT_TOS_NON0 \ -+ OP_lit19 OP_eq ASSERT_TOS_NON0 OP_lit17 OP_eq ASSERT_TOS_NON0 \ -+OP_lit1 OP_lit2 OP_lit3 OP_lit4 OP_pick(2) OP_lit2 OP_eq ASSERT_TOS_NON0\ -+ OP_lit4 OP_eq ASSERT_TOS_NON0 OP_lit3 OP_eq ASSERT_TOS_NON0 \ -+ OP_pick(0) OP_lit2 OP_eq ASSERT_TOS_NON0 \ -+ OP_lit2 OP_eq ASSERT_TOS_NON0 OP_lit1 OP_eq ASSERT_TOS_NON0 \ -+OP_lit6 OP_lit12 OP_swap OP_lit6 OP_eq ASSERT_TOS_NON0 \ -+ OP_lit12 OP_eq ASSERT_TOS_NON0 \ -+OP_lit7 OP_lit8 OP_lit9 OP_rot OP_lit8 OP_eq ASSERT_TOS_NON0 \ -+ OP_lit7 OP_eq ASSERT_TOS_NON0 OP_lit9 OP_eq ASSERT_TOS_NON0 \ -+OP_lit7 OP_abs OP_lit7 OP_eq ASSERT_TOS_NON0 \ -+OP_const1s(-123) OP_abs OP_const1u(123) OP_eq ASSERT_TOS_NON0 \ -+OP_lit3 OP_lit6 OP_and OP_lit2 OP_eq ASSERT_TOS_NON0 \ -+OP_lit3 OP_lit6 OP_or OP_lit7 OP_eq ASSERT_TOS_NON0 \ -+OP_lit17 OP_lit2 OP_minus OP_lit15 OP_eq ASSERT_TOS_NON0 \ -+OP_const1s(-6) OP_const1s(-2) OP_div OP_lit3 OP_eq ASSERT_TOS_NON0 \ -+OP_const1s(-6) OP_const1s(-4) OP_mod OP_const1s(-2) \ -+ OP_eq ASSERT_TOS_NON0 \ -+OP_lit16 OP_lit31 OP_plus_uconst(1) OP_mul OP_const2u(512) \ -+ OP_eq ASSERT_TOS_NON0 \ -+OP_lit5 OP_not OP_lit31 OP_and OP_lit26 OP_eq ASSERT_TOS_NON0 \ -+OP_lit12 OP_lit31 OP_plus OP_const1u(43) OP_eq ASSERT_TOS_NON0 \ -+OP_const1s(-6) OP_lit2 OP_plus OP_const1s(-4) OP_eq ASSERT_TOS_NON0 \ -+OP_const1s(-6) OP_plus_uconst(3) OP_const1s(-3) OP_eq ASSERT_TOS_NON0 \ -+OP_lit16 OP_lit4 OP_shl OP_const2u(256) OP_eq ASSERT_TOS_NON0 \ -+OP_lit16 OP_lit3 OP_shr OP_lit2 OP_eq ASSERT_TOS_NON0 \ -+OP_const1s(-16) OP_lit3 OP_shra OP_const1s(-2) OP_eq ASSERT_TOS_NON0 \ -+OP_lit3 OP_lit6 OP_xor OP_lit5 OP_eq ASSERT_TOS_NON0 \ -+OP_lit3 OP_lit6 OP_le ASSERT_TOS_NON0 \ -+OP_lit3 OP_lit3 OP_le ASSERT_TOS_NON0 \ -+OP_lit6 OP_lit3 OP_le ASSERT_TOS_0 \ -+OP_lit3 OP_lit6 OP_lt ASSERT_TOS_NON0 \ -+OP_lit3 OP_lit3 OP_lt ASSERT_TOS_0 \ -+OP_lit6 OP_lit3 OP_lt ASSERT_TOS_0 \ -+OP_lit3 OP_lit6 OP_ge ASSERT_TOS_0 \ -+OP_lit3 OP_lit3 OP_ge ASSERT_TOS_NON0 \ -+OP_lit6 OP_lit3 OP_ge ASSERT_TOS_NON0 \ -+OP_lit3 OP_lit6 OP_gt ASSERT_TOS_0 \ -+OP_lit3 OP_lit3 OP_gt ASSERT_TOS_0 \ -+OP_lit6 OP_lit3 OP_gt ASSERT_TOS_NON0 \ -+OP_const1s(-6) OP_lit1 OP_shr OP_lit0 OP_gt ASSERT_TOS_NON0 \ -+OP_const1s(-6) OP_lit1 OP_shra OP_lit0 OP_lt ASSERT_TOS_NON0 -+ -+#define CFI_ESCAPE_VAL_2(VALUES...) #VALUES -+#define CFI_ESCAPE_VAL_1(VALUES...) CFI_ESCAPE_VAL_2(VALUES) -+#define CFI_ESCAPE_VAL(VALUES...) CFI_ESCAPE_VAL_1(VALUES) -+#define CFI_ESCAPE do { } while (0) -+#define CFI_ARCH_PROGRAM OP_nop_termination -+#ifdef __GCC_HAVE_DWARF2_CFI_ASM -+#if defined (__x86_64__) -+#undef CFI_ESCAPE -+#undef CFI_ARCH_PROGRAM -+#define CFI_ARCH_PROGRAM CFI_PROGRAM OP_lit8 OP_minus OP_nop_termination -+unsigned char cfi_arch_program[] = { CFI_ARCH_PROGRAM }; -+extern char verify_it[sizeof (cfi_arch_program) - 0x80 < 0x3f80 ? 1 : -1]; -+/* DW_CFA_expression %rip, uleb128(l2-l1), l1: program DW_OP_lit8 DW_OP_minus DW_OP_nop l2: */ -+#define CFI_ESCAPE \ -+ asm volatile (".cfi_escape 0x10, 0x10, (%P0&0x7f)+0x80, %P0>>7, " \ -+ CFI_ESCAPE_VAL (CFI_ARCH_PROGRAM) \ -+ : : "i" (sizeof (cfi_arch_program))) -+#elif defined (__i386__) -+#undef CFI_ESCAPE -+#undef CFI_ARCH_PROGRAM -+#define CFI_ARCH_PROGRAM CFI_PROGRAM OP_lit4 OP_minus OP_nop_termination -+unsigned char cfi_arch_program[] = { CFI_ARCH_PROGRAM }; -+extern char verify_it[sizeof (cfi_arch_program) - 0x80 < 0x3f80 ? 1 : -1]; -+/* DW_CFA_expression %eip, uleb128(l2-l1), l1: program DW_OP_lit4 DW_OP_minus DW_OP_nop l2: */ -+#define CFI_ESCAPE \ -+ asm volatile (".cfi_escape 0x10, 8, (%P0&0x7f)+0x80, %P0>>7, " \ -+ CFI_ESCAPE_VAL (CFI_ARCH_PROGRAM) \ -+ : : "i" (sizeof (cfi_arch_program))) -+#endif -+#endif -+static _Unwind_Reason_Code -+force_unwind_stop (int version, _Unwind_Action actions, -+ _Unwind_Exception_Class exc_class, -+ struct _Unwind_Exception *exc_obj, -+ struct _Unwind_Context *context, -+ void *stop_parameter) -+{ -+ if (actions & _UA_END_OF_STACK) -+ abort (); -+ return _URC_NO_REASON; -+} -+ -+static void force_unwind () -+{ -+ struct _Unwind_Exception *exc = malloc (sizeof (*exc)); -+ memset (&exc->exception_class, 0, sizeof (exc->exception_class)); -+ exc->exception_cleanup = 0; -+ -+#ifndef __USING_SJLJ_EXCEPTIONS__ -+ _Unwind_ForcedUnwind (exc, force_unwind_stop, 0); -+#else -+ _Unwind_SjLj_ForcedUnwind (exc, force_unwind_stop, 0); -+#endif -+ -+ abort (); -+} -+ -+static void handler (void *p __attribute__((unused))) -+{ -+ exit (0); -+} -+ -+__attribute__((noinline)) static void callme () -+{ -+ CFI_ESCAPE; -+ force_unwind (); -+} -+ -+__attribute__((noinline)) static void doit () -+{ -+ char dummy __attribute__((cleanup (handler))); -+ callme (); -+} -+ -+int main() -+{ -+ doit (); -+ abort (); -+} diff --git a/gcc44-vta-dce-debug-stmt-no-change.patch b/gcc44-vta-dce-debug-stmt-no-change.patch new file mode 100644 index 0000000..88d127a --- /dev/null +++ b/gcc44-vta-dce-debug-stmt-no-change.patch @@ -0,0 +1,18 @@ +2009-10-19 Alexandre Oliva + + * tree-ssa-dce.c (eliminate_unnecessary_stmts): Don't regard + the removal of a debug stmt as a significant change. + +--- gcc/tree-ssa-dce.c.orig 2009-10-19 12:29:56.000000000 -0200 ++++ gcc/tree-ssa-dce.c 2009-10-19 12:30:36.000000000 -0200 +@@ -1129,8 +1129,9 @@ eliminate_unnecessary_stmts (void) + /* If GSI is not necessary then remove it. */ + if (!gimple_plf (stmt, STMT_NECESSARY)) + { ++ if (!is_gimple_debug (stmt)) ++ something_changed = true; + remove_dead_stmt (&gsi, bb); +- something_changed = true; + } + else if (is_gimple_call (stmt)) + { diff --git a/gcc44-vta-sched-deps-debug-spec.patch b/gcc44-vta-sched-deps-debug-spec.patch new file mode 100644 index 0000000..58c136f --- /dev/null +++ b/gcc44-vta-sched-deps-debug-spec.patch @@ -0,0 +1,19 @@ +2009-10-19 Alexandre Oliva + + PR debug/41739 + * haifa-sched.c (try_ready): Skip debug deps updating speculation + status. + +--- gcc/haifa-sched.c.orig 2009-10-19 11:28:14.000000000 -0200 ++++ gcc/haifa-sched.c 2009-10-19 11:33:19.000000000 -0200 +@@ -3754,6 +3754,10 @@ try_ready (rtx next) + { + ds_t ds = DEP_STATUS (dep) & SPECULATIVE; + ++ if (DEBUG_INSN_P (DEP_PRO (dep)) ++ && !DEBUG_INSN_P (next)) ++ continue; ++ + if (first_p) + { + first_p = false; diff --git a/sources b/sources index e4818da..847251a 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ 2659f09c2e43ef8b7d4406321753f1b2 fastjar-0.97.tar.gz -ec0efd8c06411b8416255df19f880444 gcc-4.4.2-20091018.tar.bz2 +a288da14669d6a103dd834387fbe45d3 gcc-4.4.2-20091019.tar.bz2