aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
AgeCommit message (Collapse)AuthorFilesLines
2024-10-19phiopt: do factor_out_conditional_operation for all phis [PR112418]Andrew Pinski1-0/+4
Sometimes factor_out_conditional_operation can factor out an operation that causes a phi node to become the same element. Other times, we want to factor out a binary operator because it can improve code generation, an example is PR 110015 (openjpeg). Note this includes a heuristic to decide if factoring out the operation is profitable or not. It can be expanded to include a better live range extend detector. Right now it has a simple one where if it is live on a dominating path, it is considered a live or if there are a small # of assign statements (defaults to 5), then it does not extend the live range too much. Bootstrapped and tested on x86_64-linux-gnu. PR tree-optimization/112418 gcc/ChangeLog: * tree-ssa-phiopt.cc (is_factor_profitable): New function. (factor_out_conditional_operation): Add merge argument. Remove arg0/arg1 arguments. Return bool instead of the new phi. Early return for virtual ops. Call is_factor_profitable to check if the factoring would be profitable. (pass_phiopt::execute): Call factor_out_conditional_operation on all phis instead of just singleton phi. * doc/invoke.texi (--param phiopt-factor-max-stmts-live=): Document. * params.opt (--param=phiopt-factor-max-stmts-live=): New opt. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/factor_op_phi-1.c: New test. * gcc.dg/tree-ssa/factor_op_phi-2.c: New test. * gcc.dg/tree-ssa/factor_op_phi-3.c: New test. * gcc.dg/tree-ssa/factor_op_phi-4.c: New test. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
2024-10-17doc: remove outdated C++ Concepts sectionPatrick Palka1-44/+0
This was added as part of the initial Concepts TS implementation and reflects an early version of the Concepts TS paper, which is very different from standard C++20 concepts (and even from more recent versions of the Concepts TS, support for which we deprecated in GCC 14 and removed for GCC 15). So there's not much to salvage from this section besides the __is_same trait documentation which we can conveniently move to the previous Type Traits section. gcc/ChangeLog: * doc/extend.texi (C++ Concepts): Remove section. Move __is_same documentation to the previous Type Traits section. Reviewed-by: Jason Merrill <jason@redhat.com>
2024-10-16Fix bootstrap on 32-bit SPARC/SolarisEric Botcazou1-3/+0
The 'U' constraint cannot be used with LRA. gcc/ PR target/113952 PR target/117168 * config/sparc/constraints.md ('U'): Delete. * config/sparc/sparc.md (*movdi_insn_sp32): Remove U alternatives. (*movdf_insn_sp32): Likewise. (*mov<VM64:mode>_insn_sp32): Likewise. * doc/md.texi (SPARC constraints): Remove entry for 'U'.
2024-10-16sparc: drop -mlraSam James1-9/+1
The sparc port gained LRA support in r7-5076-gf99bd883fb0d05 and has defaulted to LRA since r7-5642-g70a6dbe7e37e69. Let's finish the transition by dropping -mlra entirely. Tested on sparc64-unknown-linux-gnu with no regressions. gcc/ChangeLog: PR target/113952 * config/sparc/sparc.cc (sparc_lra_p): Delete. (TARGET_LRA_P): Ditto. (sparc_option_override): Don't use MASK_LRA. * config/sparc/sparc.md (disabled,enabled): Drop lra attribute. * config/sparc/sparc.opt: Delete -mlra. * config/sparc/sparc.opt.urls: Ditto. * doc/invoke.texi (SPARC options): Drop -mlra and -mno-lra.
2024-10-15Provide new GCC builtin __builtin_counted_by_ref [PR116016]Qing Zhao1-0/+55
With the addition of the 'counted_by' attribute and its wide roll-out within the Linux kernel, a use case has been found that would be very nice to have for object allocators: being able to set the counted_by counter variable without knowing its name. For example, given: struct foo { ... int counter; ... struct bar array[] __attribute__((counted_by (counter))); } *p; The existing Linux object allocators are roughly: #define MAX(A, B) (A > B) ? (A) : (B) #define alloc(P, FAM, COUNT) ({ \ __auto_type __p = &(P); \ size_t __size = MAX (sizeof(*P), __builtin_offsetof (__typeof(*P), FAM) + sizeof (*(P->FAM)) * COUNT); \ *__p = kmalloc(__size); \ }) Right now, any addition of a counted_by annotation must also include an open-coded assignment of the counter variable after the allocation: p = alloc(p, array, how_many); p->counter = how_many; In order to avoid the tedious and error-prone work of manually adding the open-coded counted-by intializations everywhere in the Linux kernel, a new GCC builtin __builtin_counted_by_ref will be very useful to be added to help the adoption of the counted-by attribute. -- Built-in Function: TYPE __builtin_counted_by_ref (PTR) The built-in function '__builtin_counted_by_ref' checks whether the array object pointed by the pointer PTR has another object associated with it that represents the number of elements in the array object through the 'counted_by' attribute (i.e. the counted-by object). If so, returns a pointer to the corresponding counted-by object. If such counted-by object does not exist, returns a null pointer. This built-in function is only available in C for now. The argument PTR must be a pointer to an array. The TYPE of the returned value is a pointer type pointing to the corresponding type of the counted-by object or a void pointer type in case of a null pointer being returned. With this new builtin, the central allocator could be updated to: #define MAX(A, B) (A > B) ? (A) : (B) #define alloc(P, FAM, COUNT) ({ \ __auto_type __p = &(P); \ __auto_type __c = (COUNT); \ size_t __size = MAX (sizeof (*(*__p)),\ __builtin_offsetof (__typeof(*(*__p)),FAM) \ + sizeof (*((*__p)->FAM)) * __c); \ if ((*__p = kmalloc(__size))) { \ __auto_type ret = __builtin_counted_by_ref((*__p)->FAM); \ *_Generic(ret, void *: &(size_t){0}, default: ret) = __c; \ } \ }) And then structs can gain the counted_by attribute without needing additional open-coded counter assignments for each struct, and unannotated structs could still use the same allocator. PR c/116016 gcc/c-family/ChangeLog: * c-common.cc: Add new __builtin_counted_by_ref. * c-common.h (enum rid): Add RID_BUILTIN_COUNTED_BY_REF. gcc/c/ChangeLog: * c-decl.cc (names_builtin_p): Add RID_BUILTIN_COUNTED_BY_REF. * c-parser.cc (has_counted_by_object): New routine. (get_counted_by_ref): New routine. (c_parser_postfix_expression): Handle New RID_BUILTIN_COUNTED_BY_REF. * c-tree.h: New routine handle_counted_by_for_component_ref. * c-typeck.cc (handle_counted_by_for_component_ref): New routine. (build_component_ref): Call the new routine. gcc/ChangeLog: * doc/extend.texi: Add documentation for __builtin_counted_by_ref. gcc/testsuite/ChangeLog: * gcc.dg/builtin-counted-by-ref-1.c: New test. * gcc.dg/builtin-counted-by-ref.c: New test.
2024-10-15C++: Add opindex for -Wchanges-meaning [PR117157]Andrew Pinski1-0/+2
Adds missing opindex for -Wchanges-meaning Pushed as obvious after building the HTML and checking the index. gcc/ChangeLog: PR c++/117157 * doc/invoke.texi (Wno-changes-meaning): Add opindex. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
2024-10-15libcpp: Add -Wtrailing-blanks warningJakub Jelinek1-1/+17
Trailing blanks is something even git diff diagnoses; while it is a coding style issue, if it is so common that git diff diagnoses it, I think it could be useful to various projects to check that at compile time. Dunno if it should be included in -Wextra, currently it isn't, and due to tons of trailing whitespace in our sources, haven't enabled it for when building gcc itself either. Note, git diff also diagnoses indentation with tab following space, wonder if we couldn't have trivial warning options where one would simply ask for checking of indentation with no tabs, just spaces vs. indentation with tabs followed by spaces (but never tab width or more spaces in the indentation). I think that would be easy to do also on the libcpp side. Checking how much something should be exactly indented requires syntax analysis (at least some limited one) and can consider columns of first token on line, but what the exact indentation blanks were is something only libcpp knows. On Thu, Sep 19, 2024 at 08:17:24AM +0200, Richard Biener wrote: > Generally I like diagnosing this early. For the above I'd say -Wtrailing-whitespace= > with a set of things to diagnose (and a sane default - just spaces and tabs - for > -Wtrailiing-whitespace) would be nice. As for naming possibly follow the > is{space,blank,cntrl} character classifications? If those are a good > fit, that is. The patch currently allows blank (' ' '\t') and space (' ' '\t' '\f' '\v'), cntrl not yet added, not anything non-ASCII, but in theory could be added later (though, non-ASCII would be just for inside of comments, say non-breaking space etc. in the source is otherwise an error). 2024-10-15 Jakub Jelinek <jakub@redhat.com> libcpp/ * include/cpplib.h (struct cpp_options): Add cpp_warn_trailing_whitespace member. (enum cpp_warning_reason): Add CPP_W_TRAILING_WHITESPACE. * internal.h (struct _cpp_line_note): Document 'W' line note. * lex.cc (_cpp_clean_line): Add 'W' line note for trailing whitespace except for trailing whitespace after backslash. Formatting fix. (_cpp_process_line_notes): Emit -Wtrailing-whitespace diagnostics. Formatting fixes. (lex_raw_string): Clear type on 'W' notes. gcc/ * doc/invoke.texi (Wtrailing-whitespace): Document. gcc/c-family/ * c.opt (Wtrailing-whitespace=): New option. (Wtrailing-whitespace): New alias. * c.opt.urls: Regenerate. gcc/testsuite/ * c-c++-common/cpp/Wtrailing-whitespace-1.c: New test. * c-c++-common/cpp/Wtrailing-whitespace-2.c: New test. * c-c++-common/cpp/Wtrailing-whitespace-3.c: New test. * c-c++-common/cpp/Wtrailing-whitespace-4.c: New test. * c-c++-common/cpp/Wtrailing-whitespace-5.c: New test. * c-c++-common/cpp/Wtrailing-whitespace-6.c: New test. * c-c++-common/cpp/Wtrailing-whitespace-7.c: New test. * c-c++-common/cpp/Wtrailing-whitespace-8.c: New test. * c-c++-common/cpp/Wtrailing-whitespace-9.c: New test. * c-c++-common/cpp/Wtrailing-whitespace-10.c: New test.
2024-10-09diagnostics: mark the JSON output format as deprecatedDavid Malcolm1-264/+2
The bulk of the documentation for -fdiagnostics-format= is taken up by a description of the "json" format added in r9-4156-g478dd60ddcf177. I don't plan to add any extra features to the "json" format; all my future work on machine-readable GCC diagnostics is likely to be on the SARIF output format (https://gcc.gnu.org/wiki/SARIF). Hence users seeking machine-readable output from GCC should use SARIF. This patch removes the long documentation of the format and describes it as deprecated. gcc/ChangeLog: * doc/invoke.texi (fdiagnostics-format): Describe "json" et al as deprecated, and remove the long description of the output format. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2024-10-10Enable vectorization for unknown tripcount in very cheap cost model but ↵liuhongt1-7/+4
disable epilog vectorization. gcc/ChangeLog: * tree-vect-loop.cc (vect_analyze_loop_costing): Enable vectorization for LOOP_VINFO_PEELING_FOR_NITER in very cheap cost model. (vect_analyze_loop): Disable epilogue vectorization in very cheap cost model. * doc/invoke.texi: Adjust documents for very-cheap cost model.
2024-10-09gcc/doc: adjust __builtin_choose_expr() descriptionJan Beulich1-5/+6
Present wording has misled people to believe the ?: operator would be evaluating all three of the involved expressions. gcc/ * doc/extend.texi: Clarify __builtin_choose_expr() (dis)similarity to the ?: operator.
2024-10-08gcc, libcpp: Add warning switch for "#pragma once in main file" [PR89808]Ken Matsui1-2/+8
This patch adds a warning switch for "#pragma once in main file". The warning option name is Wpragma-once-outside-header, which is the same as Clang provides. PR preprocessor/89808 gcc/c-family/ChangeLog: * c.opt (Wpragma_once_outside_header): Define new option. * c.opt.urls: Regenerate. gcc/ChangeLog: * doc/invoke.texi (Warning Options): Document -Wno-pragma-once-outside-header. libcpp/ChangeLog: * include/cpplib.h (cpp_warning_reason): Define CPP_W_PRAGMA_ONCE_OUTSIDE_HEADER. * directives.cc (do_pragma_once): Use CPP_W_PRAGMA_ONCE_OUTSIDE_HEADER. gcc/testsuite/ChangeLog: * g++.dg/warn/Wno-pragma-once-outside-header.C: New test. * g++.dg/warn/Wpragma-once-outside-header.C: New test. Signed-off-by: Ken Matsui <kmatsui@gcc.gnu.org> Reviewed-by: Marek Polacek <polacek@redhat.com>
2024-10-08ssa-math-opts, i386: Handle most unordered values rather than just 2 [PR116896]Jakub Jelinek1-2/+5
On Mon, Oct 07, 2024 at 10:32:57AM +0200, Richard Biener wrote: > > They are implementation defined, -1, 0, 1, 2 is defined by libstdc++: > > using type = signed char; > > enum class _Ord : type { equivalent = 0, less = -1, greater = 1 }; > > enum class _Ncmp : type { _Unordered = 2 }; > > https://eel.is/c++draft/cmp#categories.pre-1 documents them as > > enum class ord { equal = 0, equivalent = equal, less = -1, greater = 1 }; // exposition only > > enum class ncmp { unordered = -127 }; // exposition only > > and now looking at it, LLVM's libc++ takes that literally and uses > > -1, 0, 1, -127. One can't use <=> operator without including <compare> > > which provides the enums, so I think if all we care about is libstdc++, > > then just hardcoding -1, 0, 1, 2 is fine, if we want to also optimize > > libc++ when used with gcc, we could support -1, 0, 1, -127 as another > > option. > > Supporting arbitrary 4 values doesn't make sense, at least on x86 the > > only reason to do the conversion to int in an optab is a good sequence > > to turn the flag comparisons to -1, 0, 1. So, either we do nothing > > more than the patch, or add handle both 2 and -127 for unordered, > > or add support for arbitrary value for the unordered case except > > -1, 0, 1 (then -1 could mean signed int, 1 unsigned int, 0 do the jumps > > and any other value what should be returned for unordered. Here is an incremental patch which adds support for (almost) arbitrary unordered constant value. It changes the .SPACESHIP and spaceship<mode>4 optab conventions, so 0 means use branches, floating point, -1, 0, 1, 2 results consumed by tree-ssa-math-opts.cc emitted comparisons, -1 means signed int comparisons, -1, 0, 1 results, 1 means unsigned int comparisons, -1, 0, 1 results, and for constant other than -1, 0, 1 which fit into [-128, 127] converted to the PHI type are otherwise specified as the last argument (then it is -1, 0, 1, C results). 2024-10-08 Jakub Jelinek <jakub@redhat.com> PR middle-end/116896 * tree-ssa-math-opts.cc (optimize_spaceship): Handle unordered values other than 2, but they still need to be signed char range possibly converted to the PHI result and can't be in [-1, 1] range. Use last .SPACESHIP argument of 1 for unsigned int comparisons, -1 for signed int, 0 for floating point branches and any other for floating point with that value as unordered. * config/i386/i386-expand.cc (ix86_expand_fp_spaceship): Use op2 rather const2_rtx if op2 is not const0_rtx for unordered result. (ix86_expand_int_spaceship): Change INTVAL (op2) == 1 tests to INTVAL (op2) != -1. * doc/md.texi (spaceship@var{m}4): Document the above changes. * gcc.target/i386/pr116896.c: New test.
2024-10-08LoongArch: Add support to annotate tablejumpXi Ruoyao1-1/+12
This is per the request from the kernel developers. For generating the ORC unwind info, the objtool program needs to analysis the control flow of a .o file. If a jump table is used, objtool has to correlate the jump instruction with the table. On x86 (where objtool was initially developed) it's simple: a relocation entry natrually correlates them because one single instruction is used for table-based jump. But on an RISC machine objtool would have to reconstruct the data flow if it must find out the correlation on its own. So, emit an additional section to store the correlation info as pairs of addresses, each pair contains the address of a jump instruction (jr) and the address of the jump table. This is very trivial to implement in GCC. gcc/ChangeLog: * config/loongarch/genopts/loongarch.opt.in (mannotate-tablejump): New option. * config/loongarch/loongarch.opt: Regenerate. * config/loongarch/loongarch.md (tablejump<mode>): Emit additional correlation info between the jump instruction and the jump table, if -mannotate-tablejump. * doc/invoke.texi: Document -mannotate-tablejump. gcc/testsuite/ChangeLog: * gcc.target/loongarch/jump-table-annotate.c: New test. Suggested-by: Tiezhu Yang <yangtiezhu@loongson.cn>
2024-10-07c++: modules don't require preprocessor outputJason Merrill1-7/+6
init_modules has rejected -M -fmodules-ts on the premise that module dependency analysis requires macro expansion, but this is no longer accurate; P1857 prohibited module directives produced by macro expansion. They can still be dependent on #if directives, but those are still handled with -fdirectives-only. What wasn't working was -M or -dM, because cpp_scan_nooutput never called module_token_pre to implement the import. The simplest fix is to use the -fdirectives-only scan when modules are enabled and teach directives_only_cb about flag_no_output. gcc/cp/ChangeLog: * module.cc (init_modules): Don't warn about -M. gcc/c-family/ChangeLog: * c-ppoutput.cc (preprocess_file): For modules, use directives-only scan even with flag_no_output. (directives_only_cb): Respect flag_no_output. gcc/ChangeLog: * doc/invoke.texi (C++ Module Preprocessing): Allow -M, refer to -fdeps. gcc/testsuite/ChangeLog: * g++.dg/modules/macro-8_a.H: New test. * g++.dg/modules/macro-8_b.C: New test. * g++.dg/modules/macro-8_c.C: New test. * g++.dg/modules/macro-8_d.C: New test.
2024-10-07ssa-math-opts, i386: Improve spaceship expansion [PR116896]Jakub Jelinek1-2/+6
The PR notes that we don't emit optimal code for C++ spaceship operator if the result is returned as an integer rather than the result just being compared against different values and different code executed based on that. So e.g. for template <typename T> auto foo (T x, T y) { return x <=> y; } for both floating point types, signed integer types and unsigned integer types. auto in that case is std::strong_ordering or std::partial_ordering, which are fancy C++ abstractions around struct with signed char member which is -1, 0, 1 for the strong ordering and -1, 0, 1, 2 for the partial ordering (but for -ffast-math 2 is never the case). I'm afraid functions like that are fairly common and unless they are inlined, we really need to map the comparison to those -1, 0, 1 or -1, 0, 1, 2 values. Now, for floating point spaceship I've in the past already added an optimization (with tree-ssa-math-opts.cc discovery and named optab, the optab only defined on x86 though right now), which ensures there is just a single comparison instruction and then just tests based on flags. Now, if we have code like: auto a = x <=> y; if (a == std::partial_ordering::less) bar (); else if (a == std::partial_ordering::greater) baz (); else if (a == std::partial_ordering::equivalent) qux (); else if (a == std::partial_ordering::unordered) corge (); etc., that results in decent code generation, the spaceship named pattern on x86 optimizes for the jumps, so emits comparisons on the flags, followed by setting the result to -1, 0, 1, 2 and subsequent jump pass optimizes that well. But if the result needs to be stored into an integer and just returned that way or there are no immediate jumps based on it (or turned into some non-standard integer values like -42, 0, 36, 75 etc.), then CE doesn't do a good job for that, we end up with say comiss %xmm1, %xmm0 jp .L4 seta %al movl $0, %edx leal -1(%rax,%rax), %eax cmove %edx, %eax ret .L4: movl $2, %eax ret The jp is good, that is the unlikely case and can't be easily handled in straight line code due to the layout of the flags, but the rest uses cmov which often isn't a win and a weird math. With the patch below we can get instead xorl %eax, %eax comiss %xmm1, %xmm0 jp .L2 seta %al sbbl $0, %eax ret .L2: movl $2, %eax ret The patch changes the discovery in the generic code, by detecting if the future .SPACESHIP result is just used in a PHI with -1, 0, 1 or -1, 0, 1, 2 values (the latter for HONOR_NANS) and passes that as a flag in a new argument to .SPACESHIP ifn, so that the named pattern is told whether it should optimize for branches or for loading the result into a -1, 0, 1 (, 2) integer. Additionally, it doesn't detect just floating point <=> anymore, but also integer and unsigned integer, but in those cases only if an integer -1, 0, 1 is wanted (otherwise == and > or similar comparisons result in good code). The backend then can for those integer or unsigned integer <=>s return effectively (x > y) - (x < y) in a way that is efficient on the target (so for x86 with ensuring zero initialization first when needed before setcc; one for floating point and unsigned, where there is just one setcc and the second one optimized into sbb instruction, two for the signed int case). So e.g. for signed int we now emit xorl %edx, %edx xorl %eax, %eax cmpl %esi, %edi setl %dl setg %al subl %edx, %eax ret and for unsigned xorl %eax, %eax cmpl %esi, %edi seta %al sbbb $0, %al ret Note, I wonder if other targets wouldn't benefit from defining the named optab too... 2024-10-07 Jakub Jelinek <jakub@redhat.com> PR middle-end/116896 * optabs.def (spaceship_optab): Use spaceship$a4 rather than spaceship$a3. * internal-fn.cc (expand_SPACESHIP): Expect 3 call arguments rather than 2, expand the last one, expect 4 operands of spaceship_optab. * tree-ssa-math-opts.cc: Include cfghooks.h. (optimize_spaceship): Check if a single PHI is initialized to -1, 0, 1, 2 or -1, 0, 1 values, in that case pass 1 as last (new) argument to .SPACESHIP and optimize away the comparisons, otherwise pass 0. Also check for integer comparisons rather than floating point, in that case do it only if there is a single PHI with -1, 0, 1 values and pass 1 to last argument of .SPACESHIP if the <=> is signed, 2 if unsigned. * config/i386/i386-protos.h (ix86_expand_fp_spaceship): Add another rtx argument. (ix86_expand_int_spaceship): Declare. * config/i386/i386-expand.cc (ix86_expand_fp_spaceship): Add arg3 argument, if it is const0_rtx, expand like before, otherwise emit optimized sequence for setting the result into a GPR. (ix86_expand_int_spaceship): New function. * config/i386/i386.md (UNSPEC_SETCC_SI_SLP): New UNSPEC code. (setcc_si_slp): New define_expand. (*setcc_si_slp): New define_insn_and_split. (setcc + setcc + movzbl): New define_peephole2. (spaceship<mode>3): Renamed to ... (spaceship<mode>4): ... this. Add an extra operand, pass it to ix86_expand_fp_spaceship. (spaceshipxf3): Renamed to ... (spaceshipxf4): ... this. Add an extra operand, pass it to ix86_expand_fp_spaceship. (spaceship<mode>4): New define_expand for SWI modes. * doc/md.texi (spaceship@var{m}3): Renamed to ... (spaceship@var{m}4): ... this. Document the meaning of last operand. * g++.target/i386/pr116896-1.C: New test. * g++.target/i386/pr116896-2.C: New test.
2024-10-06doc: Focus on DWARF for FreeBSDGerald Pfeifer1-3/+1
gcc: PR target/69374 * doc/install.texi (Specific) <*-*-freebsd*>: Focus on DWARF only.
2024-10-04doc: Drop GCC 2.6 ABI change note for H8/h8300-hmsGerald Pfeifer1-5/+0
gcc: PR target/69374 * doc/install.texi (Specific) <h8300-hms>: Drop GCC 2.6 ABI change note.
2024-10-03c++: -Wdeprecated enables later standard deprecationsJason Merrill1-6/+16
By default -Wdeprecated warns about deprecations in the active standard. When specified explicitly, let's also warn about deprecations in later standards. gcc/c-family/ChangeLog: * c-opts.cc (c_common_post_options): Explicit -Wdeprecated enables deprecations from later standards. gcc/ChangeLog: * doc/invoke.texi: Explicit -Wdeprecated enables more warnings.
2024-10-03c++: add -Wdeprecated-literal-operator [CWG2521]Jason Merrill1-0/+12
C++23 CWG issue 2521 (https://wg21.link/cwg2521) deprecates user-defined literal operators declared with the optional space between "" and the suffix. Many testcases used that syntax; I removed the space from most of them, and added C++23 warning tests to a few. CWG 2521 gcc/ChangeLog: * doc/invoke.texi: Document -Wdeprecated-literal-operator. gcc/c-family/ChangeLog: * c.opt: Add -Wdeprecated-literal-operator. * c-opts.cc (c_common_post_options): Default on in C++23. * c.opt.urls: Regenerate. gcc/cp/ChangeLog: * parser.cc (location_between): New. (cp_parser_operator): Handle -Wdeprecated-literal-operator. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/udlit-string-literal.h * g++.dg/cpp0x/Wliteral-suffix2.C * g++.dg/cpp0x/constexpr-55708.C * g++.dg/cpp0x/gnu_fext-numeric-literals.C * g++.dg/cpp0x/gnu_fno-ext-numeric-literals.C * g++.dg/cpp0x/pr51420.C * g++.dg/cpp0x/pr60209-neg.C * g++.dg/cpp0x/pr60209.C * g++.dg/cpp0x/pr61038.C * g++.dg/cpp0x/std_fext-numeric-literals.C * g++.dg/cpp0x/std_fno-ext-numeric-literals.C * g++.dg/cpp0x/udlit-addr.C * g++.dg/cpp0x/udlit-args-neg.C * g++.dg/cpp0x/udlit-args.C * g++.dg/cpp0x/udlit-args2.C * g++.dg/cpp0x/udlit-clink-neg.C * g++.dg/cpp0x/udlit-concat-neg.C * g++.dg/cpp0x/udlit-concat.C * g++.dg/cpp0x/udlit-constexpr.C * g++.dg/cpp0x/udlit-cpp98-neg.C * g++.dg/cpp0x/udlit-declare-neg.C * g++.dg/cpp0x/udlit-embed-quote.C * g++.dg/cpp0x/udlit-extended-id-1.C * g++.dg/cpp0x/udlit-extended-id-3.C * g++.dg/cpp0x/udlit-extern-c.C * g++.dg/cpp0x/udlit-friend.C * g++.dg/cpp0x/udlit-general.C * g++.dg/cpp0x/udlit-implicit-conv-neg-char8_t.C * g++.dg/cpp0x/udlit-implicit-conv-neg.C * g++.dg/cpp0x/udlit-inline.C * g++.dg/cpp0x/udlit-mangle.C * g++.dg/cpp0x/udlit-member-neg.C * g++.dg/cpp0x/udlit-namespace.C * g++.dg/cpp0x/udlit-nofunc-neg.C * g++.dg/cpp0x/udlit-nonempty-str-neg.C * g++.dg/cpp0x/udlit-nosuffix-neg.C * g++.dg/cpp0x/udlit-nounder-neg.C * g++.dg/cpp0x/udlit-operator-neg.C * g++.dg/cpp0x/udlit-overflow-neg.C * g++.dg/cpp0x/udlit-overflow.C * g++.dg/cpp0x/udlit-preproc-neg.C * g++.dg/cpp0x/udlit-raw-length.C * g++.dg/cpp0x/udlit-raw-op-string-neg.C * g++.dg/cpp0x/udlit-raw-op.C * g++.dg/cpp0x/udlit-raw-str.C * g++.dg/cpp0x/udlit-resolve-char8_t.C * g++.dg/cpp0x/udlit-resolve.C * g++.dg/cpp0x/udlit-shadow-neg.C * g++.dg/cpp0x/udlit-string-length.C * g++.dg/cpp0x/udlit-suffix-neg.C * g++.dg/cpp0x/udlit-template.C * g++.dg/cpp0x/udlit-tmpl-arg-neg.C * g++.dg/cpp0x/udlit-tmpl-arg-neg2.C * g++.dg/cpp0x/udlit-tmpl-arg.C * g++.dg/cpp0x/udlit-tmpl-parms-neg.C * g++.dg/cpp0x/udlit-tmpl-parms.C * g++.dg/cpp1y/pr57640.C * g++.dg/cpp1y/pr88872.C * g++.dg/cpp26/unevalstr1.C * g++.dg/cpp2a/concepts-pr60391.C * g++.dg/cpp2a/consteval-prop21.C * g++.dg/cpp2a/nontype-class6.C * g++.dg/cpp2a/udlit-class-nttp-ctad-neg.C * g++.dg/cpp2a/udlit-class-nttp-ctad-neg2.C * g++.dg/cpp2a/udlit-class-nttp-ctad.C * g++.dg/cpp2a/udlit-class-nttp-neg.C * g++.dg/cpp2a/udlit-class-nttp-neg2.C * g++.dg/cpp2a/udlit-class-nttp.C * g++.dg/ext/is_convertible2.C * g++.dg/lookup/pr87269.C * g++.dg/cpp0x/udlit_system_header: Adjust for C++23 deprecated operator "" _suffix. * g++.dg/DRs/dr2521.C: New test.
2024-10-02doc: Drop h8300-hms reference to binaries downloadsGerald Pfeifer1-2/+0
gcc: PR target/69374 * doc/install.texi (Specific) <h8300-hms>: Drop obsolete reference to binaries download docs.
2024-10-02libcpp: Implement clang -Wheader-guard warning [PR96842]Jakub Jelinek1-1/+14
The following patch implements the clang -Wheader-guard warning, which warns if a valid multiple inclusion header guard's #ifndef/#if !defined directive is immediately (no other non-line directives nor other (non-comment) tokens in between) followed by #define directive for some different macro, which in get_suggestion rules is close enough to the actual header guard macro (i.e. likely misspelling), the #define is object-like with empty definition (I've followed what clang implements) and the macro isn't defined later on (at least not on the final #endif at the end of a header). In this case it emits a warning, so that #ifndef STDIO_H #define STDOI_H ... #endif or similar misspellings can be caught. clang enables this warning by default, but I've put it into -Wall instead as it still seems to be a style warning, nothing more severe; if a header doesn't survive multiple inclusion because of the misspelling, users will get different diagnostics. 2024-10-02 Jakub Jelinek <jakub@redhat.com> PR preprocessor/96842 libcpp/ * include/cpplib.h (struct cpp_options): Add warn_header_guard member. (enum cpp_warning_reason): Add CPP_W_HEADER_GUARD enumerator. * internal.h (struct cpp_reader): Add mi_def_cmacro, mi_loc and mi_def_loc members. (_cpp_defined_macro_p): Constify type pointed by argument type. Formatting fix. * init.cc (cpp_create_reader): Clear CPP_OPTION (pfile, warn_header_guard). * directives.cc (struct if_stack): Add def_loc and mi_def_cmacro members. (DIRECTIVE_TABLE): Add IF_COND flag to define. (do_define): Set ifs->mi_def_cmacro on a define immediately following #ifndef directive for the guard. Clear pfile->mi_valid. Formatting fix. (do_endif): Copy over pfile->mi_def_cmacro and pfile->mi_def_loc if ifs->mi_def_cmacro is set and pfile->mi_cmacro isn't a defined macro. (push_conditional): Clear mi_def_cmacro and mi_def_loc members. * files.cc (_cpp_pop_file_buffer): Emit -Wheader-guard diagnostics. gcc/ * doc/invoke.texi (Wheader-guard): Document. gcc/c-family/ * c.opt (Wheader-guard): New option. * c.opt.urls: Regenerated. * c-ppoutput.cc (init_pp_output): Initialize also cb->get_suggestion. gcc/testsuite/ * c-c++-common/cpp/Wheader-guard-1.c: New test. * c-c++-common/cpp/Wheader-guard-1-1.h: New test. * c-c++-common/cpp/Wheader-guard-1-2.h: New test. * c-c++-common/cpp/Wheader-guard-1-3.h: New test. * c-c++-common/cpp/Wheader-guard-1-4.h: New test. * c-c++-common/cpp/Wheader-guard-1-5.h: New test. * c-c++-common/cpp/Wheader-guard-1-6.h: New test. * c-c++-common/cpp/Wheader-guard-1-7.h: New test. * c-c++-common/cpp/Wheader-guard-1-8.h: New test. * c-c++-common/cpp/Wheader-guard-1-9.h: New test. * c-c++-common/cpp/Wheader-guard-1-10.h: New test. * c-c++-common/cpp/Wheader-guard-1-11.h: New test. * c-c++-common/cpp/Wheader-guard-1-12.h: New test. * c-c++-common/cpp/Wheader-guard-2.c: New test. * c-c++-common/cpp/Wheader-guard-2.h: New test. * c-c++-common/cpp/Wheader-guard-3.c: New test. * c-c++-common/cpp/Wheader-guard-3.h: New test.
2024-10-01c++: introduce __builtin_is_virtual_base_ofGiuseppe D'Angelo1-0/+15
P2985R0 (C++26) introduces std::is_virtual_base_of; this is the compiler builtin that will back up the library trait (which strictly requires compiler support). The name has been chosen to match LLVM/MSVC's, as per the discussion here: https://github.com/llvm/llvm-project/issues/98310 The actual user-facing type trait in libstdc++ will be added later. gcc/cp/ChangeLog: * constraint.cc (diagnose_trait_expr): New diagnostic. * cp-trait.def (IS_VIRTUAL_BASE_OF): New builtin. * cp-tree.h (enum base_access_flags): Add a new flag to be able to request a search for a virtual base class. * cxx-pretty-print.cc (pp_cxx_userdef_literal): Update the list of GNU extensions to the grammar. * search.cc (struct lookup_base_data_s): Add a field to request searching for a virtual base class. (dfs_lookup_base): Add the ability to look for a virtual base class. (lookup_base): Forward the flag to dfs_lookup_base. * semantics.cc (trait_expr_value): Implement the builtin by calling lookup_base with the new flag. (finish_trait_expr): Handle the new builtin. gcc/ChangeLog: * doc/extend.texi: Document the new __builtin_is_virtual_base_of builtin; amend the docs for __is_base_of. gcc/testsuite/ChangeLog: * g++.dg/ext/is_virtual_base_of.C: New test. * g++.dg/ext/is_virtual_base_of_diagnostic.C: New test. Signed-off-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Jason Merrill <jason@redhat.com>
2024-09-30optabs: Make all `*dot_prod_optab's modeled as conversionsVictor Do Nascimento1-24/+22
Given the specification in the GCC internals manual defines the {u|s}dot_prod<m> standard name as taking "two signed elements of the same mode, adding them to a third operand of wider mode", there is currently ambiguity in the relationship between the mode of the first two arguments and that of the third. This vagueness means that, in theory, different modes may be supportable in the third argument. This flexibility would allow for a given backend to add to the accumulator a different number of vectorized products, e.g. A backend may provide instructions for both: accum += a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3] and accum += a[0] * b[0] + a[1] * b[1], as is now seen in the SVE2.1 extension to AArch64. In spite of the aforementioned flexibility, modeling the dot-product operation as a direct optab means that we have no way to encode both input and the accumulator data modes into the backend pattern name, which prevents us from harnessing this flexibility. We therefore make all dot_prod optabs conversions, allowing, for example, for the encoding of both 2-way and 4-way dot product backend patterns. gcc/ChangeLog: * optabs.def (sdot_prod_optab): Convert from OPTAB_D to OPTAB_CD. (udot_prod_optab): Likewise. (usdot_prod_optab): Likewise. * doc/md.texi (Standard Names): update entries for u,s and us dot_prod names.
2024-09-29[PATCH] SH: Document extended asm operand modifersPietro Monteiro1-0/+29
From: Pietro Monteiro <pietro@sociotechnical.xyz> SH: Document extended asm operand modifers Tested by running "make info pdf html" and looking at the pdf and html output. I used the comment on "gcc/config/sh.cc:sh_print_operand()", SH's TARGET_PRINT_OPERAND function, as a guide. gcc/ChangeLog: * doc/extend.texi (SH Operand Modifiers): New. Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
2024-09-29doc: Document struct-layout-1.exp for ABI checksDimitar Dimitrov1-1/+17
This test helped discover PR116621, so it is worth being documented. gcc/ChangeLog: * doc/sourcebuild.texi: Document struct-layout-1.exp. Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2024-09-28doc: Remove i?86-*-linux* installation note from 2003Gerald Pfeifer1-3/+0
gcc: PR target/69374 * doc/install.texi (Specific) <i?86-*-linux*>: Remove note from 2003.
2024-09-27Fix sorting in Contributors.htmlRichard Biener1-4/+4
The following moves my entry to where it belongs alphabetically (it wasn't moved when s/Guenther/Biener/). * doc/contrib.texi (Richard Biener): Move entry.
2024-09-26tree-optimization/114855 - speed up dom_oracle::register_transitivesRichard Biener1-0/+3
dom_oracle::register_transitives contains an unbound dominator walk which for the testcase in PR114855 dominates the profile. The following fixes the unbound work done by assigning a constant work budget to the loop, bounding the number of dominators visited but also the number of relations processed. This gets both dom_oracle::register_transitives and get_immediate_dominator off the profile. I'll note that we're still doing an unbound dominator walk via equiv_set in find_equiv_dom at the start of the function and when we register a relation that also looks up the same way. At least for the testcase at hand this isn't an issue. I've also amended the guard to register_transitives with the per-basic-block limit for the number of relations registered not being exhausted. PR tree-optimization/114855 * params.opt (--param transitive-relations-work-bound): New. * doc/invoke.texi (--param transitive-relations-work-bound): Document. * value-relation.cc (dom_oracle::register_transitives): Assing an overall work budget, bounding the dominator walk and the number of relations processed. (dom_oracle::record): Only register_transitives when the number of already registered relations does not yet exceed the per-BB limit.
2024-09-26doc: Remove MinGW note on binutils 2.16Gerald Pfeifer1-4/+0
Binutils 2.16 is 13 years old; no need to specifically refer to it as a requirement. gcc: PR target/69374 * doc/install.texi (Specific) <*-*-mingw32>: Remove note regarding binutils 2.16.
2024-09-24c++: Implement C++23 P2718R0 - Wording for P2644R1 Fix for Range-based for ↵Jakub Jelinek1-2/+11
Loop [PR107637] The following patch implements the C++23 P2718R0 paper - Wording for P2644R1 Fix for Range-based for Loop. The patch introduces a new option, -f{,no-}range-for-ext-temps so that user can control the behavior even in older C++ versions. The option is on by default in C++23 and later (-fno-range-for-ext-temps is an error in that case) and in the -std=gnu++11 ... -std=gnu++20 modes (one can use -fno-range-for-ext-temps to request previous behavior in that case), and is not enabled by default in -std=c++11 ... -std=c++20 modes but one can explicitly enable it with -frange-for-ext-temps. As all the temporaries from __for_range initialization should have life extended until the end of __for_range scope, this patch disables (for -frange-for-ext-temps and if !processing_template_decl) CLEANUP_POINT_EXPR wrapping of the __for_range declaration, also disables -Wdangling-reference warning as well as the rest of extend_ref_init_temps (we know the __for_range temporary is not TREE_STATIC and as all the temporaries from the initializer will be life extended, we shouldn't try to handle temporaries referenced by references any differently) and adds an extra push_stmt_list/pop_stmt_list before cp_finish_decl of __for_range and after end of the for body and wraps all that into CLEANUP_POINT_EXPR. I had to repeat that also for OpenMP range loops because those are handled differently. 2024-09-24 Jakub Jelinek <jakub@redhat.com> PR c++/107637 gcc/ * omp-general.cc (find_combined_omp_for, find_nested_loop_xform): Handle CLEANUP_POINT_EXPR like TRY_FINALLY_EXPR. * doc/invoke.texi (frange-for-ext-temps): Document. Add -fconcepts to the C++ option list. gcc/c-family/ * c.opt (frange-for-ext-temps): New option. * c-opts.cc (c_common_post_options): Set flag_range_for_ext_temps for C++23 or later or for C++11 or later in !flag_iso mode if the option wasn't set by user. * c-cppbuiltin.cc (c_cpp_builtins): Change __cpp_range_based_for value for flag_range_for_ext_temps from 201603L to 202212L in C++17 or later. * c-omp.cc (c_find_nested_loop_xform_r): Handle CLEANUP_POINT_EXPR like TRY_FINALLY_EXPR. gcc/cp/ * cp-tree.h: Implement C++23 P2718R0 - Wording for P2644R1 Fix for Range-based for Loop. (cp_convert_omp_range_for): Add bool tmpl_p argument. (find_range_for_decls): Declare. * parser.cc (cp_convert_range_for): For flag_range_for_ext_temps call push_stmt_list () before cp_finish_decl for range_temp and save it temporarily to FOR_INIT_STMT. (cp_convert_omp_range_for): Add tmpl_p argument. If set, remember DECL_NAME of range_temp and for cp_finish_decl call restore it before clearing it again, if unset, don't adjust DECL_NAME of range_temp at all. (cp_parser_omp_loop_nest): For flag_range_for_ext_temps range for add CLEANUP_POINT_EXPR around sl. Call find_range_for_decls and adjust DECL_NAMEs for range fors if not processing_template_decl. Adjust cp_convert_omp_range_for caller. Remove superfluous backslash at the end of line. * decl.cc (initialize_local_var): For flag_range_for_ext_temps temporarily clear stmts_are_full_exprs_p rather than set for for_range__identifier decls. * call.cc (extend_ref_init_temps): For flag_range_for_ext_temps return init early for for_range__identifier decls. * semantics.cc (find_range_for_decls): New function. (finish_for_stmt): Use it. For flag_range_for_ext_temps if cp_convert_range_for set FOR_INIT_STMT, pop_stmt_list it and wrap into CLEANUP_POINT_EXPR. * pt.cc (tsubst_omp_for_iterator): Adjust tsubst_omp_for_iterator caller. (tsubst_stmt) <case OMP_FOR>: For flag_range_for_ext_temps if there are any range fors in the loop nest, add push_stmt_list starting before the initializations, pop_stmt_list it after the body and wrap into CLEANUP_POINT_EXPR. Change DECL_NAME of range for temps from NULL to for_range_identifier. gcc/testsuite/ * g++.dg/cpp23/range-for1.C: New test. * g++.dg/cpp23/range-for2.C: New test. * g++.dg/cpp23/range-for3.C: New test. * g++.dg/cpp23/range-for4.C: New test. * g++.dg/cpp23/range-for5.C: New test. * g++.dg/cpp23/range-for6.C: New test. * g++.dg/cpp23/range-for7.C: New test. * g++.dg/cpp23/range-for8.C: New test. * g++.dg/cpp23/feat-cxx2b.C (__cpp_range_based_for): Check for 202212L rather than 201603L. * g++.dg/cpp26/feat-cxx26.C (__cpp_range_based_for): Likewise. * g++.dg/warn/Wdangling-reference4.C: Don't expect warning for C++23 or newer. Use dg-additional-options rather than dg-options. libgomp/ * testsuite/libgomp.c++/range-for-1.C: New test. * testsuite/libgomp.c++/range-for-2.C: New test. * testsuite/libgomp.c++/range-for-3.C: New test. * testsuite/libgomp.c++/range-for-4.C: New test. * testsuite/libgomp.c++/range-for-5.C: New test.
2024-09-23aarch64: Add AdvSIMD faminmax intrinsicsSaurabh Jha1-0/+2
The AArch64 FEAT_FAMINMAX extension is optional from Armv9.2-a and mandatory from Armv9.5-a. It introduces instructions for computing the floating point absolute maximum and minimum of the two vectors element-wise. This patch introduces AdvSIMD faminmax intrinsics. The intrinsics of this extension are implemented as the following builtin functions: * vamax_f16 * vamaxq_f16 * vamax_f32 * vamaxq_f32 * vamaxq_f64 * vamin_f16 * vaminq_f16 * vamin_f32 * vaminq_f32 * vaminq_f64 We are defining a new way to add AArch64 AdvSIMD intrinsics by listing all the intrinsics in a .def file and then using that .def file to initialise various data structures. This would lead to more concise code and easier addition of the new AdvSIMD intrinsics in future. The faminmax intrinsics are defined using the new approach. gcc/ChangeLog: * config/aarch64/aarch64-builtins.cc (ENTRY): Macro to parse the contents of aarch64-simd-pragma-builtins.def. (ENTRY_VHSDF): Macro to parse the contents of aarch64-simd-pragma-builtins.def. (enum aarch64_builtins): New enum values for faminmax builtins via aarch64-simd-pragma-builtins.def. (enum class aarch64_builtin_signatures): Enum class to specify the number of operands a builtin will take. (struct aarch64_pragma_builtins_data): Struct to hold data from aarch64-simd-pragma-builtins.def. (aarch64_fntype): New function to define function types of intrinsics given an object of type aarch64_pragma_builtins_data. (aarch64_init_pragma_builtins): New function to define pragma builtins. (aarch64_get_pragma_builtin): New function to get a row of aarch64_pragma_builtins, given code. (handle_arm_neon_h): Modify to call aarch64_init_pragma_builtins. (aarch64_general_check_builtin_call): Modify to check whether required flag is being used for pragma builtins. (aarch64_expand_pragma_builtin): New function to emit instructions of pragma_builtin. (aarch64_general_expand_builtin): Modify to call aarch64_expand_pragma_builtin. * config/aarch64/aarch64-option-extensions.def (AARCH64_OPT_EXTENSION): Introduce new flag for this extension. * config/aarch64/aarch64-simd.md (@aarch64_<faminmax_uns_op><mode>): Instruction pattern for faminmax intrinsics. * config/aarch64/aarch64.h (TARGET_FAMINMAX): Introduce new flag for this extension. * config/aarch64/iterators.md: New iterators and unspecs. * doc/invoke.texi: Document extension in AArch64 Options. * config/aarch64/aarch64-simd-pragma-builtins.def: New file to list pragma builtins. gcc/testsuite/ChangeLog: * gcc.target/aarch64/simd/faminmax-builtins-no-flag.c: New test. * gcc.target/aarch64/simd/faminmax-builtins.c: New test.
2024-09-23dwarf2: add hooks for architecture-specific CFIsMatthieu Longo2-2/+19
Architecture-specific CFI directives are currently declared an processed among others architecture-independent CFI directives in gcc/dwarf2* files. This approach creates confusion, specifically in the case of DWARF instructions in the vendor space and using the same instruction code. Such a clash currently happen between DW_CFA_GNU_window_save (used on SPARC) and DW_CFA_AARCH64_negate_ra_state (used on AArch64), and both having the same instruction code 0x2d. Then AArch64 compilers generates a SPARC CFI directive (.cfi_window_save) instead of .cfi_negate_ra_state, contrarilly to what is expected in [DWARF for the Arm 64-bit Architecture (AArch64)](https://github.com/ ARM-software/abi-aa/blob/main/aadwarf64/aadwarf64.rst). This refactoring does not solve completely the problem, but improve the situation by moving some of the processing of those directives (more specifically their output in the assembly) to the backend via 2 target hooks: - DW_CFI_OPRND1_DESC: parse the first operand of the directive (if any). - OUTPUT_CFI_DIRECTIVE: output the CFI directive as a string. Additionally, this patch also contains a renaming of an enum used for return address mangling on AArch64. gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch64_output_cfi_directive): New hook for CFI directives. (aarch64_dw_cfi_oprnd1_desc): Same. (TARGET_OUTPUT_CFI_DIRECTIVE): Hook for output_cfi_directive. (TARGET_DW_CFI_OPRND1_DESC): Hook for dw_cfi_oprnd1_desc. * config/sparc/sparc.cc (sparc_output_cfi_directive): New hook for CFI directives. (sparc_dw_cfi_oprnd1_desc): Same. (TARGET_OUTPUT_CFI_DIRECTIVE): Hook for output_cfi_directive. (TARGET_DW_CFI_OPRND1_DESC): Hook for dw_cfi_oprnd1_desc. * coretypes.h (struct dw_cfi_node): Forward declaration of CFI type from gcc/dwarf2out.h. (enum dw_cfi_oprnd_type): Same. (enum dwarf_call_frame_info): Same. * doc/tm.texi: Regenerated from doc/tm.texi.in. * doc/tm.texi.in: Add doc for new target hooks. type of enum to allow forward declaration. * dwarf2cfi.cc (struct dw_cfi_row): Update the description for window_save and ra_mangled. (dwarf2out_frame_debug_cfa_negate_ra_state): Use AArch64 CFI directive instead of the SPARC one. (change_cfi_row): Use the right CFI directive's name for RA mangling. (output_cfi): Remove explicit architecture-specific CFI directive DW_CFA_GNU_window_save that falls into default case. (output_cfi_directive): Use target hook as default. * dwarf2out.cc (dw_cfi_oprnd1_desc): Use target hook as default. * dwarf2out.h (enum dw_cfi_oprnd_type): specify underlying type of enum to allow forward declaration. (dw_cfi_oprnd1_desc): Call target hook. (output_cfi_directive): Use dw_cfi_ref instead of struct dw_cfi_node *. * hooks.cc (hook_bool_dwcfi_dwcfioprndtyperef_false): New. (hook_bool_FILEptr_dwcfiptr_false): New. * hooks.h (hook_bool_dwcfi_dwcfioprndtyperef_false): New. (hook_bool_FILEptr_dwcfiptr_false): New. * target.def: Documentation for new hooks. include/ChangeLog: * dwarf2.h (enum dwarf_call_frame_info): specify underlying libffi/ChangeLog: * include/ffi_cfi.h (cfi_negate_ra_state): Declare AArch64 cfi directive. libgcc/ChangeLog: * config/aarch64/aarch64-asm.h (PACIASP): Replace SPARC CFI directive by AArch64 one. (AUTIASP): Same. libitm/ChangeLog: * config/aarch64/sjlj.S: Replace SPARC CFI directive by AArch64 one. gcc/testsuite/ChangeLog: * g++.target/aarch64/pr94515-1.C: Replace SPARC CFI directive by AArch64 one. * g++.target/aarch64/pr94515-2.C: Same.
2024-09-23arc: Remove mlra option [PR113954]Claudiu Zissulescu1-3/+1
The target dependent mlra option was designed to be able to quickly switch between LRA and reload. The reload register allocator step is scheduled for retirement, thus, remove the functionality of mlra, keeping it for backward compatibility. PR target/113954 gcc/ChangeLog: * config/arc/arc.cc (TARGET_LRA_P): Always return true. (arc_lra_p): Remove. * config/arc/arc.h (TARGET_LRA): Remove. * config/arc/arc.opt (mlra): Change it to do nothing. * doc/invoke.texi (mlra): Update option description. Signed-off-by: Claudiu Zissulescu <claziss@gmail.com>
2024-09-19c++: deleting explicitly-defaulted functions [PR116162]Marek Polacek1-0/+9
This PR points out the we're not implementing [dcl.fct.def.default] properly. Consider e.g. struct C { C(const C&&) = default; }; where we wrongly emit an error, but the move ctor should be just =deleted. According to [dcl.fct.def.default], if the type of the special member function differs from the type of the corresponding special member function that would have been implicitly declared in a way other than as allowed by 2.1-4, the function is defined as deleted. There's an exception for assignment operators in which case the program is ill-formed. clang++ has a warning for when we delete an explicitly-defaulted function so this patch adds it too. When the code is ill-formed, we emit an error in all modes. Otherwise, we emit a pedwarn in C++17 and a warning in C++20. PR c++/116162 gcc/c-family/ChangeLog: * c.opt (Wdefaulted-function-deleted): New. gcc/cp/ChangeLog: * class.cc (check_bases_and_members): Don't set DECL_DELETED_FN here, leave it to defaulted_late_check. * cp-tree.h (maybe_delete_defaulted_fn): Declare. (defaulted_late_check): Add a tristate parameter. * method.cc (maybe_delete_defaulted_fn): New. (defaulted_late_check): Add a tristate parameter. Call maybe_delete_defaulted_fn instead of giving an error. gcc/ChangeLog: * doc/invoke.texi: Document -Wdefaulted-function-deleted. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/defaulted15.C: Add dg-warning/dg-error. * g++.dg/cpp0x/defaulted51.C: Likewise. * g++.dg/cpp0x/defaulted52.C: Likewise. * g++.dg/cpp0x/defaulted53.C: Likewise. * g++.dg/cpp0x/defaulted54.C: Likewise. * g++.dg/cpp0x/defaulted56.C: Likewise. * g++.dg/cpp0x/defaulted57.C: Likewise. * g++.dg/cpp0x/defaulted58.C: Likewise. * g++.dg/cpp0x/defaulted59.C: Likewise. * g++.dg/cpp0x/defaulted63.C: New test. * g++.dg/cpp0x/defaulted64.C: New test. * g++.dg/cpp0x/defaulted65.C: New test. * g++.dg/cpp0x/defaulted66.C: New test. * g++.dg/cpp0x/defaulted67.C: New test. * g++.dg/cpp0x/defaulted68.C: New test. * g++.dg/cpp0x/defaulted69.C: New test. * g++.dg/cpp23/defaulted1.C: New test.
2024-09-19doc: Add more alias option and reorder Intel CPU -march documentationHaochen Jiang1-113/+121
Since r15-3539, there are requests coming in to add other alias option documentation. This patch will add all ot them, including corei7, corei7-avx, core-avx-i, core-avx2, atom, slm, gracemont and emerarldrapids. Also in the patch, I reordered that part of documentation, currently all the CPUs/products are just all over the place. I regrouped them by date-to-now products (since the very first CPU to latest Panther Lake), P-core (since the clients become hybrid cores, starting from Sapphire Rapids) and E-core (since Bonnell to latest Clearwater Forest). And in the patch, I refined the product names in documentation. gcc/ChangeLog: * doc/invoke.texi: Add corei7, corei7-avx, core-avx-i, core-avx2, atom, slm, gracemont and emerarldrapids. Reorder the -march documentation by splitting them into date-to-now products, P-core and E-core. Refine the product names in documentation.
2024-09-18Fail vectorization when not using SLP and --param vect-force-slp == 1Richard Biener1-0/+3
The following adds --param vect-force-slp to enable the transition to full SLP. Full SLP is enforced during stmt analysis where it detects failed SLP discovery and at loop analysis time where it avoids analyzing a loop with SLP disabled. Failure to SLP results in vectorization to fail. * params.opt (vect-force-slp): New param, default 0. * doc/invoke.texi (--param vect-force-slp): Document. * tree-vect-loop.cc (vect_analyze_loop_2): When analyzing without SLP but --param vect-force-slp is 1 fail. * tree-vect-stmts.cc (vect_analyze_stmt): Fail vectorization for non-SLP stmts when --param vect-force-slp is 1.
2024-09-18reload1.cc: rtl-optimization/116326 - Use RELOAD_ELIMINABLE_REGS.Georg-Johann Lay2-0/+16
The new macro is required because reload and LRA are using different representations for a multi-register frame pointer. As ELIMINABLE_REGS is used to initialize static const objects, it can't depend on -mlra. PR rtl-optimization/116326 gcc/ * reload1.cc (reg_eliminate_1): Initialize from RELOAD_ELIMINABLE_REGS if defined. * config/avr/avr.h (RELOAD_ELIMINABLE_REGS): Copy from ELIMINABLE_REGS. (ELIMINABLE_REGS): Don't mention sub-regnos of the frame pointer. * doc/tm.texi.in (Eliminating Frame Pointer and Arg Pointer) <RELOAD_ELIMINABLE_REGS>: Add documentation. * doc/tm.texi: Rebuild. gcc/testsuite/ * gcc.target/avr/torture/lra-pr116324.c: New test. * gcc.target/avr/torture/lra-pr116325.c: New test.
2024-09-18AVR: doc/install.texi - Update avr specific installation notes.Georg-Johann Lay1-11/+7
gcc/ * doc/install.texi (Host/Target specific installation notes for GCC) [avr]: Update web links to AVR-LibC and AVR Options. Remove outdated note about Binutils.
2024-09-16AVR: Update weblinks to AVR-LibC.Georg-Johann Lay3-7/+8
AVR-LibC has moved to GitHub, adjust web links: https://github.com/avrdudes/avr-libc (project) https://avrdudes.github.io/avr-libc/avr-libc-user-manual (wwwdocs) gcc/ * doc/invoke.texi (AVR Options): Update AVR-LibC weblink from nongnu.org to https://github.com/avrdudes/avr-libc * doc/extend.texi (AVR Named Address Spaces): Same. (AVR Function Attributes): Same. * doc/install.texi (Cross-Compiler-Specific Options, AVR): Same.
2024-09-12testsuite: introduce hostedlib effective targetAlexandre Oliva1-0/+4
Several C++ tests fail with --disable-hosted-libstdcxx, whether because stdc++exp gets linked in despite not being built, because standard headers are included but that are unavailable in this mode, or because headers are (mistakenly?) expected to introduce declarations such as for abort, malloc, etc, but in this mode they don't. This patch introduces an effective target for GCC test, equivalent to one that's available in the libstdc++-v3 testsuite, and arranges for all such tests to be skipped when libstdc++-v3 is not hosted. Co-Authored-By: Olivier Hainque <hainque@adacore.com> for gcc/ChangeLog * doc/sourcebuild.texi (hostedlib): New effective target. for gcc/testsuite/ChangeLog * lib/target-supports.exp (check_effective_target_hostedlib): New. * g++.dg/contracts/contracts-access1.C: Skip if !hostedlib because of libstdc++exp. * g++.dg/contracts/contracts-assume3.C: Likewise. * g++.dg/contracts/contracts-assume4.C: Likewise. * g++.dg/contracts/contracts-config1.C: Likewise. * g++.dg/contracts/contracts-constexpr1.C: Likewise. * g++.dg/contracts/contracts-deduced2.C: Likewise. * g++.dg/contracts/contracts-externC.C: Likewise. * g++.dg/contracts/contracts-friend1.C: Likewise. * g++.dg/contracts/contracts-multiline1.C: Likewise. * g++.dg/contracts/contracts-nested-class2.C: Likewise. * g++.dg/contracts/contracts-post2.C: Likewise. * g++.dg/contracts/contracts-post3.C: Likewise. * g++.dg/contracts/contracts-pre2a2.C: Likewise. * g++.dg/contracts/contracts10.C: Likewise. * g++.dg/contracts/contracts18.C: Likewise. * g++.dg/contracts/contracts19.C: Likewise. * g++.dg/contracts/contracts2.C: Likewise. * g++.dg/contracts/contracts24.C: Likewise. * g++.dg/contracts/contracts25.C: Likewise. * g++.dg/contracts/contracts3.C: Likewise. * g++.dg/contracts/contracts4.C: Likewise. * g++.dg/contracts/contracts5.C: Likewise. * g++.dg/contracts/contracts6.C: Likewise. * g++.dg/contracts/contracts7.C: Likewise. * g++.dg/contracts/contracts9.C: Likewise. * g++.dg/contracts/pr110159.C: Likewise. * g++.dg/contracts/pr115434.C: Likewise. Adjust line numbers. * c-c++-common/pr36513-2.c: Skip if !hostedlib because of unavailable headers. * c-c++-common/analyzer/pr93290.c: Likewise. * g++.dg/analyzer/pr93212.C: Likewise. * g++.dg/analyzer/vfunc-2.C: Likewise. * g++.dg/cdce3.C: Likewise. Adjust line numbers. * g++.dg/concepts/expression.C: Likewise. * g++.dg/concepts/fn3.C: Likewise. * g++.dg/concepts/fn9.C: Likewise. * g++.dg/concepts/generic-fn.C: Likewise. * g++.dg/contracts/contracts-assume2.C: Likewise. * g++.dg/contracts/contracts-ignore2.C: Likewise. * g++.dg/contracts/contracts-post7.C: Likewise. * g++.dg/contracts/contracts-pre10.C: Likewise. * g++.dg/contracts/contracts-pre2.C: Likewise. * g++.dg/contracts/contracts-pre3.C: Likewise. * g++.dg/contracts/contracts-pre4.C: Likewise. * g++.dg/contracts/contracts-pre5.C: Likewise. * g++.dg/contracts/contracts-pre7.C: Likewise. * g++.dg/contracts/contracts-pre9.C: Likewise. * g++.dg/contracts/contracts-redecl3.C: Likewise. * g++.dg/contracts/contracts-redecl4.C: Likewise. * g++.dg/contracts/contracts-redecl6.C: Likewise. * g++.dg/contracts/contracts-redecl7.C: Likewise. * g++.dg/contracts/contracts-tmpl-spec1.C: Likewise. * g++.dg/contracts/contracts-tmpl-spec2.C: Likewise. * g++.dg/contracts/contracts-tmpl-spec3.C: Likewise. * g++.dg/contracts/contracts14.C: Likewise. * g++.dg/contracts/contracts15.C: Likewise. * g++.dg/contracts/contracts16.C: Likewise. * g++.dg/contracts/contracts17.C: Likewise. * g++.dg/contracts/contracts22.C: Likewise. * g++.dg/contracts/contracts35.C: Likewise. * g++.dg/coroutines/pr100611.C: Likewise. * g++.dg/coroutines/pr100772-b.C: Likewise. * g++.dg/coroutines/pr101133.C: Likewise. * g++.dg/coroutines/pr101367.C: Likewise. * g++.dg/coroutines/pr101976.C: Likewise. * g++.dg/coroutines/pr102454.C: Likewise. * g++.dg/coroutines/pr104051.C: Likewise. * g++.dg/coroutines/pr110635.C: Likewise. * g++.dg/coroutines/pr110871.C: Likewise. Adjust line numbers. * g++.dg/coroutines/pr110872.C: Likewise. Likewise. * g++.dg/coroutines/pr94288.C: Likewise. * g++.dg/coroutines/pr95520.C: Likewise. * g++.dg/coroutines/pr95736.C: Likewise. * g++.dg/coroutines/pr97587.C: Likewise. * g++.dg/coroutines/pr99576_1.C: Likewise. * g++.dg/coroutines/pr99576_2.C: Likewise. * g++.dg/coroutines/ramp-return-a.C: Likewise. * g++.dg/coroutines/ramp-return-b.C: Likewise. * g++.dg/coroutines/ramp-return-c.C: Likewise. * g++.dg/coroutines/symmetric-transfer-00-basic.C: Likewise. * g++.dg/coroutines/torture/co-await-16-template-traits.C: Likewise. * g++.dg/coroutines/torture/co-ret-15-default-return_void.C: Likewise. * g++.dg/coroutines/torture/co-yield-04-complex-local-state.C: Likewise. * g++.dg/coroutines/torture/extern-c-coroutine.C: Likewise. * g++.dg/coroutines/torture/func-params-08.C: Likewise. * g++.dg/coroutines/torture/func-params-09-awaitable-parms.C: Likewise. * g++.dg/coroutines/torture/local-var-05-awaitable.C: Likewise. * g++.dg/coroutines/torture/pr95615-01.C: Likewise. * g++.dg/coroutines/torture/pr95615-02.C: Likewise. * g++.dg/coroutines/torture/pr95615-03.C: Likewise. * g++.dg/coroutines/torture/pr95615-04.C: Likewise. * g++.dg/coroutines/torture/pr95615-05.C: Likewise. * g++.dg/coroutines/torture/pr98704.C: Likewise. * g++.dg/cpp/pr80005.C: Likewise. * g++.dg/cpp0x/Wliteral-suffix.C: Likewise. * g++.dg/cpp0x/Wpessimizing-move2.C: Likewise. * g++.dg/cpp0x/constexpr-70001-3.C: Likewise. * g++.dg/cpp0x/constexpr-ice16.C: Likewise. * g++.dg/cpp0x/dc5.C: Likewise. * g++.dg/cpp0x/enum35.C: Likewise. * g++.dg/cpp0x/enum36.C: Likewise. * g++.dg/cpp0x/initlist-opt1.C: Likewise. * g++.dg/cpp0x/initlist-vect2.C: Likewise. * g++.dg/cpp0x/initlist13.C: Likewise. * g++.dg/cpp0x/initlist15.C: Likewise. * g++.dg/cpp0x/initlist25.C: Likewise. * g++.dg/cpp0x/initlist54.C: Likewise. * g++.dg/cpp0x/initlist92.C: Likewise. * g++.dg/cpp0x/lambda/lambda-capture-const-ref-neg.C: Likewise. * g++.dg/cpp0x/lambda/lambda-capture-const-ref.C: Likewise. * g++.dg/cpp0x/lambda/lambda-const-neg.C: Likewise. * g++.dg/cpp0x/lambda/lambda-const.C: Likewise. * g++.dg/cpp0x/lambda/lambda-deduce.C: Likewise. * g++.dg/cpp0x/lambda/lambda-in-class-neg.C: Likewise. * g++.dg/cpp0x/lambda/lambda-in-class.C: Likewise. * g++.dg/cpp0x/lambda/lambda-mixed.C: Likewise. * g++.dg/cpp0x/lambda/lambda-mutable.C: Likewise. * g++.dg/cpp0x/lambda/lambda-nested.C: Likewise. * g++.dg/cpp0x/lambda/lambda-non-const.C: Likewise. * g++.dg/cpp0x/lambda/lambda-nop.C: Likewise. * g++.dg/cpp0x/lambda/lambda-nullptr.C: Likewise. * g++.dg/cpp0x/lambda/lambda-pass.C: Likewise. * g++.dg/cpp0x/lambda/lambda-recursive.C: Likewise. * g++.dg/cpp0x/lambda/lambda-ref-default.C: Likewise. * g++.dg/cpp0x/lambda/lambda-ref.C: Likewise. * g++.dg/cpp0x/nullptr20.C: Likewise. * g++.dg/cpp0x/pr61038.C: Likewise. * g++.dg/cpp0x/rv-trivial-bug.C: Likewise. * g++.dg/cpp0x/udlit-concat-neg.C: Likewise. * g++.dg/cpp0x/udlit-concat.C: Likewise. * g++.dg/cpp0x/udlit-embed-quote.C: Likewise. * g++.dg/cpp0x/udlit-extended-id-1.C: Likewise. * g++.dg/cpp0x/udlit-general.C: Likewise. * g++.dg/cpp0x/udlit-namespace.C: Likewise. * g++.dg/cpp0x/udlit-raw-op.C: Likewise. * g++.dg/cpp0x/udlit-raw-str.C: Likewise. * g++.dg/cpp0x/udlit-resolve-char8_t.C: Likewise. * g++.dg/cpp0x/udlit-resolve.C: Likewise. * g++.dg/cpp0x/udlit-sfinae.C: Likewise. * g++.dg/cpp0x/udlit-string-literal.C: Likewise. * g++.dg/cpp0x/udlit-suffix-neg.C: Likewise. * g++.dg/cpp1y/udlit-userdef-string.C: Likewise. * g++.dg/cpp0x/udlit-template.C: Likewise. * g++.dg/cpp0x/variadic-bind.C: Likewise. * g++.dg/cpp0x/variadic-function.C: Likewise. * g++.dg/cpp0x/variadic-mem_fn.C: Likewise. * g++.dg/cpp0x/variadic-tuple.C: Likewise. * g++.dg/cpp1y/auto-fn45.C: Likewise. * g++.dg/cpp1y/complex_literals1.C: Likewise. * g++.dg/cpp1y/complex_literals1a.C: Likewise. * g++.dg/cpp1y/constexpr-66093.C: Likewise. * g++.dg/cpp1y/constexpr-assert1.C: Likewise. * g++.dg/cpp1y/constexpr-assert2.C: Likewise. * g++.dg/cpp1y/feat-cxx14.C: Likewise. * g++.dg/cpp1y/lambda-generic-69078-2.C: Likewise. * g++.dg/cpp1y/lambda-generic-x.C: Likewise. * g++.dg/cpp1y/lambda-init8.C: Likewise. * g++.dg/cpp1y/new2.C: Likewise. * g++.dg/cpp1y/nsdmi-aggr12.C: Likewise. * g++.dg/cpp1y/pr57640.C: Likewise. * g++.dg/cpp1y/pr77786.C: Likewise. * g++.dg/cpp1y/pr95226.C: Likewise. * g++.dg/cpp1y/udlit-char-template-sfinae.C: Likewise. * g++.dg/cpp1y/udlit-char-template-vs-std-literal-operator.C: Likewise. * g++.dg/cpp1z/class-deduction14.C: Likewise. * g++.dg/cpp1z/constexpr-asm-1.C: Likewise. * g++.dg/cpp1z/constexpr-asm-3.C: Likewise. * g++.dg/cpp1z/decomp37.C: Likewise. * g++.dg/cpp1z/eval-order2.C: Likewise. * g++.dg/cpp1z/feat-cxx1z.C: Likewise. * g++.dg/cpp1z/fold1.C: Likewise. * g++.dg/cpp1z/init-statement6.C: Likewise. * g++.dg/cpp1z/launder3.C: Likewise. * g++.dg/cpp1z/launder4.C: Likewise. * g++.dg/cpp1z/launder5.C: Likewise. * g++.dg/cpp1z/launder6.C: Likewise. * g++.dg/cpp1z/utf8.C: Likewise. * g++.dg/cpp23/ext-floating12.C: Likewise. * g++.dg/cpp23/feat-cxx2b.C: Likewise. * g++.dg/cpp26/constexpr-voidptr1.C: Likewise. * g++.dg/cpp26/feat-cxx26.C: Likewise. * g++.dg/cpp2a/concepts-cmath.C: Likewise. * g++.dg/cpp2a/concepts-explicit-spec1.C: Likewise. * g++.dg/cpp2a/concepts-explicit-spec4.C: Likewise. * g++.dg/cpp2a/concepts-explicit-spec5.C: Likewise. * g++.dg/cpp2a/concepts-memfun.C: Likewise. * g++.dg/cpp2a/concepts-pr67774.C: Likewise. * g++.dg/cpp2a/cond-triv2.C: Likewise. * g++.dg/cpp2a/feat-cxx2a.C: Likewise. * g++.dg/cpp2a/nontype-float1.C: Likewise. * g++.dg/diagnostic/disable.C: Likewise. * g++.dg/diagnostic/missing-header-pr110164.C: Likewise. * g++.dg/diagnostic/pr65923.C: Likewise. * g++.dg/eh/arm-vfp-unwind.C: Likewise. * g++.dg/eh/crossjump1.C: Likewise. * g++.dg/eh/omit-frame-pointer.C: Likewise. * g++.dg/eh/simd-3.C: Likewise. * g++.dg/ext/bases.C: Likewise. * g++.dg/ext/builtin-line1.C: Likewise. * g++.dg/ext/builtin10.C: Likewise. * g++.dg/ext/complex4.C: Likewise. * g++.dg/ext/has_nothrow_assign.C: Likewise. * g++.dg/ext/has_nothrow_assign_odr.C: Likewise. * g++.dg/ext/has_nothrow_constructor.C: Likewise. * g++.dg/ext/has_nothrow_constructor_odr.C: Likewise. * g++.dg/ext/has_nothrow_copy-1.C: Likewise. * g++.dg/ext/has_nothrow_copy-2.C: Likewise. * g++.dg/ext/has_nothrow_copy-3.C: Likewise. * g++.dg/ext/has_nothrow_copy-4.C: Likewise. * g++.dg/ext/has_nothrow_copy-5.C: Likewise. * g++.dg/ext/has_nothrow_copy-6.C: Likewise. * g++.dg/ext/has_nothrow_copy-7.C: Likewise. * g++.dg/ext/has_nothrow_copy_odr.C: Likewise. * g++.dg/ext/has_trivial_assign.C: Likewise. * g++.dg/ext/has_trivial_constructor.C: Likewise. * g++.dg/ext/has_trivial_copy.C: Likewise. * g++.dg/ext/has_trivial_destructor-1.C: Likewise. * g++.dg/ext/has_virtual_destructor.C: Likewise. * g++.dg/ext/is_abstract.C: Likewise. * g++.dg/ext/is_aggregate.C: Likewise. * g++.dg/ext/is_base_of.C: Likewise. * g++.dg/ext/is_class.C: Likewise. * g++.dg/ext/is_convertible2.C: Likewise. * g++.dg/ext/is_empty.C: Likewise. * g++.dg/ext/is_enum.C: Likewise. * g++.dg/ext/is_pod.C: Likewise. * g++.dg/ext/is_polymorphic.C: Likewise. * g++.dg/ext/is_union.C: Likewise. * g++.dg/ext/underlying_type10.C: Likewise. * g++.dg/ext/underlying_type4.C: Likewise. * g++.dg/gcov/gcov-14.C: Likewise. * g++.dg/gcov/gcov-18.C: Likewise. * g++.dg/gcov/pr88045.C: Likewise. * g++.dg/gcov/pr88263-2.C: Likewise. * g++.dg/gcov/pr88263.C: Likewise. * g++.dg/gomp/has_device_addr-non-lvalue-1.C: Likewise. * g++.dg/gomp/ind-base-3.C: Likewise. * g++.dg/gomp/map-assignment-1.C: Likewise. * g++.dg/gomp/map-lvalue-ref-1.C: Likewise. * g++.dg/gomp/map-ptrmem-1.C: Likewise. * g++.dg/gomp/map-ptrmem-2.C: Likewise. * g++.dg/gomp/map-static-cast-lvalue-1.C: Likewise. * g++.dg/gomp/map-ternary-1.C: Likewise. * g++.dg/gomp/member-array-2.C: Likewise. * g++.dg/gomp/pr71910.C: Likewise. * g++.dg/gomp/pr91118-1.C: Likewise. * g++.dg/gomp/sink-2.C: Likewise. * g++.dg/gomp/target-this-3.C: Likewise. * g++.dg/gomp/target-this-4.C: Likewise. * g++.dg/gomp/tile-1.C: Likewise. * g++.dg/gomp/tile-2.C: Likewise. * g++.dg/gomp/unroll-1.C: Likewise. * g++.dg/gomp/unroll-2.C: Likewise. * g++.dg/gomp/unroll-3.C: Likewise. * g++.dg/graphite/id-1.C: Likewise. * g++.dg/graphite/pr42130.C: Likewise. * g++.dg/inherit/virtual8.C: Likewise. * g++.dg/init/array4.C: Likewise. * g++.dg/init/new18.C: Likewise. * g++.dg/init/new39.C: Likewise. * g++.dg/init/new40.C: Likewise. * g++.dg/ipa/devirt-29.C: Likewise. * g++.dg/ipa/pr85549.C: Likewise. * g++.dg/lookup/missing-std-include-3.C: Likewise. * g++.dg/lookup/pr21802.C: Likewise. * g++.dg/lto/20091022-2_0.C: Likewise. * g++.dg/lto/20091219_0.C: Likewise. * g++.dg/lto/pr80287_0.C: Likewise. * g++.dg/lto/pr89358_0.C: Likewise. * g++.dg/lto/pr89358_1.C: Likewise. * g++.dg/modules/binding-1_a.H: Likewise. * g++.dg/modules/binding-1_b.H: Likewise. * g++.dg/modules/contracts-1_a.C: Likewise. * g++.dg/modules/contracts-1_b.C: Likewise. * g++.dg/modules/contracts-2_a.C: Likewise. * g++.dg/modules/contracts-2_b.C: Likewise. * g++.dg/modules/contracts-3_a.C: Likewise. * g++.dg/modules/contracts-3_b.C: Likewise. * g++.dg/modules/contracts-4_a.C: Likewise. * g++.dg/modules/contracts-4_d.C: Likewise. * g++.dg/modules/global-3_a.C: Likewise. * g++.dg/modules/hello-1_a.C: Likewise. * g++.dg/modules/hello-2_a.C: Likewise. * g++.dg/modules/hello-2_b.C: Likewise. * g++.dg/modules/iostream-1_a.H: Likewise. * g++.dg/modules/p1689-2.C: Likewise. * g++.dg/modules/part-5_c.C: Likewise. * g++.dg/modules/pr99023_a.X: Likewise. * g++.dg/modules/pr99166_a.X: Likewise. * g++.dg/modules/pr99166_b.C: Likewise. * g++.dg/modules/pr99425-2_a.X: Likewise. * g++.dg/modules/pr99425-2_b.X: Likewise. * g++.dg/modules/string-1_a.H: Likewise. * g++.dg/modules/string-1_b.C: Likewise. * g++.dg/modules/string-view1.C: Likewise. * g++.dg/modules/xtreme-header-1_a.H: Likewise. * g++.dg/modules/xtreme-header-1_b.C: Likewise. * g++.dg/modules/xtreme-header-2_a.H: Likewise. * g++.dg/modules/xtreme-header-2_b.C: Likewise. * g++.dg/modules/xtreme-header-3_a.H: Likewise. * g++.dg/modules/xtreme-header-3_b.C: Likewise. * g++.dg/modules/xtreme-header-4_a.H: Likewise. * g++.dg/modules/xtreme-header-4_b.C: Likewise. * g++.dg/modules/xtreme-header-5_a.H: Likewise. * g++.dg/modules/xtreme-header-5_b.C: Likewise. * g++.dg/modules/xtreme-header-6_a.H: Likewise. * g++.dg/modules/xtreme-header-6_b.C: Likewise. * g++.dg/modules/xtreme-header-7_a.H: Likewise. * g++.dg/modules/xtreme-header-7_b.C: Likewise. * g++.dg/modules/xtreme-header_a.H: Likewise. * g++.dg/modules/xtreme-header_b.C: Likewise. * g++.dg/modules/xtreme-tr1_a.H: Likewise. * g++.dg/modules/xtreme-tr1_b.C: Likewise. * g++.dg/opt/builtins2.C: Likewise. * g++.dg/opt/dtor4-aux.cc: Likewise. * g++.dg/opt/dtor4.C: Likewise. * g++.dg/opt/nrv17.C: Likewise. * g++.dg/opt/pr102970.C: Likewise. * g++.dg/opt/pr109434.C: Likewise. * g++.dg/opt/pr110879.C: Likewise. * g++.dg/opt/pr15551.C: Likewise. * g++.dg/opt/pr30965.C: Likewise. * g++.dg/opt/pr65074.C: Likewise. * g++.dg/opt/pr66119.C: Likewise. * g++.dg/opt/pr77844.C: Likewise. * g++.dg/opt/pr85393.C: Likewise. * g++.dg/opt/pr94223.C: Likewise. * g++.dg/other/final7.C: Likewise. * g++.dg/other/pr40561.C: Likewise. * g++.dg/parse/lookup1.C: Likewise. * g++.dg/parse/parse5.C: Likewise. * g++.dg/pch/system-1.C: Likewise. * g++.dg/pch/system-1.Hs: Likewise. * g++.dg/pch/system-2.C: Likewise. * g++.dg/pch/system-2.Hs: Likewise. * g++.dg/pr100253.C: Likewise. * g++.dg/pr104547.C: Likewise. * g++.dg/pr107087.C: Likewise. * g++.dg/pr71488.C: Likewise. * g++.dg/pr71655.C: Likewise. * g++.dg/pr79095-3.C: Likewise. * g++.dg/pr83239.C: Likewise. * g++.dg/pr99966.C: Likewise. * g++.dg/rtti/typeid4.C: Likewise. * g++.dg/spellcheck-inttypes.C: Likewise. * g++.dg/template/friend10.C: Likewise. * g++.dg/template/pr69961a.C: Likewise. * g++.dg/template/show-template-tree-3.C: Likewise. * g++.dg/tm/inherit2.C: Likewise. * g++.dg/tm/pr46270.C: Likewise. * g++.dg/torture/alias-1.C: Likewise. * g++.dg/torture/builtin-location.C: Likewise. * g++.dg/torture/pr103669.C: Likewise. * g++.dg/torture/pr104601.C: Likewise. * g++.dg/torture/pr106922.C: Likewise. * g++.dg/torture/pr111019.C: Likewise. * g++.dg/torture/pr33572.C: Likewise. * g++.dg/torture/pr33735.C: Likewise. * g++.dg/torture/pr34099.C: Likewise. * g++.dg/torture/pr39417.C: Likewise. * g++.dg/torture/pr44972.C: Likewise. * g++.dg/torture/pr46364.C: Likewise. * g++.dg/torture/pr49628.C: Likewise. * g++.dg/torture/pr49938.C: Likewise. * g++.dg/torture/pr51903.C: Likewise. * g++.dg/torture/pr54498.C: Likewise. * g++.dg/torture/pr60750.C: Likewise. * g++.dg/torture/pr67600.C: Likewise. * g++.dg/torture/pr82084.C: Likewise. * g++.dg/torture/pr86763.C: Likewise. * g++.dg/torture/pr95493-1.C: Likewise. * g++.dg/tree-ssa/allocator-opt1.C: Likewise. * g++.dg/tree-ssa/copyprop.C: Likewise. * g++.dg/tree-ssa/empty-loop.C: Likewise. * g++.dg/tree-ssa/initlist-opt1.C: Likewise. * g++.dg/tree-ssa/initlist-opt2.C: Likewise. * g++.dg/tree-ssa/initlist-opt3.C: Likewise. * g++.dg/tree-ssa/initlist-opt5.C: Likewise. * g++.dg/tree-ssa/loop-cond-split-1.C: Likewise. * g++.dg/tree-ssa/loop-split-1.C: Likewise. * g++.dg/tree-ssa/pr101839.C: Likewise. * g++.dg/tree-ssa/pr104529.C: Likewise. * g++.dg/tree-ssa/pr109849.C: Likewise. * g++.dg/tree-ssa/pr14703.C: Likewise. * g++.dg/tree-ssa/pr19786.C: Likewise. * g++.dg/tree-ssa/pr46228.C: Likewise. * g++.dg/tree-ssa/pr63841.C: Likewise. * g++.dg/tree-ssa/pr69336.C: Likewise. * g++.dg/tree-ssa/pr78847.C: Likewise. * g++.dg/tree-ssa/pr95638.C: Likewise. * g++.dg/uninit-pr105937.C: Likewise. * g++.dg/vect/pr102421.cc: Likewise. * g++.dg/vect/pr105053.cc: Likewise. * g++.dg/vect/pr33426-ivdep-4.cc: Likewise. * g++.dg/vect/pr64410.cc: Likewise. * g++.dg/vect/slp-pr87105.cc: Likewise. * g++.dg/vect/vect-novector-pragma.cc: Likewise. * g++.dg/warn/Warray-bounds-27.C: Likewise. * g++.dg/warn/Wdangling-pointer-pr110055.C: Likewise. * g++.dg/warn/Wdangling-reference10.C: Likewise. * g++.dg/warn/Wdangling-reference14.C: Likewise. * g++.dg/warn/Wdangling-reference17.C: Likewise. * g++.dg/warn/Wdangling-reference4.C: Likewise. * g++.dg/warn/Wdangling-reference5.C: Likewise. * g++.dg/warn/Wfree-nonheap-object-3.C: Likewise. * g++.dg/warn/Winline-3.C: Likewise. * g++.dg/warn/Wmemset-elt-size1.C: Likewise. * g++.dg/warn/Wparentheses-34.C: Likewise. * g++.dg/warn/Wstrict-aliasing-bogus-escape-2.C: Likewise. * g++.dg/warn/Wstrict-aliasing-bogus-escape.C: Likewise. * g++.dg/warn/Wstringop-overflow-6.C: Likewise. * g++.dg/warn/Wstringop-overflow-8.C: Likewise. * g++.dg/warn/Wstringop-overread-1.C: Likewise. * g++.dg/warn/Wuninitialized-33.C: Likewise. * g++.dg/warn/Wuninitialized-pr111123-1.C: Likewise. * g++.dg/warn/format1.C: Likewise. * g++.dg/warn/huge-val1.C: Likewise. * g++.dg/warn/string1.C: Likewise. * g++.dg/warn/uninit-pr105562.C: Likewise. * g++.old-deja/g++.benjamin/15071.C: Likewise. * g++.old-deja/g++.brendan/copy9.C: Likewise. * g++.old-deja/g++.brendan/crash15.C: Likewise. * g++.old-deja/g++.brendan/crash20.C: Likewise. * g++.old-deja/g++.brendan/crash30.C: Likewise. * g++.old-deja/g++.brendan/crash38.C: Likewise. * g++.old-deja/g++.brendan/crash39.C: Likewise. * g++.old-deja/g++.brendan/crash49.C: Likewise. * g++.old-deja/g++.brendan/crash52.C: Likewise. * g++.old-deja/g++.brendan/crash62.C: Likewise. * g++.old-deja/g++.brendan/cvt1.C: Likewise. * g++.old-deja/g++.brendan/err-msg3.C: Likewise. * g++.old-deja/g++.brendan/nest21.C: Likewise. * g++.old-deja/g++.brendan/ptolemy2.C: Likewise. * g++.old-deja/g++.jason/2371.C: Likewise. * g++.old-deja/g++.jason/template24.C: Likewise. * g++.old-deja/g++.jason/template31.C: Likewise. * g++.old-deja/g++.jason/typeid1.C: Likewise. * g++.old-deja/g++.law/arg1.C: Likewise. * g++.old-deja/g++.law/arg8.C: Likewise. * g++.old-deja/g++.law/arm12.C: Likewise. * g++.old-deja/g++.law/arm9.C: Likewise. * g++.old-deja/g++.law/bad-error7.C: Likewise. * g++.old-deja/g++.law/code-gen5.C: Likewise. * g++.old-deja/g++.law/ctors10.C: Likewise. * g++.old-deja/g++.law/ctors12.C: Likewise. * g++.old-deja/g++.law/ctors13.C: Likewise. * g++.old-deja/g++.law/ctors17.C: Likewise. * g++.old-deja/g++.law/ctors6.C: Likewise. * g++.old-deja/g++.law/cvt16.C: Likewise. * g++.old-deja/g++.law/cvt2.C: Likewise. * g++.old-deja/g++.law/cvt7.C: Likewise. * g++.old-deja/g++.law/except5.C: Likewise. * g++.old-deja/g++.law/missed-error2.C: Likewise. * g++.old-deja/g++.law/nest3.C: Likewise. * g++.old-deja/g++.law/operators32.C: Likewise. * g++.old-deja/g++.law/operators4.C: Likewise. * g++.old-deja/g++.law/vbase1.C: Likewise. * g++.old-deja/g++.law/virtual3.C: Likewise. * g++.old-deja/g++.law/visibility1.C: Likewise. * g++.old-deja/g++.law/visibility10.C: Likewise. * g++.old-deja/g++.law/visibility13.C: Likewise. * g++.old-deja/g++.law/visibility17.C: Likewise. * g++.old-deja/g++.law/visibility2.C: Likewise. * g++.old-deja/g++.law/visibility22.C: Likewise. * g++.old-deja/g++.law/visibility25.C: Likewise. * g++.old-deja/g++.law/visibility7.C: Likewise. * g++.old-deja/g++.law/weak.C: Likewise. * g++.old-deja/g++.martin/new1.C: Likewise. * g++.old-deja/g++.mike/dyncast7.C: Likewise. * g++.old-deja/g++.mike/eh13.C: Likewise. * g++.old-deja/g++.mike/eh2.C: Likewise. * g++.old-deja/g++.mike/net34.C: Likewise. * g++.old-deja/g++.mike/net46.C: Likewise. * g++.old-deja/g++.mike/p658.C: Likewise. * g++.old-deja/g++.mike/rtti1.C: Likewise. * g++.old-deja/g++.ns/using4.C: Likewise. * g++.old-deja/g++.ns/using6.C: Likewise. * g++.old-deja/g++.other/defarg6.C: Likewise. * g++.old-deja/g++.other/headers1.C: Likewise. * g++.old-deja/g++.other/init9.C: Likewise. * g++.old-deja/g++.other/inline14.C: Likewise. * g++.old-deja/g++.other/inline2.C: Likewise. * g++.old-deja/g++.other/inline7.C: Likewise. * g++.old-deja/g++.other/inline8.C: Likewise. * g++.old-deja/g++.other/optimize2.C: Likewise. * g++.old-deja/g++.other/sibcall1.C: Likewise. * g++.old-deja/g++.other/unchanging1.C: Likewise. * g++.old-deja/g++.pt/crash68.C: Likewise. * g++.old-deja/g++.pt/memtemp100.C: Likewise. * g++.old-deja/g++.robertl/eb109.C: Likewise. * g++.old-deja/g++.robertl/eb113.C: Likewise. * g++.old-deja/g++.robertl/eb115.C: Likewise. * g++.old-deja/g++.robertl/eb124.C: Likewise. * g++.old-deja/g++.robertl/eb127.C: Likewise. * g++.old-deja/g++.robertl/eb129.C: Likewise. * g++.old-deja/g++.robertl/eb129a.C: Likewise. * g++.old-deja/g++.robertl/eb130.C: Likewise. * g++.old-deja/g++.robertl/eb132.C: Likewise. * g++.old-deja/g++.robertl/eb15.C: Likewise. * g++.old-deja/g++.robertl/eb21.C: Likewise. * g++.old-deja/g++.robertl/eb24.C: Likewise. * g++.old-deja/g++.robertl/eb27.C: Likewise. * g++.old-deja/g++.robertl/eb28.C: Likewise. * g++.old-deja/g++.robertl/eb29.C: Likewise. * g++.old-deja/g++.robertl/eb3.C: Likewise. * g++.old-deja/g++.robertl/eb30.C: Likewise. * g++.old-deja/g++.robertl/eb31.C: Likewise. * g++.old-deja/g++.robertl/eb33.C: Likewise. * g++.old-deja/g++.robertl/eb36.C: Likewise. * g++.old-deja/g++.robertl/eb39.C: Likewise. * g++.old-deja/g++.robertl/eb4.C: Likewise. * g++.old-deja/g++.robertl/eb41.C: Likewise. * g++.old-deja/g++.robertl/eb43.C: Likewise. * g++.old-deja/g++.robertl/eb44.C: Likewise. * g++.old-deja/g++.robertl/eb46.C: Likewise. * g++.old-deja/g++.robertl/eb54.C: Likewise. * g++.old-deja/g++.robertl/eb55.C: Likewise. * g++.old-deja/g++.robertl/eb59.C: Likewise. * g++.old-deja/g++.robertl/eb60.C: Likewise. * g++.old-deja/g++.robertl/eb62.C: Likewise. * g++.old-deja/g++.robertl/eb66.C: Likewise. * g++.old-deja/g++.robertl/eb7.C: Likewise. * g++.old-deja/g++.robertl/eb73.C: Likewise. * g++.old-deja/g++.robertl/eb77.C: Likewise. * g++.old-deja/g++.robertl/eb79.C: Likewise. * g++.old-deja/g++.warn/iomanip.C: Likewise. * g++.target/i386/pr105638.C: Likewise. * g++.target/i386/pr110170.C: Likewise. * g++.target/i386/pr80566-1.C: Likewise. * g++.target/i386/pr80566-2.C: Likewise. * c-c++-common/analyzer/allocation-size-1.c: Skip if !hostedlib because of unavailable declarations. * c-c++-common/analyzer/allocation-size-2.c: Likewise. * c-c++-common/analyzer/allocation-size-3.c: Likewise. * c-c++-common/analyzer/allocation-size-4.c: Likewise. * c-c++-common/analyzer/analyzer-verbosity-0.c: Likewise. * c-c++-common/analyzer/analyzer-verbosity-1.c: Likewise. * c-c++-common/analyzer/analyzer-verbosity-2.c: Likewise. * c-c++-common/analyzer/analyzer-verbosity-3.c: Likewise. * c-c++-common/analyzer/call-summaries-1.c: Likewise. * c-c++-common/analyzer/call-summaries-malloc.c: Likewise. * c-c++-common/analyzer/callbacks-1.c: Likewise. * c-c++-common/analyzer/callbacks-2.c: Likewise. * c-c++-common/analyzer/capacity-1.c: Likewise. * c-c++-common/analyzer/capacity-2.c: Likewise. * c-c++-common/analyzer/capacity-3.c: Likewise. * c-c++-common/analyzer/compound-assignment-1.c: Likewise. * c-c++-common/analyzer/data-model-14.c: Likewise. * c-c++-common/analyzer/data-model-20.c: Likewise. * c-c++-common/analyzer/data-model-5d.c: Likewise. * c-c++-common/analyzer/disabling.c: Likewise. * c-c++-common/analyzer/dump-state.c: Likewise. * c-c++-common/analyzer/edges-2.c: Likewise. * c-c++-common/analyzer/first-field-2.c: Likewise. * c-c++-common/analyzer/flex-with-call-summaries.c: Likewise. * c-c++-common/analyzer/flex-without-call-summaries.c: Likewise. * c-c++-common/analyzer/flexible-array-member-1.c: Likewise. * c-c++-common/analyzer/function-ptr-2.c: Likewise. * c-c++-common/analyzer/function-ptr-3.c: Likewise. * c-c++-common/analyzer/function-ptr-4.c: Likewise. * c-c++-common/analyzer/gzio.c: Likewise. * c-c++-common/analyzer/imprecise-floating-point-1.c: Likewise. * c-c++-common/analyzer/leak-2.c: Likewise. * c-c++-common/analyzer/leak-3.c: Likewise. * c-c++-common/analyzer/leak-4.c: Likewise. * c-c++-common/analyzer/loop-0-up-to-n-by-1-with-iter-obj.c: Likewise. * c-c++-common/analyzer/loop-3.c: Likewise. * c-c++-common/analyzer/malloc-3.c: Likewise. * c-c++-common/analyzer/malloc-5.c: Likewise. * c-c++-common/analyzer/malloc-CWE-401-example.c: Likewise. * c-c++-common/analyzer/malloc-CWE-415-examples.c: Likewise. * c-c++-common/analyzer/malloc-CWE-416-examples.c: Likewise. * c-c++-common/analyzer/malloc-CWE-590-examples.c: Likewise. * c-c++-common/analyzer/malloc-callbacks.c: Likewise. * c-c++-common/analyzer/malloc-dce.c: Likewise. * c-c++-common/analyzer/malloc-dedupe-1.c: Likewise. * c-c++-common/analyzer/malloc-in-loop.c: Likewise. * c-c++-common/analyzer/malloc-ipa-1.c: Likewise. * c-c++-common/analyzer/malloc-ipa-10.c: Likewise. * c-c++-common/analyzer/malloc-ipa-11.c: Likewise. * c-c++-common/analyzer/malloc-ipa-12.c: Likewise. * c-c++-common/analyzer/malloc-ipa-13a.c: Likewise. * c-c++-common/analyzer/malloc-ipa-2.c: Likewise. * c-c++-common/analyzer/malloc-ipa-3.c: Likewise. * c-c++-common/analyzer/malloc-ipa-4.c: Likewise. * c-c++-common/analyzer/malloc-ipa-5.c: Likewise. * c-c++-common/analyzer/malloc-ipa-6.c: Likewise. * c-c++-common/analyzer/malloc-ipa-7.c: Likewise. * c-c++-common/analyzer/malloc-ipa-9.c: Likewise. * c-c++-common/analyzer/malloc-macro-inline-events.c: Likewise. * c-c++-common/analyzer/malloc-macro-separate-events.c: Likewise. * c-c++-common/analyzer/malloc-many-paths-3.c: Likewise. * c-c++-common/analyzer/malloc-meaning-1.c: Likewise. * c-c++-common/analyzer/malloc-paths-1.c: Likewise. * c-c++-common/analyzer/malloc-paths-2.c: Likewise. * c-c++-common/analyzer/malloc-paths-3.c: Likewise. * c-c++-common/analyzer/malloc-paths-4.c: Likewise. * c-c++-common/analyzer/malloc-paths-5.c: Likewise. * c-c++-common/analyzer/malloc-paths-6.c: Likewise. * c-c++-common/analyzer/malloc-paths-7.c: Likewise. * c-c++-common/analyzer/malloc-paths-8.c: Likewise. * c-c++-common/analyzer/malloc-paths-9-noexcept.c: Likewise. * c-c++-common/analyzer/malloc-sarif-1.c: Likewise. * c-c++-common/analyzer/malloc-vs-local-1a.c: Likewise. * c-c++-common/analyzer/malloc-vs-local-1b.c: Likewise. * c-c++-common/analyzer/malloc-vs-local-2.c: Likewise. * c-c++-common/analyzer/malloc-vs-local-3.c: Likewise. * c-c++-common/analyzer/out-of-bounds-1.c: Likewise. * c-c++-common/analyzer/out-of-bounds-2.c: Likewise. * c-c++-common/analyzer/out-of-bounds-diagram-3.c: Likewise. * c-c++-common/analyzer/out-of-bounds-diagram-8.c: Likewise. * c-c++-common/analyzer/paths-3.c: Likewise. * c-c++-common/analyzer/paths-6.c: Likewise. * c-c++-common/analyzer/paths-7.c: Likewise. * c-c++-common/analyzer/pr103526.c: Likewise. * c-c++-common/analyzer/pr106539.c: Likewise. * c-c++-common/analyzer/pr94399.c: Likewise. * c-c++-common/analyzer/pr94851-1.c: Likewise. * c-c++-common/analyzer/pr94851-2.c: Likewise. * c-c++-common/analyzer/pr94851-4.c: Likewise. * c-c++-common/analyzer/pr97608.c: Likewise. * c-c++-common/analyzer/pr98918.c: Likewise. * c-c++-common/analyzer/pr99716-2.c: Likewise. * c-c++-common/analyzer/pr99716-3.c: Likewise. * c-c++-common/analyzer/pragma-1.c: Likewise. * c-c++-common/analyzer/pragma-2.c: Likewise. * c-c++-common/analyzer/sarif-path-role.c: Likewise. * c-c++-common/analyzer/scope-1.c: Likewise. * c-c++-common/analyzer/strndup-1.c: Likewise. * c-c++-common/analyzer/taint-alloc-3.c: Likewise. * c-c++-common/analyzer/taint-realloc.c: Likewise. * c-c++-common/analyzer/use-after-free-3.c: Likewise. * c-c++-common/analyzer/zlib-4.c: Likewise. * c-c++-common/goacc/kernels-counter-vars-function-scope.c: Likewise. * c-c++-common/goacc/kernels-loop-2.c: Likewise. * c-c++-common/goacc/kernels-loop-3.c: Likewise. * c-c++-common/goacc/kernels-loop-data-2.c: Likewise. * c-c++-common/goacc/kernels-loop-data-enter-exit-2.c: Likewise. * c-c++-common/goacc/kernels-loop-data-enter-exit.c: Likewise. * c-c++-common/goacc/kernels-loop-data-update.c: Likewise. * c-c++-common/goacc/kernels-loop-data.c: Likewise. * c-c++-common/goacc/kernels-loop-g.c: Likewise. * c-c++-common/goacc/kernels-loop-mod-not-zero.c: Likewise. * c-c++-common/goacc/kernels-loop-n.c: Likewise. * c-c++-common/goacc/kernels-loop.c: Likewise. * c-c++-common/goacc/kernels-one-counter-var.c: Likewise. * c-c++-common/goacc/kernels-parallel-loop-data-enter-exit.c: Likewise. * c-c++-common/gomp/pr103642.c: Likewise. * c-c++-common/gomp/target-implicit-map-2.c: Likewise. * c-c++-common/simulate-thread/bitfields-4.c: Likewise. * c-c++-common/tm/malloc.c: Likewise. * g++.dg/abi/mangle36.C: Likewise. * g++.dg/abi/mangle40.C: Likewise. * g++.dg/abi/mangle41.C: Likewise. * g++.dg/analyzer/cstdlib.C: Likewise. * g++.dg/analyzer/fanalyzer-show-events-in-system-headers-default.C: Likewise. * g++.dg/analyzer/fanalyzer-show-events-in-system-headers-no.C: Likewise. * g++.dg/analyzer/fanalyzer-show-events-in-system-headers.C: Likewise. * g++.dg/analyzer/malloc.C: Likewise. * g++.dg/analyzer/new-vs-malloc.C: Likewise. * g++.dg/analyzer/placement-new-size.C: Likewise. * g++.dg/analyzer/vfunc-3.C: Likewise. * g++.dg/analyzer/vfunc-5.C: Likewise. * g++.dg/coroutines/coro-bad-gro-00-class-gro-scalar-return.C: Likewise. * g++.dg/coroutines/coro-bad-gro-01-void-gro-non-class-coro.C: Likewise. * g++.dg/coroutines/pr101765.C: Likewise. * g++.dg/coroutines/pr95477.C: Likewise. * g++.dg/coroutines/pr95599.C: Likewise. * g++.dg/coroutines/pr95711.C: Likewise. * g++.dg/coroutines/torture/alloc-00-gro-on-alloc-fail.C: Likewise. * g++.dg/coroutines/torture/alloc-01-overload-newdel.C: Likewise. * g++.dg/coroutines/torture/alloc-02-fail-new-grooaf-check.C: Likewise. * g++.dg/coroutines/torture/alloc-03-overload-new-1.C: Likewise. * g++.dg/coroutines/torture/alloc-04-overload-del-use-two-args.C: Likewise. * g++.dg/coroutines/torture/call-00-co-aw-arg.C: Likewise. * g++.dg/coroutines/torture/call-01-multiple-co-aw.C: Likewise. * g++.dg/coroutines/torture/call-02-temp-co-aw.C: Likewise. * g++.dg/coroutines/torture/call-03-temp-ref-co-aw.C: Likewise. * g++.dg/coroutines/torture/class-00-co-ret.C: Likewise. * g++.dg/coroutines/torture/class-01-co-ret-parm.C: Likewise. * g++.dg/coroutines/torture/class-02-templ-parm.C: Likewise. * g++.dg/coroutines/torture/class-03-operator-templ-parm.C: Likewise. * g++.dg/coroutines/torture/class-04-lambda-1.C: Likewise. * g++.dg/coroutines/torture/class-05-lambda-capture-copy-local.C: Likewise. * g++.dg/coroutines/torture/class-06-lambda-capture-ref.C: Likewise. * g++.dg/coroutines/torture/class-07-data-member.C: Likewise. * g++.dg/coroutines/torture/co-await-00-trivial.C: Likewise. * g++.dg/coroutines/torture/co-await-01-with-value.C: Likewise. * g++.dg/coroutines/torture/co-await-02-xform.C: Likewise. * g++.dg/coroutines/torture/co-await-03-rhs-op.C: Likewise. * g++.dg/coroutines/torture/co-await-04-control-flow.C: Likewise. * g++.dg/coroutines/torture/co-await-05-loop.C: Likewise. * g++.dg/coroutines/torture/co-await-06-ovl.C: Likewise. * g++.dg/coroutines/torture/co-await-07-tmpl.C: Likewise. * g++.dg/coroutines/torture/co-await-08-cascade.C: Likewise. * g++.dg/coroutines/torture/co-await-09-pair.C: Likewise. * g++.dg/coroutines/torture/co-await-10-template-fn-arg.C: Likewise. * g++.dg/coroutines/torture/co-await-11-forwarding.C: Likewise. * g++.dg/coroutines/torture/co-await-12-operator-2.C: Likewise. * g++.dg/coroutines/torture/co-await-13-return-ref.C: Likewise. * g++.dg/coroutines/torture/co-await-14-return-ref-to-auto.C: Likewise. * g++.dg/coroutines/torture/co-await-15-return-non-triv.C: Likewise. * g++.dg/coroutines/torture/co-await-17-capture-comp-ref.C: Likewise. * g++.dg/coroutines/torture/co-await-18-if-cond.C: Likewise. * g++.dg/coroutines/torture/co-await-19-while-cond.C: Likewise. * g++.dg/coroutines/torture/co-await-20-do-while-cond.C: Likewise. * g++.dg/coroutines/torture/co-await-21-switch-value.C: Likewise. * g++.dg/coroutines/torture/co-await-22-truth-and-of-if.C: Likewise. * g++.dg/coroutines/torture/co-await-24-for-init.C: Likewise. * g++.dg/coroutines/torture/co-await-25-for-condition.C: Likewise. * g++.dg/coroutines/torture/co-await-26-for-iteration-expr.C: Likewise. * g++.dg/coroutines/torture/co-ret-00-void-return-is-ready.C: Likewise. * g++.dg/coroutines/torture/co-ret-01-void-return-is-suspend.C: Likewise. * g++.dg/coroutines/torture/co-ret-03-different-GRO-type.C: Likewise. * g++.dg/coroutines/torture/co-ret-04-GRO-nontriv.C: Likewise. * g++.dg/coroutines/torture/co-ret-05-return-value.C: Likewise. * g++.dg/coroutines/torture/co-ret-06-template-promise-val-1.C: Likewise. * g++.dg/coroutines/torture/co-ret-07-void-cast-expr.C: Likewise. * g++.dg/coroutines/torture/co-ret-08-template-cast-ret.C: Likewise. * g++.dg/coroutines/torture/co-ret-09-bool-await-susp.C: Likewise. * g++.dg/coroutines/torture/co-ret-10-expression-evaluates-once.C: Likewise. * g++.dg/coroutines/torture/co-ret-11-co-ret-co-await.C: Likewise. * g++.dg/coroutines/torture/co-ret-12-co-ret-fun-co-await.C: Likewise. * g++.dg/coroutines/torture/co-ret-13-template-2.C: Likewise. * g++.dg/coroutines/torture/co-ret-14-template-3.C: Likewise. * g++.dg/coroutines/torture/co-ret-16-simple-control-flow.C: Likewise. * g++.dg/coroutines/torture/co-ret-17-void-ret-coro.C: Likewise. * g++.dg/coroutines/torture/co-yield-00-triv.C: Likewise. * g++.dg/coroutines/torture/co-yield-01-multi.C: Likewise. * g++.dg/coroutines/torture/co-yield-02-loop.C: Likewise. * g++.dg/coroutines/torture/co-yield-03-tmpl.C: Likewise. * g++.dg/coroutines/torture/co-yield-03-tmpl-nondependent.C: Likewise. * g++.dg/coroutines/torture/co-yield-05-co-aw.C: Likewise. * g++.dg/coroutines/torture/co-yield-06-fun-parm.C: Likewise. * g++.dg/coroutines/torture/co-yield-07-template-fn-param.C: Likewise. * g++.dg/coroutines/torture/co-yield-08-more-refs.C: Likewise. * g++.dg/coroutines/torture/co-yield-09-more-templ-refs.C: Likewise. * g++.dg/coroutines/torture/exceptions-test-0.C: Likewise. * g++.dg/coroutines/torture/exceptions-test-01-n4849-a.C: Likewise. * g++.dg/coroutines/torture/func-params-00.C: Likewise. * g++.dg/coroutines/torture/func-params-01.C: Likewise. * g++.dg/coroutines/torture/func-params-02.C: Likewise. * g++.dg/coroutines/torture/func-params-03.C: Likewise. * g++.dg/coroutines/torture/func-params-04.C: Likewise. * g++.dg/coroutines/torture/func-params-05.C: Likewise. * g++.dg/coroutines/torture/func-params-06.C: Likewise. * g++.dg/coroutines/torture/func-params-07.C: Likewise. * g++.dg/coroutines/torture/lambda-00-co-ret.C: Likewise. * g++.dg/coroutines/torture/lambda-01-co-ret-parm.C: Likewise. * g++.dg/coroutines/torture/lambda-02-co-yield-values.C: Likewise. * g++.dg/coroutines/torture/lambda-03-auto-parm-1.C: Likewise. * g++.dg/coroutines/torture/lambda-04-templ-parm.C: Likewise. * g++.dg/coroutines/torture/lambda-05-capture-copy-local.C: Likewise. * g++.dg/coroutines/torture/lambda-06-multi-capture.C: Likewise. * g++.dg/coroutines/torture/lambda-07-multi-yield.C: Likewise. * g++.dg/coroutines/torture/lambda-08-co-ret-parm-ref.C: Likewise. * g++.dg/coroutines/torture/lambda-09-init-captures.C: Likewise. * g++.dg/coroutines/torture/lambda-10-mutable.C: Likewise. * g++.dg/coroutines/torture/local-var-00-const.C: Likewise. * g++.dg/coroutines/torture/local-var-01-single.C: Likewise. * g++.dg/coroutines/torture/local-var-02-conditional.C: Likewise. * g++.dg/coroutines/torture/local-var-03-with-awaits.C: Likewise. * g++.dg/coroutines/torture/local-var-04-hiding-nested-scopes.C: Likewise. * g++.dg/coroutines/torture/local-var-06-structured-binding.C: Likewise. * g++.dg/coroutines/torture/mid-suspend-destruction-0.C: Likewise. * g++.dg/coroutines/torture/pr95003.C: Likewise. * g++.dg/coroutines/torture/pr95519-00-return_void.C: Likewise. * g++.dg/coroutines/torture/pr95519-01-initial-suspend.C: Likewise. * g++.dg/coroutines/torture/pr95519-02-final_suspend.C: Likewise. * g++.dg/coroutines/torture/pr95519-03-return-value.C: Likewise. * g++.dg/coroutines/torture/pr95519-04-yield-value.C: Likewise. * g++.dg/coroutines/torture/pr95519-05-gro.C: Likewise. * g++.dg/coroutines/torture/pr95519-06-grooaf.C: Likewise. * g++.dg/coroutines/torture/pr95519-07-unhandled-exception.C: Likewise. * g++.dg/cpp0x/lambda/lambda-std-function.C: Likewise. * g++.dg/cpp0x/lambda/lambda-this8.C: Likewise. * g++.dg/cpp0x/pr70887.C: Likewise. * g++.dg/cpp1y/lambda-generic-variadic2.C: Likewise. * g++.dg/cpp23/subscript5.C: Likewise. * g++.dg/cpp23/subscript6.C: Likewise. * g++.dg/cpp26/constexpr-new2.C: Likewise. * g++.dg/cpp2a/destroying-delete5.C: Likewise. * g++.dg/eh/filter2.C: Likewise. * g++.dg/eh/uncaught1.C: Likewise. * g++.dg/eh/uncaught2.C: Likewise. * g++.dg/expr/anew1.C: Likewise. * g++.dg/expr/anew2.C: Likewise. * g++.dg/expr/anew3.C: Likewise. * g++.dg/expr/anew4.C: Likewise. * g++.dg/ext/cleanup-10.C: Likewise. * g++.dg/ext/cleanup-11.C: Likewise. * g++.dg/ext/cleanup-5.C: Likewise. * g++.dg/ext/cleanup-8.C: Likewise. * g++.dg/ext/cleanup-9.C: Likewise. * g++.dg/ext/is_invocable2.C: Likewise. * g++.dg/goacc/pr107028-2.C: Likewise. * g++.dg/gomp/target-lambda-2.C: Likewise. * g++.dg/init/new11.C: Likewise. * g++.dg/init/value3.C: Likewise. * g++.dg/lto/pr66180_0.C: Likewise. * g++.dg/opt/eh4.C: Likewise. * g++.dg/opt/pr103989.C: Likewise. * g++.dg/opt/pr80385.C: Likewise. * g++.dg/opt/reload3.C: Likewise. * g++.dg/other/i386-1.C: Likewise. * g++.dg/other/i386-11.C: Likewise. * g++.dg/other/i386-2.C: Likewise. * g++.dg/other/i386-3.C: Likewise. * g++.dg/other/i386-4.C: Likewise. * g++.dg/other/i386-7.C: Likewise. * g++.dg/other/i386-8.C: Likewise. * g++.dg/other/mmintrin.C: Likewise. * g++.dg/other/pr34435.C: Likewise. * g++.dg/other/pr40446.C: Likewise. * g++.dg/other/pr49133.C: Likewise. * g++.dg/other/ucnid-1-utf8.C: Likewise. * g++.dg/other/ucnid-1.C: Likewise. * g++.dg/pr80481.C: Likewise. * g++.dg/torture/pr10148.C: Likewise. * g++.dg/torture/pr91334.C: Likewise. * g++.dg/torture/pr91606.C: Likewise. * g++.dg/tree-ssa/pr102216-2.C: Likewise. * g++.dg/vect/slp-pr98855.cc: Likewise. * g++.dg/warn/Wsystem-headers1a.C: Likewise. * g++.dg/warn/noreturn-1.C: Likewise. * g++.old-deja/g++.abi/arraynew.C: Likewise. * g++.old-deja/g++.abi/cxa_vec.C: Likewise. * g++.old-deja/g++.brendan/new3.C: Likewise. * g++.old-deja/g++.eh/new1.C: Likewise. * g++.old-deja/g++.eh/new2.C: Likewise. * g++.old-deja/g++.jason/template44.C: Likewise. * g++.old-deja/g++.law/arm13.C: Likewise. * g++.old-deja/g++.law/scope2.C: Likewise. * g++.old-deja/g++.mike/eh47.C: Likewise. * g++.old-deja/g++.mike/ns15.C: Likewise. * g++.old-deja/g++.mike/p710.C: Likewise. * g++.old-deja/g++.mike/p9706.C: Likewise. * g++.old-deja/g++.oliva/new1.C: Likewise. * g++.old-deja/g++.other/delete8.C: Likewise. * g++.target/i386/avx-pr54700-1.C: Likewise. * g++.target/i386/avx-pr54700-2.C: Likewise. * g++.target/i386/avx2-pr54700-1.C: Likewise. * g++.target/i386/avx2-pr54700-2.C: Likewise. * g++.target/i386/avx512bw-pr96246-2.C: Likewise. * g++.target/i386/avx512vl-pr54700-1a.C: Likewise. * g++.target/i386/avx512vl-pr54700-1b.C: Likewise. * g++.target/i386/avx512vl-pr54700-2a.C: Likewise. * g++.target/i386/avx512vl-pr54700-2b.C: Likewise. * g++.target/i386/avx512vl-pr96246-2.C: Likewise. * g++.target/i386/mvc4.C: Likewise. * g++.target/i386/pr100885.C: Likewise. * g++.target/i386/pr102166.C: Likewise. * g++.target/i386/pr103750-fwprop-1.C: Likewise. * g++.target/i386/pr105593.C: Likewise. * g++.target/i386/pr112443.C: Likewise. * g++.target/i386/pr113560.C: Likewise. * g++.target/i386/pr88152.C: Likewise. * g++.target/i386/pr88998.C: Likewise. * g++.target/i386/pr94046-1.C: Likewise. * g++.target/i386/pr94046-2.C: Likewise. * g++.target/i386/sse4_1-pr54700-1.C: Likewise. * g++.target/i386/sse4_1-pr54700-2.C: Likewise. * g++.dg/tree-ssa/pr20458.C: Skip if !hostedlib because of unavailable library definitions.
2024-09-12libcpp, v2: Add support for gnu::base64 #embed parameterJakub Jelinek1-1/+13
This patch which adds another #embed extension, gnu::base64. As mentioned in the documentation, this extension is primarily intended for use by the preprocessor, so that for the larger (say 32+ or 64+ bytes long embeds it doesn't have to emit tens of thousands or millions of comma separated string literals which would be very expensive to parse again, but can emit #embed "." __gnu__::__base64__( \ "Tm9uIGVyYW0gbsOpc2NpdXMsIEJydXRlLCBjdW0sIHF1w6Ygc3VtbWlzIGluZ8OpbmlpcyBleHF1" \ "aXNpdMOhcXVlIGRvY3Ryw61uYSBwaGlsw7Nzb3BoaSBHcsOmY28gc2VybcOzbmUgdHJhY3RhdsOt" \ "c3NlbnQsIGVhIExhdMOtbmlzIGzDrXR0ZXJpcyBtYW5kYXLDqW11cywgZm9yZSB1dCBoaWMgbm9z" \ "dGVyIGxhYm9yIGluIHbDoXJpYXMgcmVwcmVoZW5zacOzbmVzIGluY8O6cnJlcmV0LiBuYW0gcXVp" \ "YsO6c2RhbSwgZXQgaWlzIHF1aWRlbSBub24gw6FkbW9kdW0gaW5kw7NjdGlzLCB0b3R1bSBob2Mg" \ "ZMOtc3BsaWNldCBwaGlsb3NvcGjDoXJpLiBxdWlkYW0gYXV0ZW0gbm9uIHRhbSBpZCByZXByZWjD" \ "qW5kdW50LCBzaSByZW3DrXNzaXVzIGFnw6F0dXIsIHNlZCB0YW50dW0gc3TDumRpdW0gdGFtcXVl" \ "IG11bHRhbSDDs3BlcmFtIHBvbsOpbmRhbSBpbiBlbyBub24gYXJiaXRyw6FudHVyLiBlcnVudCDD" \ "qXRpYW0sIGV0IGlpIHF1aWRlbSBlcnVkw610aSBHcsOmY2lzIGzDrXR0ZXJpcywgY29udGVtbsOp" \ "bnRlcyBMYXTDrW5hcywgcXVpIHNlIGRpY2FudCBpbiBHcsOmY2lzIGxlZ8OpbmRpcyDDs3BlcmFt" \ "IG1hbGxlIGNvbnPDum1lcmUuIHBvc3Ryw6ltbyDDoWxpcXVvcyBmdXTDunJvcyBzw7pzcGljb3Is" \ "IHF1aSBtZSBhZCDDoWxpYXMgbMOtdHRlcmFzIHZvY2VudCwgZ2VudXMgaG9jIHNjcmliw6luZGks" \ "IGV0c2kgc2l0IGVsw6lnYW5zLCBwZXJzw7Nuw6YgdGFtZW4gZXQgZGlnbml0w6F0aXMgZXNzZSBu" \ "ZWdlbnQu") with the meaning don't actually load some file, instead base64 decode (RFC4648 with A-Za-z0-9+/ chars and = padding, no newlines in between) the string and use that as data. This is chosen because it should be -pedantic-errors clean, fairly cheap to decode and then in optimizing compiler could be handled as similar binary blob to normal #embed, while the data isn't left somewhere on the disk, so distcc/ccache etc. can move the preprocessed source without issues. It makes no sense to support limit and gnu::offset parameters together with it IMHO, why would somebody waste providing full data and then threw some away? prefix/suffix/if_empty are normally supported though, but not intended to be used by the preprocessor. This patch adds just the extension side, not the actual emitting of this during -E or -E -fdirectives-only for now, that will be included in the upcoming patch. Compared to the earlier posted version of this extension, this patch allows the string concatenation in the parameter argument (but still doesn't allow escapes in the string, why would anyone use them when only A-Za-z0-9+/= are valid). The patch also adds support for parsing this even in -fpreprocessed compilation. 2024-09-12 Jakub Jelinek <jakub@redhat.com> libcpp/ * internal.h (struct cpp_embed_params): Add base64 member. (_cpp_free_embed_params_tokens): Declare. * directives.cc (DIRECTIVE_TABLE): Add IN_I flag to T_EMBED. (save_token_for_embed, _cpp_free_embed_params_tokens): New functions. (EMBED_PARAMS): Add gnu::base64 entry. (_cpp_parse_embed_params): Parse gnu::base64 parameter. If -fpreprocessed without -fdirectives-only, require #embed to have gnu::base64 parameter. Diagnose conflict between gnu::base64 and limit or gnu::offset parameters. (do_embed): Use _cpp_free_embed_params_tokens. * files.cc (finish_embed, base64_dec_fn): New functions. (base64_dec): New array. (B64D0, B64D1, B64D2, B64D3): Define. (finish_base64_embed): New function. (_cpp_stack_embed): Use finish_embed. Handle params->base64 using finish_base64_embed. * macro.cc (builtin_has_embed): Call _cpp_free_embed_params_tokens. gcc/ * doc/cpp.texi (Binary Resource Inclusion): Document gnu::base64 parameter. gcc/testsuite/ * c-c++-common/cpp/embed-17.c: New test. * c-c++-common/cpp/embed-18.c: New test. * c-c++-common/cpp/embed-19.c: New test. * c-c++-common/cpp/embed-27.c: New test. * gcc.dg/cpp/embed-6.c: New test. * gcc.dg/cpp/embed-7.c: New test.
2024-09-12arm: Allow -mcpu and -march options to be unsetRichard Earnshaw1-0/+12
The compiler will warn if the architectural specification derived from a -mcpu option is not the same as that specified by -march. This is because it was never intended that the two should be used at the same time: -mcpu=<name> is supposed to be shorthand for -mtune=<name> -march=arch-of(<name>). Unfortunately, there are times when the two options passed to the compiler may come from distinct sources: one example is makefiles which accumulate options; another is the testsuite itself, when some tests require a particular architecture setting to be useful - only running the tests when the compiler/testsuite configuration exactly matched the requirements would make regression testing especially hard (we have too many permutations). So this patch allows a user to cancel any earlier setting of a particular flag and to make the compiler behave as though it was never passed. The intended usecase is (sources of options are shown in parenthesis, but that's just for grouping: (-march=armv7-a+simd) (-march=unset -mcpu=cortex-m33) The option processing logic will now simplify this to: -mcpu=cortex-m33 A useful corollary of this is that -march=armv7-a -march=unset will now cause the compiler to behave as though neither the architecture nor the CPU was ever set and to default back to the configure-time settings. gcc/ChangeLog: * config/arm/arm.h (OPTION_DEFAULT_SPECS): Allow -mcpu and -march to be unset. (ARCH_CPU_CLEANUP_SPECS): Likewise (DRIVER_SELF_SPECS): Add ARCH_CPU_CLEANUP_SPECS * doc/invoke.texi (arm: -mcpu= and -march=): Document use of 'unset'.
2024-09-12libcpp: Add support for gnu::offset #embed/__has_embed parameterJakub Jelinek1-2/+6
The following patch adds on top of the just posted #embed patch a first extension, gnu::offset which allows to seek in the data file (for seekable files, otherwise read and throw away). I think this is useful e.g. when some binary data start with some well known header which shouldn't be included in the data etc. 2024-09-12 Jakub Jelinek <jakub@redhat.com> libcpp/ * internal.h (struct cpp_embed_params): Add offset member. * directives.cc (EMBED_PARAMS): Add gnu::offset entry. (enum embed_param_kind): Add NUM_EMBED_STD_PARAMS. (_cpp_parse_embed_params): Use NUM_EMBED_STD_PARAMS rather than NUM_EMBED_PARAMS when parsing standard parameters. Parse gnu::offset parameter. * files.cc (struct _cpp_file): Add offset member. (_cpp_stack_embed): Handle params->offset. gcc/ * doc/cpp.texi (Binary Resource Inclusion): Document gnu::offset #embed parameter. gcc/testsuite/ * c-c++-common/cpp/embed-15.c: New test. * c-c++-common/cpp/embed-16.c: New test. * gcc.dg/cpp/embed-5.c: New test.
2024-09-12libcpp, c-family: Add (dumb) C23 N3017 #embed support [PR105863]Jakub Jelinek3-0/+97
The following patch implements the C23 N3017 "#embed - a scannable, tooling-friendly binary resource inclusion mechanism" paper. The implementation is intentionally dumb, in that it doesn't significantly speed up compilation of larger initializers and doesn't make it possible to use huge #embeds (like several gigabytes large, that is compile time and memory still infeasible). There are 2 reasons for this. One is that I think like it is implemented now in the patch is how we should use it for the smaller #embed sizes, dunno with which boundary, whether 32 bytes or 64 or something like that, certainly handling the single byte cases which is something that can appear anywhere in the source where constant integer literal can appear is desirable and I think for a few bytes it isn't worth it to come up with something smarter and users would like to e.g. see it in -E readably as well (perhaps the slow vs. fast boundary should be determined by command line option). And the other one is to be able to more easily find regressions in behavior caused by the optimizations, so we have something to get back in git to compare against. I'm definitely willing to work on the optimizations (likely introduce a new CPP_* token type to refer to a range of libcpp owned memory (start + size) and similarly some tree which can do the same, and can be at any time e.g. split into 2 subparts + say INTEGER_CST in between if needed say for const unsigned char d[] = { #embed "2GB.dat" prefix (0, 0, ) suffix (, [0x40000000] = 42) }; still without having to copy around huge amounts of data; STRING_CST owns the memory it points to and can be only 2GB in size), but would like to do that incrementally. And would like to first include some extensions also not included in this patch, like gnu::offset (off) parameter to allow to skip certain constant amount of bytes at the start of the files, plus gnu::base64 ("base64_encoded_data") parameter to add something which can store more efficiently large amounts of the #embed data in preprocessed source. I've been cross-checking all the tests also against the LLVM implementation https://github.com/llvm/llvm-project/pull/68620 which has been for a few hours even committed to LLVM trunk but reverted afterwards. LLVM now has the support committed and I admit I haven't rechecked whether the behavior on the below mentioned spots have been fixed in it already or not yet. The patch uses --embed-dir= option that clang plans to add above and doesn't use other variants on the search directories yet, plus there are no default directories at least for the time being where to search for embed files. So, #embed "..." works if it is found in the same directory (or relative to the current file's directory) and #embed "/..." or #embed </...> work always, but relative #embed <...> doesn't unless at least one --embed-dir= is specified. There is no reason to differentiate between system and non-system directories, so we don't need -isystem like counterpart, perhaps -iquote like counterpart could be useful in the future, dunno what else. It has --embed-directory=dir and --embed-directory dir as aliases. There are some differences beyond clang ICEs, so I'd like to point them out to make sure there is agreement on the choices in the patch. They are also mentioned in the comments of the llvm pull request. The most important is that the GCC patch (as well as the original thephd.dev LLVM branch on godbolt) expands #embed (or acts as if it is expanded) into a mere sequence of numbers like 123,2,35,26 rather then what clang effectively treats as (unsigned char)123,(unsigned char)2,(unsigned char)35,(unsigned char)26 but only does that when using integrated preprocessor, not when using -save-temps where it acts as GCC. JeanHeyd as the original author agrees that is how it is currently worded in C23. Another difference (not tested in the testsuite, not sure how to check for effective target /dev/urandom nor am sure it is desirable to check that during testsuite) is how to treat character devices, named pipes etc. (block devices are errored on). The original paper uses /dev/urandom in various examples and seems to assume that unlike regular files the devices aren't really cached, so #embed </dev/urandom> limit(1) prefix(int a = ) suffix(;) #embed </dev/urandom> limit(1) prefix(int b = ) suffix(;) usually results in a != b. That is what the godbolt thephd.dev branch implements too and what this patch does as well, but clang actually seems to just go from st.st_size == 0, ergo it must be zero-sized resource and so just copies over if_empty if present. It is really questionable what to do about the character devices/named pipes with __has_embed, for regular files the patch doesn't read anything from them, relies on st.st_size + limit for whether it is empty or non-empty. But I don't know of a way to check if read on say a character device would read anything or not (the </dev/null> limit (1) vs. </dev/zero> limit (1) cases), and if we read something, that would be better cached for later because #embed later if it reads again could read no further data even when it first read something. So, the patch currently for __has_embed just always returns 2 on the non-regular files, like the thephd.dev branch does as well and like the clang pull request as well. A question is also what to do for gnu::offset on the non-regular files even for #embed, those aren't seekable and do we want to just read and throw away the offset bytes each time we see it used? clang also chokes on the #if __has_embed (__FILE__ __limit__ (1) __prefix__ () suffix (1 / 0) \ __if_empty__ ((({{[0[0{0{0(0(0)1)1}1}]]}})))) != __STDC_EMBED_FOUND__ #error "__has_embed fail" #endif in embed-1.c, but thephd.dev branch accepts it and I don't see why it shouldn't, (({{[0[0{0{0(0(0)1)1}1}]]}}))) is a balanced token sequence and the file isn't empty, so it should just be parsed and discarded. clang also IMHO mishandles const unsigned char w[] = { #embed __FILE__ prefix([0] = 42, [15] =) limit(32) }; but again only without -save-temps, seems like it treats it as [0] = 42, [15] = (99,111,110,115,116,32,117,110,115,105,103,110,101,100, 32,99,104,97,114,32,119,91,93,32,61,32,123,10,35,101,109,98) rather than [0] = 42, [15] = 99,111,110,115,116,32,117,110,115,105,103,110,101,100, 32,99,104,97,114,32,119,91,93,32,61,32,123,10,35,101,109,98 and warns on it for -Wunused-value and just compiles it as [0] = 42, [15] = 98 And also void foo (int, int, int, int); void bar (void) { foo ( #embed __FILE__ limit (4) prefix (172 + ) suffix (+ 2) ); } is treated as 172 + (118, 111, 105, 100) + 2 rather than 172 + 118, 111, 105, 100 + 2 which clang -save-temps or GCC treats it like, so results in just one argument passed rather than 4. if (!strstr ((const char *) magna_carta, "imprisonétur")) abort (); in the testcase fails as well, but in that case calling it in gdb succeeds: p ((char *(*)(char *, char *))__strstr_sse2) (magna_carta, "imprisonétur") $2 = 0x555555558d3c <magna_carta+11564> "imprisonétur aut disseisiátur"... so I guess they are just trying to constant evaluate strstr and do it incorrectly. They started with making the optimizations together in the initial patch set, so they don't have the luxury to compare if it is just because of the optimization they are trying to do or because that is how the feature works for them. At least unless they use -save-temps for now. There is also different behavior between clang and gcc on -M or other dependency generating options. Seems clang includes the __has_embed searched files in dependencies, while my patch doesn't. But so does clang for __has_include and GCC doesn't. Emitting a hard dependency on some header just because there was __has_include/__has_embed for it seems wrong to me, because (at least when properly written) the source likely doesn't mind if the file is missing, it will do something else, so a hard error from make because of it doesn't seem right. Does make have some weaker dependencies, such that if some file can be remade it is but if it doesn't exist, it isn't fatal? I wonder whether #embed <non-existent-file> really needs to be fatal or whether we could simply after diagnosing it pretend the file exists and is empty. For #include I think fatal errors make tons of sense, but perhaps for #embed which is more localized we'd get better error reporting if we didn't bail out immediately. Note, both GCC and clang currently treat those as fatal errors. clang also added -dE option which with -E instead of preprocessing the #embed directives keeps them as is, but the preprocessed source then isn't self-contained. That option looks more harmful than useful to me. Also, it isn't clear to me from C23 whether it is possible to have __has_include/__has_c_attribute/__has_embed expressions inside of the limit #embed/__has_embed argument. 6.10.3.2/2 says that defined should not appear there (and the patch diagnoses it and testsuite tests), but for __has_include/__has_embed etc. 6.10.1/11 says: "The identifiers __has_include, __has_embed, and __has_c_attribute shall not appear in any context not mentioned in this subclause." If that subclause in that case means 6.10.1, then it presumably shouldn't appear in #embed in 6.10.3, but __has_embed is in 6.10.1... But 6.10.3.2/3 says that it should be parsed according to the 6.10.1 rules. Haven't included tests like #if __has_embed (__FILE__ limit (__has_embed (__FILE__ limit (1)))) or #embed __FILE__ limit (__has_include (__FILE__)) into the testsuite because of the doubts but I think the patch should handle those right now. The reason I've used Magna Carta text in some of the testcases is that I hope it shouldn't be copyrighted after the centuries and I'd strongly prefer not to have binary blobs in git after the xz backdoor lesson and wanted something larger which doesn't change all the time. Oh, BTW, I see in C23 draft 6.10.3.2 in Example 4 if (f_source == NULL); return 1; (note the spurious semicolon after closing paren), has that been fixed already? Like the thephd.dev and clang implementations, the patch always macro expands the whole #embed and __has_embed directives except for the embed keyword. That is most likely not what C23 says, my limited understanding right now is that in #embed one needs to parse the whole directive line with macro expansion disabled and check if it satisfies the grammar, if not, the whole directive is macro expanded, if yes, only the limit parameter argument is macro expanded and the prefix/suffix/if_empty arguments are maybe macro expanded when actually used (and not at all if unused). And I think __has_embed macro expansion has conflicting rules. 2024-09-12 Jakub Jelinek <jakub@redhat.com> PR c/105863 libcpp/ * include/cpplib.h: Implement C23 N3017 #embed - a scannable, tooling-friendly binary resource inclusion mechanism paper. (struct cpp_options): Add embed member. (enum cpp_builtin_type): Add BT_HAS_EMBED. (cpp_set_include_chains): Add another cpp_dir * argument to the declaration. * internal.h (enum include_type): Add IT_EMBED. (struct cpp_reader): Add embed_include member. (struct cpp_embed_params_tokens): New type. (struct cpp_embed_params): New type. (_cpp_get_token_no_padding): Declare. (enum _cpp_find_file_kind): Add _cpp_FFK_EMBED and _cpp_FFK_HAS_EMBED. (_cpp_stack_embed): Declare. (_cpp_parse_expr): Change return type to cpp_num_part instead of bool, change second argument from bool to const char * and add third argument. (_cpp_parse_embed_params): Declare. * directives.cc (DIRECTIVE_TABLE): Add embed entry. (end_directive): Don't call skip_rest_of_line for T_EMBED directive. (_cpp_handle_directive): Return 2 rather than 1 for T_EMBED in directives-only mode. (parse_include): Don't Call check_eol for T_EMBED directive. (skip_balanced_token_seq): New function. (EMBED_PARAMS): Define. (enum embed_param_kind): New type. (embed_params): New variable. (_cpp_parse_embed_params): New function. (do_embed): New function. (do_if): Adjust _cpp_parse_expr caller. (do_elif): Likewise. * expr.cc (parse_defined): Diagnose defined in #embed or __has_embed parameters. (_cpp_parse_expr): Change return type to cpp_num_part instead of bool, change second argument from bool to const char * and add third argument. Adjust function comment. For #embed/__has_embed parameters add an artificial CPP_OPEN_PAREN. Use the second argument DIR directly instead of string literals conditional on IS_IF. For #embed/__has_embed parameter, stop on reaching CPP_CLOSE_PAREN matching the artificial one. Diagnose negative or too large embed parameter operands. (num_binary_op): Use #embed instead of #if for diagnostics if inside #embed/__has_embed parameter. (num_div_op): Likewise. * files.cc (struct _cpp_file): Add limit member and embed bitfield. (search_cache): Add IS_EMBED argument, formatting fix. Skip over files with different file->embed from the argument. (find_file_in_dir): Don't call pch_open_file if file->embed. (_cpp_find_file): Handle _cpp_FFK_EMBED and _cpp_FFK_HAS_EMBED. (read_file_guts): Formatting fix. (has_unique_contents): Ignore file->embed files. (search_path_head): Handle IT_EMBED type. (_cpp_stack_embed): New function. (_cpp_get_file_stat): Formatting fix. (cpp_set_include_chains): Add embed argument, save it to pfile->embed_include and compute lens for the chain. * init.cc (struct lang_flags): Add embed member. (lang_defaults): Add embed initializers. (cpp_set_lang): Initialize CPP_OPTION (pfile, embed). (builtin_array): Add __has_embed entry. (cpp_init_builtins): Predefine __STDC_EMBED_NOT_FOUND__, __STDC_EMBED_FOUND__ and __STDC_EMBED_EMPTY__. * lex.cc (cpp_directive_only_process): Handle #embed. * macro.cc (cpp_get_token_no_padding): Rename to ... (_cpp_get_token_no_padding): ... this. No longer static. (builtin_has_include_1): New function. (builtin_has_include): Use it. Use _cpp_get_token_no_padding instead of cpp_get_token_no_padding. (builtin_has_embed): New function. (_cpp_builtin_macro_text): Handle BT_HAS_EMBED. gcc/ * doc/cppdiropts.texi (--embed-dir=): Document. * doc/cpp.texi (Binary Resource Inclusion): New chapter. (__has_embed): Document. * doc/invoke.texi (Directory Options): Mention --embed-dir=. * gcc.cc (cpp_unique_options): Add %{-embed*}. * genmatch.cc (main): Adjust cpp_set_include_chains caller. * incpath.h (enum incpath_kind): Add INC_EMBED. * incpath.cc (merge_include_chains): Handle INC_EMBED. (register_include_chains): Adjust cpp_set_include_chains caller. gcc/c-family/ * c.opt (-embed-dir=): New option. (-embed-directory): New alias. (-embed-directory=): New alias. * c-opts.cc (c_common_handle_option): Handle OPT__embed_dir_. gcc/testsuite/ * c-c++-common/cpp/embed-1.c: New test. * c-c++-common/cpp/embed-2.c: New test. * c-c++-common/cpp/embed-3.c: New test. * c-c++-common/cpp/embed-4.c: New test. * c-c++-common/cpp/embed-5.c: New test. * c-c++-common/cpp/embed-6.c: New test. * c-c++-common/cpp/embed-7.c: New test. * c-c++-common/cpp/embed-8.c: New test. * c-c++-common/cpp/embed-9.c: New test. * c-c++-common/cpp/embed-10.c: New test. * c-c++-common/cpp/embed-11.c: New test. * c-c++-common/cpp/embed-12.c: New test. * c-c++-common/cpp/embed-13.c: New test. * c-c++-common/cpp/embed-14.c: New test. * c-c++-common/cpp/embed-25.c: New test. * c-c++-common/cpp/embed-26.c: New test. * c-c++-common/cpp/embed-dir/embed-1.inc: New test. * c-c++-common/cpp/embed-dir/embed-3.c: New test. * c-c++-common/cpp/embed-dir/embed-4.c: New test. * c-c++-common/cpp/embed-dir/magna-carta.txt: New test. * gcc.dg/cpp/embed-1.c: New test. * gcc.dg/cpp/embed-2.c: New test. * gcc.dg/cpp/embed-3.c: New test. * gcc.dg/cpp/embed-4.c: New test. * g++.dg/cpp/embed-1.C: New test. * g++.dg/cpp/embed-2.C: New test. * g++.dg/cpp/embed-3.C: New test.
2024-09-09doc: Enhance Intel CPU documentationHaochen Jiang1-11/+14
This patch will add those recent aliased CPU names into documentation for clearness. gcc/ChangeLog: PR target/116617 * doc/invoke.texi: Add meteorlake, raptorlake and lunarlake.
2024-09-06rs6000,extend and document built-ins vec_test_lsbb_all_ones and ↵Carl Love1-0/+19
vec_test_lsbb_all_zeros The built-ins currently support vector unsigned char arguments. Extend the built-ins to also support vector signed char and vector bool char arguments. Add documentation for the Power 10 built-ins vec_test_lsbb_all_ones and vec_test_lsbb_all_zeros. The vec_test_lsbb_all_ones built-in returns 1 if the least significant bit in each byte is a 1, returns 0 otherwise. Similarly, vec_test_lsbb_all_zeros returns a 1 if the least significant bit in each byte is a zero and 0 otherwise. Add addtional test cases for the built-ins in files: gcc/testsuite/gcc.target/powerpc/lsbb.c gcc/testsuite/gcc.target/powerpc/lsbb-runnable.c gcc/ChangeLog: * config/rs6000/rs6000-overload.def (vec_test_lsbb_all_ones, vec_test_lsbb_all_zeros): Add built-in instances for vector signed char and vector bool char. * doc/extend.texi (vec_test_lsbb_all_ones, vec_test_lsbb_all_zeros): Add documentation for the existing built-ins. gcc/testsuite/ChangeLog:gcc/testsuite/ChangeLog: * gcc.target/powerpc/lsbb-runnable.c: Add test cases for the vector signed char and vector bool char instances of vec_test_lsbb_all_zeros and vec_test_lsbb_all_ones built-ins. * gcc.target/powerpc/lsbb.c: Add compile test cases for the vector signed char and vector bool char instances of vec_test_lsbb_all_zeros and vec_test_lsbb_all_ones built-ins.
2024-09-06AVR: Remove "Atmel" from header comment.Georg-Johann Lay1-1/+1
gcc/ * config/avr/avr.h: Remove "Atmel" from header comment. * config/avr/avr.cc: Same. * config/avr/avr.md: Same. * config/avr/avr.opt: Same. * config/avr/avr-dimode.md: Same. * config/avr/avr-fixed.md: Same. * config/avr/constraints.md: Same. * config/avr/predicates.md: Same. * config/avr/avr-log.cc: Same. * config/avr/avrlibc.h: Same. * config/avr/specs.h: Same. * common/config/avr/avr-common.cc: Same. * doc/install.texi: Same. * config/avr/avr-arch.h: Adjust header comment. * config/avr/avr-c.cc: Same. * config/avr/avr-mcus.def: Same. * config/avr/avr-modes.def: Same. * config/avr/avr-passes.cc: Same. * config/avr/avr-passes.def: Same. * config/avr/avr-protos.h: Same. * config/avr/driver-avr.cc: Same. * config/avr/elf.h: Same. * config/avr/gen-avr-mmcu-specs.cc: Same. * config/avr/gen-avr-mmcu-texi.cc: Same.
2024-09-05c-family: add attribute flag_enum [PR81665]Jason Merrill2-5/+13
Several PRs complain about -Wswitch warning about a case for a bitwise combination of enumerators. Clang has an attribute flag_enum to prevent this; let's adopt that approach as well. This also recognizes the attribute as [[clang::flag_enum]], introducing handling of the clang attribute namespace. PR c++/46457 PR c++/81665 gcc/c-family/ChangeLog: * c-attribs.cc (handle_flag_enum_attribute): New. (c_common_gnu_attributes): Add it. (c_common_clang_attributes, c_common_clang_attribute_table): New. * c-common.h: Declare c_common_clang_attribute_table. * c-warn.cc (c_do_switch_warnings): Handle flag_enum. gcc/c/ChangeLog: * c-objc-common.h (c_objc_attribute_table): Add c_common_clang_attribute_table. gcc/cp/ChangeLog: * cp-objcp-common.h (cp_objcp_attribute_table): Add c_common_clang_attribute_table. gcc/testsuite/ChangeLog: * c-c++-common/attr-flag-enum-1.c: New test. gcc/ChangeLog: * doc/extend.texi: Document flag_enum attribute. * doc/invoke.texi: Mention flag_enum in -Wswitch. libstdc++-v3/ChangeLog: * include/bits/regex_constants.h: Use flag_enum.
2024-09-05doc: remove stray characterMarek Polacek1-1/+1
There's an extra '+'. gcc/ChangeLog: * doc/invoke.texi: Remove an extra char in @item sme2.
2024-09-05Move from 'gcc.target/nvptx/nvptx.exp' into 'target-supports.exp' additions ↵Thomas Schwinge1-0/+14
for nvptx target gcc/testsuite/ * gcc.target/nvptx/nvptx.exp (check_effective_target_default_ptx_isa_version_at_least) (check_effective_target_default_ptx_isa_version_at_least_6_0) (check_effective_target_runtime_ptx_isa_version_at_least) (check_effective_target_runtime_ptx_alias) (add_options_for_ptx_alias): Move... * lib/target-supports.exp (check_nvptx_default_ptx_isa_version_at_least) (check_effective_target_nvptx_default_ptx_isa_version_at_least_6_0) (check_nvptx_runtime_ptx_isa_version_at_least) (check_effective_target_nvptx_runtime_alias_ptx) (add_options_for_nvptx_alias_ptx): ... here. * gcc.target/nvptx/alias-1.c: Adjust. * gcc.target/nvptx/alias-2.c: Likewise. * gcc.target/nvptx/alias-3.c: Likewise. * gcc.target/nvptx/alias-4.c: Likewise. * gcc.target/nvptx/alias-to-alias-1.c: Likewise. * gcc.target/nvptx/alias-weak-1.c: Likewise. * gcc.target/nvptx/uniform-simt-5.c: Likewise. gcc/ * doc/sourcebuild.texi (Effective-Target Keywords): Document 'nvptx_default_ptx_isa_version_at_least_6_0', 'nvptx_runtime_alias_ptx'. (Add Options): Document 'nvptx_alias_ptx'.