From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2153) id B7463381D45C; Thu, 15 Dec 2022 18:36:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B7463381D45C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671129366; bh=S15ux6oUzGmsIIAehtpziMFN9C/D8pI1LN0xQWm2MJ4=; h=From:To:Subject:Date:From; b=kN3f1Cwmx23MRuV2Pi5HUkxUvFT/90fkWDyIyP1KA3J8c+pcJnz44tFxmJWlo+2FI was2eYJBvE0FWKQ6wffK3wkfL4Nidq88ptUOiVkRhWZDqCtbLWHFKaZhN50fivjjfF N1JZdjPSCWe8p1WKWTRHWY/yqBpk8BfAwGQzKPGc= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" From: Jakub Jelinek To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/redhat/heads/gcc-13-branch)] Red Hat customizations. X-Act-Checkin: gcc X-Git-Author: Jakub Jelinek X-Git-Refname: refs/vendors/redhat/heads/gcc-13-branch X-Git-Oldrev: 8b775b4c48a3cc4ef5c50e56144aea02da2e9cc6 X-Git-Newrev: 75c21855ac707188d6e09bec81612ebeb650b713 Message-Id: <20221215183606.B7463381D45C@sourceware.org> Date: Thu, 15 Dec 2022 18:36:06 +0000 (GMT) List-Id: https://gcc.gnu.org/g:75c21855ac707188d6e09bec81612ebeb650b713 commit 75c21855ac707188d6e09bec81612ebeb650b713 Author: Jakub Jelinek Date: Wed Oct 14 12:07:05 2020 +0200 Red Hat customizations. Diff: --- gcc/ChangeLog | 37 +++ gcc/Makefile.in | 3 +- gcc/ada/ChangeLog | 4 + gcc/ada/gnat-style.texi | 2 +- gcc/config.in | 6 + gcc/config/ia64/ia64.cc | 42 ++-- gcc/config/ia64/ia64.h | 2 +- gcc/config/ia64/ia64.md | 37 +++ gcc/config/ia64/linux.h | 7 + gcc/config/rs6000/ppc-asm.h | 2 +- gcc/config/rs6000/rs6000.cc | 19 +- gcc/configure | 25 +++ gcc/configure.ac | 18 ++ gcc/cppbuiltin.cc | 4 +- gcc/po/sr.po | 4 +- gcc/po/tr.po | 2 +- gcc/testsuite/ChangeLog | 4 + gcc/testsuite/g++.dg/opt/ctor1.C | 470 +++++++++++++++++++++++++++++++++++++++ libgcc/ChangeLog | 9 + libgcc/config/ia64/crtbegin.S | 4 + libgcc/config/ia64/crtend.S | 4 + libgcc/config/ia64/crti.S | 4 + libgcc/config/ia64/crtn.S | 4 + libgcc/config/ia64/lib1funcs.S | 4 + libgcc/crtstuff.c | 8 +- 25 files changed, 693 insertions(+), 32 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5299b0da895..bb31d798fcd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,40 @@ +2010-06-30 Jakub Jelinek + + * config/rs6000/rs6000.c (rs6000_elf_end_indicate_exec_stack): New. + * config/rs6000/linux64.h (TARGET_ASM_FILE_END): Use + rs6000_elf_end_indicate_exec_stack. + * config/ia64/ia64.c (ia64_linux_file_end): New. + * config/ia64/linux.h (TARGET_ASM_FILE_END): Use ia64_linux_file_end. + + * cppbuiltin.c (define__GNUC__): Also define __GNUC_RH_RELEASE__. + + * config/ia64/ia64.h (FRAME_GROWS_DOWNWARD): Define to 1 if + -fstack-protect. + * config/ia64/ia64.c (ia64_compute_frame_size): Make sure + size is a multiple of 16 if FRAME_GROWS_DOWNWARD. + (ia64_initial_elimination_offset): Support FRAME_GROWS_DOWNWARD + layout. + * config/ia64/linux.h (TARGET_LIBC_PROVIDES_SSP): Define. + * config/ia64/ia64.md (stack_protect_set, stack_protect_test): New + expanders. + + Revert: + 2005-04-29 Alan Modra + PR target/21098 + * config/rs6000/rs6000.c (rs6000_elf_end_indicate_exec_stack): New. + * config/rs6000/linux64.h (TARGET_ASM_FILE_END): Use the above. + + * config/rs6000/ppc-asm.h: Add .note.GNU-stack section also + on ppc64-linux. + + * config/ia64/linux.h (TARGET_ASM_FILE_END): Define. + + * configure.ac (HAVE_LD_OVERLAPPING_OPD): New test. + * configure: Rebuilt. + * config.in: Rebuilt. + * config/rs6000/rs6000.c (OVERLAPPING_OPD): Define. + (rs6000_elf_declare_function_name): Use it. + 2022-12-14 David Faust PR target/106773 diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 995d77f96c4..d2e2e546746 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -3064,7 +3064,8 @@ PREPROCESSOR_DEFINES = \ -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \ @TARGET_SYSTEM_ROOT_DEFINE@ -CFLAGS-cppbuiltin.o += $(PREPROCESSOR_DEFINES) -DBASEVER=$(BASEVER_s) +CFLAGS-cppbuiltin.o += $(PREPROCESSOR_DEFINES) -DBASEVER=$(BASEVER_s) \ + -DDEVPHASE=$(DEVPHASE_s) cppbuiltin.o: $(BASEVER) CFLAGS-cppdefault.o += $(PREPROCESSOR_DEFINES) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 7ecefd88ba4..2352185159b 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2010-06-30 Jakub Jelinek + + * gnat-style.texi: Change dircategory to GNU Ada tools. + 2022-12-06 Yannick Moy * contracts.adb (Add_Contract_Item): Allow No_Caching on types. diff --git a/gcc/ada/gnat-style.texi b/gcc/ada/gnat-style.texi index f3b1c29a24f..8403bce0181 100644 --- a/gcc/ada/gnat-style.texi +++ b/gcc/ada/gnat-style.texi @@ -12,7 +12,7 @@ @finalout @dircategory GNU Ada Tools @direntry -* gnat-style: (gnat-style.info). gnat-style +* gnat-style: (gnat-style). GNAT Coding Style @end direntry @c %**end of header diff --git a/gcc/config.in b/gcc/config.in index 4cad077bfbe..474e0bbe126 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -1678,6 +1678,12 @@ #endif +/* Define if your PowerPC64 linker handles overlapping .opd entries. */ +#ifndef USED_FOR_TARGET +#undef HAVE_LD_OVERLAPPING_OPD +#endif + + /* Define if your linker can relax absolute .eh_frame personality pointers into PC-relative form. */ #ifndef USED_FOR_TARGET diff --git a/gcc/config/ia64/ia64.cc b/gcc/config/ia64/ia64.cc index 6df1ce736bc..a0939f91528 100644 --- a/gcc/config/ia64/ia64.cc +++ b/gcc/config/ia64/ia64.cc @@ -289,6 +289,8 @@ static section *ia64_select_rtx_section (machine_mode, rtx, static void ia64_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED; static unsigned int ia64_section_type_flags (tree, const char *, int); +static void ia64_linux_file_end (void) + ATTRIBUTE_UNUSED; static void ia64_init_libfuncs (void) ATTRIBUTE_UNUSED; static void ia64_hpux_init_libfuncs (void) @@ -2950,6 +2952,9 @@ ia64_compute_frame_size (HOST_WIDE_INT size) else pretend_args_size = crtl->args.pretend_args_size; + if (FRAME_GROWS_DOWNWARD) + size = IA64_STACK_ALIGN (size); + total_size = (spill_size + extra_spill_size + size + pretend_args_size + crtl->outgoing_args_size); total_size = IA64_STACK_ALIGN (total_size); @@ -2984,29 +2989,19 @@ ia64_can_eliminate (const int from ATTRIBUTE_UNUSED, const int to) HOST_WIDE_INT ia64_initial_elimination_offset (int from, int to) { - HOST_WIDE_INT offset; + HOST_WIDE_INT offset, size = get_frame_size (); - ia64_compute_frame_size (get_frame_size ()); + ia64_compute_frame_size (size); switch (from) { case FRAME_POINTER_REGNUM: - switch (to) - { - case HARD_FRAME_POINTER_REGNUM: - offset = -current_frame_info.total_size; - if (!crtl->is_leaf || cfun->calls_alloca) - offset += 16 + crtl->outgoing_args_size; - break; - - case STACK_POINTER_REGNUM: - offset = 0; - if (!crtl->is_leaf || cfun->calls_alloca) - offset += 16 + crtl->outgoing_args_size; - break; - - default: - gcc_unreachable (); - } + offset = FRAME_GROWS_DOWNWARD ? IA64_STACK_ALIGN (size) : 0; + if (!crtl->is_leaf || cfun->calls_alloca) + offset += 16 + crtl->outgoing_args_size; + if (to == HARD_FRAME_POINTER_REGNUM) + offset -= current_frame_info.total_size; + else + gcc_assert (to == STACK_POINTER_REGNUM); break; case ARG_POINTER_REGNUM: @@ -11936,4 +11931,13 @@ ia64_can_change_mode_class (machine_mode from, machine_mode to, return true; } +static void +ia64_linux_file_end (void) +{ + int saved_trampolines_created = trampolines_created; + trampolines_created = 0; + file_end_indicate_exec_stack (); + trampolines_created = saved_trampolines_created; +} + #include "gt-ia64.h" diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h index b7415c53596..a3ca5664b9b 100644 --- a/gcc/config/ia64/ia64.h +++ b/gcc/config/ia64/ia64.h @@ -745,7 +745,7 @@ enum reg_class /* Define this macro to nonzero if the addresses of local variable slots are at negative offsets from the frame pointer. */ -#define FRAME_GROWS_DOWNWARD 0 +#define FRAME_GROWS_DOWNWARD (flag_stack_protect != 0) /* Offset from the stack pointer register to the first location at which outgoing arguments are placed. If not specified, the default value of zero diff --git a/gcc/config/ia64/ia64.md b/gcc/config/ia64/ia64.md index 5d1d47da55b..0a57a6d172d 100644 --- a/gcc/config/ia64/ia64.md +++ b/gcc/config/ia64/ia64.md @@ -5238,6 +5238,43 @@ [(set_attr "itanium_class" "unknown") (set_attr "predicable" "no")]) +;; +;; Stack guard expanders + +(define_expand "stack_protect_set" + [(set (match_operand 0 "memory_operand" "") + (match_operand 1 "memory_operand" ""))] + "" +{ +#ifdef TARGET_THREAD_SSP_OFFSET + rtx thread_pointer_rtx = gen_rtx_REG (Pmode, 13); + rtx canary = gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, thread_pointer_rtx, + GEN_INT (TARGET_THREAD_SSP_OFFSET))); + MEM_VOLATILE_P (canary) = MEM_VOLATILE_P (operands[1]); + operands[1] = canary; +#endif + emit_move_insn (operands[0], operands[1]); + DONE; +}) + +(define_expand "stack_protect_test" + [(match_operand 0 "memory_operand" "") + (match_operand 1 "memory_operand" "") + (match_operand 2 "" "")] + "" +{ +#ifdef TARGET_THREAD_SSP_OFFSET + rtx thread_pointer_rtx = gen_rtx_REG (Pmode, 13); + rtx canary = gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, thread_pointer_rtx, + GEN_INT (TARGET_THREAD_SSP_OFFSET))); + MEM_VOLATILE_P (canary) = MEM_VOLATILE_P (operands[1]); + operands[1] = canary; +#endif + emit_cmp_and_jump_insns (operands[0], operands[1], EQ, NULL_RTX, + ptr_mode, 1, operands[2]); + DONE; +}) + ;; Vector operations (include "vect.md") ;; Atomic operations diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h index 93510098ccc..1f7573d2d05 100644 --- a/gcc/config/ia64/linux.h +++ b/gcc/config/ia64/linux.h @@ -23,6 +23,8 @@ a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ +#define TARGET_ASM_FILE_END ia64_linux_file_end + /* This is for -profile to use -lc_p instead of -lc. */ #undef CC1_SPEC #define CC1_SPEC "%{profile:-p} %{G*}" @@ -81,3 +83,8 @@ do { \ /* Define this to be nonzero if static stack checking is supported. */ #define STACK_CHECK_STATIC_BUILTIN 1 + +#ifdef TARGET_LIBC_PROVIDES_SSP +/* IA-64 glibc provides __stack_chk_guard in [r13-8]. */ +#define TARGET_THREAD_SSP_OFFSET -8 +#endif diff --git a/gcc/config/rs6000/ppc-asm.h b/gcc/config/rs6000/ppc-asm.h index 6b8f8f55a10..e2380df5ae6 100644 --- a/gcc/config/rs6000/ppc-asm.h +++ b/gcc/config/rs6000/ppc-asm.h @@ -384,7 +384,7 @@ GLUE(.L,name): \ #endif #endif -#if defined __linux__ && !defined __powerpc64__ +#if defined __linux__ .section .note.GNU-stack .previous #endif diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index b3a609f3aa3..848bec48278 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -20925,6 +20925,15 @@ rs6000_elf_asm_out_destructor (rtx symbol, int priority) assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1); } +#ifdef HAVE_LD_OVERLAPPING_OPD +/* If the linker supports overlapping .opd entries and we know this function + doesn't ever use r11 passed to it, we can overlap the fd_aux function + descriptor field with next function descriptor's fd_func field. */ +# define OVERLAPPING_OPD (cfun->static_chain_decl == NULL) +#else +# define OVERLAPPING_OPD 0 +#endif + void rs6000_elf_declare_function_name (FILE *file, const char *name, tree decl) { @@ -20934,7 +20943,8 @@ rs6000_elf_declare_function_name (FILE *file, const char *name, tree decl) ASM_OUTPUT_LABEL (file, name); fputs (DOUBLE_INT_ASM_OP, file); rs6000_output_function_entry (file, name); - fputs (",.TOC.@tocbase,0\n\t.previous\n", file); + fprintf (file, ",.TOC.@tocbase%s\n\t.previous\n", + OVERLAPPING_OPD ? "" : ",0"); if (DOT_SYMBOLS) { fputs ("\t.size\t", file); @@ -21060,6 +21070,13 @@ rs6000_elf_file_end (void) #if defined (POWERPC_LINUX) || defined (POWERPC_FREEBSD) if (TARGET_32BIT || DEFAULT_ABI == ABI_ELFv2) file_end_indicate_exec_stack (); + else + { + int saved_trampolines_created = trampolines_created; + trampolines_created = 0; + file_end_indicate_exec_stack (); + trampolines_created = saved_trampolines_created; + } #endif if (flag_split_stack) diff --git a/gcc/configure b/gcc/configure index 61b3cedbe69..d7491a04987 100755 --- a/gcc/configure +++ b/gcc/configure @@ -30886,6 +30886,31 @@ cat >>confdefs.h <<_ACEOF #define POWERPC64_TOC_POINTER_ALIGNMENT $gcc_cv_ld_toc_align _ACEOF + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker support for overlapping .opd entries" >&5 +$as_echo_n "checking linker support for overlapping .opd entries... " >&6; } +if test "${gcc_cv_ld_overlapping_opd+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + gcc_cv_ld_overlapping_opd=no + if test $in_tree_ld = yes ; then + if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2; then + gcc_cv_ld_overlapping_opd=yes + fi + elif test x$gcc_cv_ld != x ; then + if $gcc_cv_ld -melf64ppc --help 2>/dev/null | grep non-overlapping-opd > /dev/null; then + gcc_cv_ld_overlapping_opd=yes + fi + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_overlapping_opd" >&5 +$as_echo "$gcc_cv_ld_overlapping_opd" >&6; } + if test x"$gcc_cv_ld_overlapping_opd" = xyes; then + +$as_echo "#define HAVE_LD_OVERLAPPING_OPD 1" >>confdefs.h + fi ;; esac diff --git a/gcc/configure.ac b/gcc/configure.ac index 5efbf11793c..674134e086b 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -6559,6 +6559,24 @@ EOF AC_DEFINE_UNQUOTED(POWERPC64_TOC_POINTER_ALIGNMENT, $gcc_cv_ld_toc_align, [Define to .TOC. alignment forced by your linker.]) fi + + AC_CACHE_CHECK(linker support for overlapping .opd entries, + gcc_cv_ld_overlapping_opd, + [gcc_cv_ld_overlapping_opd=no + if test $in_tree_ld = yes ; then + if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2; then + gcc_cv_ld_overlapping_opd=yes + fi + elif test x$gcc_cv_ld != x ; then + if $gcc_cv_ld -melf64ppc --help 2>/dev/null | grep non-overlapping-opd > /dev/null; then + gcc_cv_ld_overlapping_opd=yes + fi + fi + ]) + if test x"$gcc_cv_ld_overlapping_opd" = xyes; then + AC_DEFINE(HAVE_LD_OVERLAPPING_OPD, 1, + [Define if your PowerPC64 linker handles overlapping .opd entries.]) + fi ;; esac diff --git a/gcc/cppbuiltin.cc b/gcc/cppbuiltin.cc index 8c918bee54a..15875205048 100644 --- a/gcc/cppbuiltin.cc +++ b/gcc/cppbuiltin.cc @@ -58,13 +58,15 @@ parse_basever (int *major, int *minor, int *patchlevel) static void define__GNUC__ (cpp_reader *pfile) { - int major, minor, patchlevel; + int major, minor, patchlevel, rhrevision; parse_basever (&major, &minor, &patchlevel); cpp_define_formatted (pfile, "__GNUC__=%d", major); cpp_define_formatted (pfile, "__GNUC_MINOR__=%d", minor); cpp_define_formatted (pfile, "__GNUC_PATCHLEVEL__=%d", patchlevel); cpp_define_formatted (pfile, "__VERSION__=\"%s\"", version_string); + if (sscanf (DEVPHASE, " (Red Hat %*d.%*d.%*d-%d", &rhrevision) == 1) + cpp_define_formatted (pfile, "__GNUC_RH_RELEASE__=%d", rhrevision); cpp_define_formatted (pfile, "__ATOMIC_RELAXED=%d", MEMMODEL_RELAXED); cpp_define_formatted (pfile, "__ATOMIC_SEQ_CST=%d", MEMMODEL_SEQ_CST); cpp_define_formatted (pfile, "__ATOMIC_ACQUIRE=%d", MEMMODEL_ACQUIRE); diff --git a/gcc/po/sr.po b/gcc/po/sr.po index 20da7dcbe2b..20b063143d8 100644 --- a/gcc/po/sr.po +++ b/gcc/po/sr.po @@ -83397,7 +83397,7 @@ msgstr "Не могу се променити атрибути USE-придру #, fuzzy, gcc-internal-format, gfc-internal-format #| msgid "Duplicate %s attribute specified at %L" msgid "Duplicate %s attribute specified at %L" -msgstr "Удвостручени атрибут %S наведен код %L" +msgstr "Удвостручени атрибут %s наведен код %L" #: fortran/symbol.cc:1027 #, gcc-internal-format, gfc-internal-format @@ -83498,7 +83498,7 @@ msgstr "Одредница ACCESS код %L је већ наведена " #, fuzzy, gcc-internal-format, gfc-internal-format #| msgid "Duplicate %s attribute specified at %L" msgid "Duplicate BIND attribute specified at %L" -msgstr "Удвостручени атрибут %S наведен код %L" +msgstr "Удвостручени атрибут BIND наведен код %L" #: fortran/symbol.cc:1914 #, gcc-internal-format, gfc-internal-format diff --git a/gcc/po/tr.po b/gcc/po/tr.po index 536b00e55d8..1110167035f 100644 --- a/gcc/po/tr.po +++ b/gcc/po/tr.po @@ -79447,7 +79447,7 @@ msgstr "PURE yordamda %s deyimine izin verilmez (%C'de)" #, fuzzy, gcc-internal-format, gfc-internal-format #| msgid "%s statement must appear in a MODULE" msgid "%s statement must appear in a MODULE" -msgstr "%S deyimi bir MODULE'de görünmemeli" +msgstr "%s deyimi bir MODULE'de görünmemeli" #: fortran/parse.cc:4144 #, gcc-internal-format, gfc-internal-format diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a3a6de8a59d..1e528c79944 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2010-06-30 Jakub Jelinek + + * g++.dg/opt/ctor1.C: New test. + 2022-12-14 David Malcolm PR analyzer/108065 diff --git a/gcc/testsuite/g++.dg/opt/ctor1.C b/gcc/testsuite/g++.dg/opt/ctor1.C new file mode 100644 index 00000000000..1f406e57c49 --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/ctor1.C @@ -0,0 +1,470 @@ +// http://bugzilla.redhat.com/show_bug.cgi?id=547286 +// { dg-do compile } +// { dg-options "-Os -w" } + +struct A +{ + void dispose (); + void release () { dispose (); } +}; +struct B +{ + A *pi_; + B () { pi_ = __null; } + ~B () { pi_->release (); } + B (B const &) : pi_ () {} +}; +template +struct C +{ + B pn; +}; +struct D +{ + char *getStr (); +}; +struct E +{ +}; +D EToD (E, unsigned = 0x4406U); +struct F; +enum G +{ + GX1, + GX2, + GX3, + GX4, + GX5, + GX6, + GX7 +}; +struct H; +typedef C I; +struct J {}; +template +struct K +{ + typedef T param_type; +}; +template +struct L +{ + typedef T const_reference; + typedef typename K ::param_type param_type; +}; +struct M; +template +struct N; +template +struct N +{ + typedef T2 type; +}; +template +struct O +{ + typedef N (T1::value), T2, T3> almost_type_; + typedef typename almost_type_::type type; +}; +template +struct P +{ + typedef T type; +}; +template +struct Q +{ +}; +template +struct R +{ + typedef T *TP; + typedef TP R::*type; +}; +template > +struct S : BaseT +{ + typedef R impl_t; + typedef typename impl_t::type bool_type; + operator bool_type (); +}; +template +struct U : public S > +{ +}; +struct parser_tag_base +{ +}; +struct parser_address_tag : parser_tag_base +{ +}; +struct iteration_policy; +struct action_policy; +struct U_policy; +template +struct scanner_policies; +template > +struct scanner; +struct iteration_policy +{ +}; +struct U_policy +{ + template + struct result + { + typedef U <> type; + }; +}; +template +struct U_result +{ + typedef typename MatchPolicyT::template result ::type type; +}; +struct action_policy +{ +}; +template +struct scanner_policies:public IterationPolicyT, MatchPolicyT, ActionPolicyT +{ +}; +struct scanner_base; +template +struct scanner : public PoliciesT +{ + typedef typename L ::param_type iter_param_t; + scanner (IteratorT, iter_param_t, PoliciesT = PoliciesT ()) : PoliciesT (), first (), last () {} + IteratorT first; + IteratorT last; +}; +template +struct action; +template +struct parser_result +{ + typedef typename P ::type parser_type; + typedef typename parser_type::template result ::type type; +}; +template +struct parser +{ + typedef DerivedT embed_t; + template + struct result + { + typedef typename U_result ::type type; + }; + DerivedT derived () const; + template + action operator[] (ActionT); +}; +template +struct parse_info +{ +}; +struct space_parser; +template +struct phrase_parser +{ + template + static parse_info <> parse (IteratorT first_, IteratorT last, ParserT p, space_parser const &) + { + typedef scanner <> scanner_t; + IteratorT first = first_; + scanner_t scan (first, last); + U <> hit = p.parse (scan); + return parse_info <> (); + } +}; +template +parse_info <> parse (IteratorT first, IteratorT last, parser p, parser skip) +{ + phrase_parser ::parse (first, last, p.derived (), skip.derived ()); + return parse_info <> (); +} +template +struct char_parser : public parser +{ +}; +template +struct chlit : public char_parser > +{ +}; +template +struct strlit : public parser > +{ +}; +template +strlit str_p (CharT) +{ + return strlit (); +} +struct space_parser : public char_parser +{ +}; +space_parser space_p = space_parser (); +struct end_parser : public parser +{ +}; +end_parser end_p = end_parser (); +template +struct compressed_pair_switch; +template +struct compressed_pair_switch +{ + static const int value = 0; +}; +template +struct compressed_pair_imp; +template +struct compressed_pair_imp +{ + typedef T1 first_type; + typedef T2 second_type; + typedef typename L ::param_type first_param_type; + typedef typename L ::param_type second_param_type; + compressed_pair_imp (first_param_type x, second_param_type y) : first_ (x), second_ (y) {} + first_type first_; + second_type second_; +}; +template +struct compressed_pair : private compressed_pair_imp ::value> +{ + typedef compressed_pair_imp ::value> base; + typedef T1 first_type; + typedef T2 second_type; + typedef typename L ::param_type first_param_type; + typedef typename L ::param_type second_param_type; + compressed_pair (first_param_type x, second_param_type y):base (x, y) {} +}; +template +struct unary : public BaseT +{ + typedef typename S::embed_t subject_embed_t; + subject_embed_t subj; +}; +template +struct binary : public BaseT +{ + typedef BaseT base_t; + typedef typename L ::param_type left_param_t; + typedef typename L ::const_reference left_return_t; + typedef typename L ::param_type right_param_t; + typedef typename A::embed_t left_embed_t; + typedef typename B::embed_t right_embed_t; + binary (left_param_t a, right_param_t b) : base_t (), subj (a, b) {} + left_return_t left (); + compressed_pair subj; +}; +struct parser_context_base +{ +}; +template +struct parser_context_linker; +template +struct parser_context : parser_context_base +{ + typedef AttrT attr_t; + typedef parser_context_linker > context_linker_t; +}; +template +struct context_aux : public ContextT::base_t::template aux +{ +}; +template +struct parser_context_linker : ContextT +{ +}; +template +struct scoped_ptr +{ + T *px; + scoped_ptr (T * = 0) {} +}; +template < typename Base, typename Derived > struct is_base_and_derived +{ + static const bool value = false; +}; +template +struct get_param +{ + typedef typename O , T0, typename O , T1, typename O , T2, DefaultT>::type>::type>::type type; +}; +template +struct get_context +{ + typedef typename get_param , T0, T1, T2>::type type; +}; +template +struct get_tag +{ + typedef typename get_param ::type type; +}; +template +struct get_scanner +{ + typedef typename get_param , T0, T1, T2>::type type; +}; +template +struct rule_base : parser , get_tag ::type +{ + typedef typename get_scanner ::type scanner_t; + typedef typename get_context ::type context_t; + typedef typename context_t::context_linker_t linked_context_t; + typedef typename linked_context_t::attr_t attr_t; +}; +template +struct abstract_parser +{ + virtual ~abstract_parser () {} +}; +template +struct concrete_parser : abstract_parser +{ + concrete_parser (ParserT const &p) : p (p) {} + virtual abstract_parser * + clone () + { + return new concrete_parser (p); + } + typename ParserT::embed_t p; +}; +template +struct rule : rule_base , rule , T0, T1, T2> +{ + typedef rule base_t; + typedef typename base_t::scanner_t scanner_t; + typedef typename base_t::attr_t attr_t; + typedef abstract_parser abstract_parser_t; + rule () : ptr () {} + template + rule (ParserT const &p) : ptr (new concrete_parser (p)) + { + } + scoped_ptr ptr; +}; +template +struct grammar; +template +typename DerivedT::template definition get_definition (grammar *self) +{ + typedef typename DerivedT::template definition definition_t; + definition_t d (self->derived ()); + return d; +} +template +typename parser_result , ScannerT>::type +grammar_parser_parse (grammar < DerivedT, ContextT > *self, ScannerT) +{ + typedef typename parser_result , ScannerT>::type result_t; + get_definition (self); + return result_t (); +} +template > +struct grammar : parser +{ + typedef grammar self_t; + template + typename parser_result ::type parse_main (ScannerT & scan) + { + typedef typename parser_result ::type tt; + grammar_parser_parse <0> (this, scan); + return tt (); + } + template + typename parser_result ::type parse (ScannerT & scan) + { + return parse_main (scan); + } +}; +template +struct action : unary > > +{ + ActionT actor; +}; +template +struct sequence : binary > > +{ + typedef sequence self_t; + template + typename parser_result ::type parse (ScannerT & scan) + { + typedef typename parser_result ::type result_t; + if (result_t ma = this->left ().parse (scan)) + { + } + return this->left ().parse (scan); + } +}; +template +sequence operator>> (parser , parser ); +template +sequence , B> operator>> (char, parser ); +template +struct alternative : binary > > +{ + typedef alternative self_t; + typedef binary > base_t; + alternative (A const &a, B const &b): + base_t (a, b) {} +}; +template +alternative operator| (parser const &a, parser const &b) +{ + alternative c (a.derived (), b.derived ()); + return c; +} +namespace +{ + typedef char *StringIteratorT; + struct ParserContext; + typedef C ParserContextSharedPtr; + struct EnumFunctor + { + G meFunct; + double mnValue; + ParserContextSharedPtr mpContext; + EnumFunctor (G, ParserContextSharedPtr): + mpContext () {} + }; + struct BinaryFunctionFunctor + { + G meFunct; + ParserContextSharedPtr mpContext; + BinaryFunctionFunctor (G, ParserContextSharedPtr): + mpContext () {} + }; + struct ExpressionGrammar : grammar + { + ExpressionGrammar (ParserContextSharedPtr) {} + template + struct definition + { + definition (ExpressionGrammar self) + { + id = str_p ("pi")[EnumFunctor (GX1, self.getContext ())] | + str_p ("left")[EnumFunctor (GX2, self.getContext ())] | + str_p ("bottom")[EnumFunctor (GX3, self.getContext ())] | + str_p ("xstretch")[EnumFunctor (GX4, self.getContext ())] | + str_p ("ystretch")[EnumFunctor (GX5, self.getContext ())] | + modifierReference | + (('+' >> multiplicativeExpression)[BinaryFunctionFunctor (GX6, self.getContext ())] | + ('-' >> multiplicativeExpression)[BinaryFunctionFunctor (GX7, self.getContext ())]); + } + rule multiplicativeExpression; + rule modifierReference; + rule id; + }; + ParserContextSharedPtr getContext (); + }; +} +void +FunctionParser (E rFunction, F &) +{ + D rAsciiFunction (EToD (rFunction, 11U)); + StringIteratorT aStart (rAsciiFunction.getStr ()); + StringIteratorT aEnd; + ParserContextSharedPtr pContext; + ExpressionGrammar aExpressionGrammer (pContext); + parse_info <> x (parse (aStart, aEnd, aExpressionGrammer >> end_p, space_p)); +} diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 03119bbe2c5..60f724197c6 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,12 @@ +2010-06-30 Jakub Jelinek + + * config/ia64/lib1funcs.S: Add .note.GNU-stack section on + ia64-linux. + * config/ia64/crtbegin.S: Likewise. + * config/ia64/crtend.S: Likewise. + * config/ia64/crti.S: Likewise. + * config/ia64/crtn.S: Likewise. + 2022-12-08 Max Filippov * config/xtensa/xtensa-config-builtin.h (XCHAL_NUM_AREGS) diff --git a/libgcc/config/ia64/crtbegin.S b/libgcc/config/ia64/crtbegin.S index c3b7afbe5fc..5ad661118f7 100644 --- a/libgcc/config/ia64/crtbegin.S +++ b/libgcc/config/ia64/crtbegin.S @@ -185,3 +185,7 @@ __do_global_dtors_aux: .weak __cxa_finalize #endif .weak _Jv_RegisterClasses + +#ifdef __linux__ +.section .note.GNU-stack; .previous +#endif diff --git a/libgcc/config/ia64/crtend.S b/libgcc/config/ia64/crtend.S index 4491bbebb80..e84450f0377 100644 --- a/libgcc/config/ia64/crtend.S +++ b/libgcc/config/ia64/crtend.S @@ -114,3 +114,7 @@ __do_global_ctors_aux: br.ret.sptk.many rp .endp __do_global_ctors_aux + +#ifdef __linux__ +.section .note.GNU-stack; .previous +#endif diff --git a/libgcc/config/ia64/crti.S b/libgcc/config/ia64/crti.S index f2a630a250d..fea67257f80 100644 --- a/libgcc/config/ia64/crti.S +++ b/libgcc/config/ia64/crti.S @@ -51,3 +51,7 @@ _fini: .body # end of crti.S + +#ifdef __linux__ +.section .note.GNU-stack; .previous +#endif diff --git a/libgcc/config/ia64/crtn.S b/libgcc/config/ia64/crtn.S index c8d2756f260..c8eef7623c6 100644 --- a/libgcc/config/ia64/crtn.S +++ b/libgcc/config/ia64/crtn.S @@ -41,3 +41,7 @@ br.ret.sptk.many b0 # end of crtn.S + +#ifdef __linux__ +.section .note.GNU-stack; .previous +#endif diff --git a/libgcc/config/ia64/lib1funcs.S b/libgcc/config/ia64/lib1funcs.S index 5aea76b10c2..5f48842f43a 100644 --- a/libgcc/config/ia64/lib1funcs.S +++ b/libgcc/config/ia64/lib1funcs.S @@ -793,3 +793,7 @@ __floattitf: .endp __floattitf #endif #endif + +#ifdef __linux__ +.section .note.GNU-stack; .previous +#endif diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c index b0d0062ad5b..0fbd934f9bb 100644 --- a/libgcc/crtstuff.c +++ b/libgcc/crtstuff.c @@ -336,15 +336,15 @@ register_tm_clones (void) doesn't need to be defined. */ #ifdef TARGET_LIBGCC_SDATA_SECTION -extern void *__dso_handle __attribute__ ((__section__ (TARGET_LIBGCC_SDATA_SECTION))); +extern void *const __dso_handle __attribute__ ((__section__ (TARGET_LIBGCC_SDATA_SECTION))); #endif #ifdef HAVE_GAS_HIDDEN -extern void *__dso_handle __attribute__ ((__visibility__ ("hidden"))); +extern void *const __dso_handle __attribute__ ((__visibility__ ("hidden"))); #endif #ifdef CRTSTUFFS_O -void *__dso_handle = &__dso_handle; +void *const __dso_handle = (void * const)&__dso_handle; #else -void *__dso_handle = 0; +void *const __dso_handle = 0; #endif #endif /* DEFAULT_USE_CXA_ATEXIT */