aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
AgeCommit message (Collapse)AuthorFilesLines
2025-01-19doc: Move modula2.org link to httpsGerald Pfeifer1-1/+1
gcc: * doc/gm2.texi (Type compatibility): Move modula2.org link to https.
2025-01-19doc: Adjust link to OpenMP specificationsGerald Pfeifer1-1/+1
gcc: * doc/extend.texi (OpenMP): Adjust link to specifications.
2025-01-18Fix bootstrap failure on SPARC with -O3 -mcpu=niagara4Eric Botcazou1-4/+18
This is a regression present on the mainline only, but the underlying issue has been latent for years: the compiler and the assembler disagree on the support of the VIS 3B SIMD ISA, the former bundling it with VIS 3 but not the latter. IMO the documentation is not very clear, so this patch just aligns the compiler with the assembler. gcc/ PR target/118512 * config/sparc/sparc-c.cc (sparc_target_macros): Deal with VIS 3B. * config/sparc/sparc.cc (dump_target_flag_bits): Likewise. (sparc_option_override): Likewise. (sparc_vis_init_builtins): Likewise. * config/sparc/sparc.md (fpcmp_vis): Replace TARGET_VIS3 with TARGET_VIS3B. (vec_cmp): Likewise. (fpcmpu_vis): Likewise. (vec_cmpu): Likewise. (vcond_mask_): Likewise. * config/sparc/sparc.opt (VIS3B): New target mask. * doc/invoke.texi (SPARC options): Document -mvis3b. gcc/testsuite/ * gcc.target/sparc/20230328-1.c: Pass -mvis3b instead of -mvis3. * gcc.target/sparc/20230328-4.c: Likewise. * gcc.target/sparc/fucmp.c: Likewise. * gcc.target/sparc/vis3misc.c: Likewise.
2025-01-18AVR: Fix a plenk in doc/invoke.texi.Georg-Johann Lay1-1/+1
gcc/ * doc/invoke.texi (AVR Options): Fix plenk at -msplit-ldst.
2025-01-17rs6000, add testcases to the overloaded vec_perm built-inCarl Love1-1/+11
The overloaded vec_perm built-in supports permuting signed and unsigned vectors of char, bool char, short int, short bool, int, bool, long long int, long long bool, int128, float and double. However, not all of the supported arguments are included in the test cases. This patch adds the missing test cases. Additionally, in the 128-bit debug print statements the expected result and the result need to be cast to unsigned long long to print correctly. The patch makes this additional change to the print statements. gcc/ChangeLog: * doc/extend.texi: Fix spelling mistake in description of the vec_sel built-in. Add documentation of the 128-bit vec_perm instance. gcc/testsuite/ChangeLog: * gcc.target/powerpc/vsx-builtin-3.c: Add vec_perm test cases for arguments of type vector signed long long int, long long bool, bool, bool short, bool char and pixel, vector unsigned long long int, unsigned int, unsigned short int, unsigned char. Cast arguments for debug prints to unsigned long long. * gcc.target/powerpc/builtins-4-int128-runnable.c: Add vec_perm test cases for signed and unsigned int128 arguments.
2025-01-16docs: Fix up inline asm documentationJakub Jelinek1-33/+41
When writing the gcc-15/changes.html patch posted earlier, I've been wondering where significant part of the Basic asm chapter went and the problem was the insertion of a new @node in the middle of the Basic Asm @node, plus not mentioning the new @node in the @menu. So the asm constexpr node was not normally visible and the Remarks for the section neither. The following patch moves it before Asm Labels, removes the spots where it described what hasn't been actually committed (constant expression can only be a container with data/size member functions) and fixes up the toplevel extended asm documentation (it was in the Basic Asm remarks and Extended Asm section's remark still said it is not valid). 2025-01-16 Jakub Jelinek <jakub@redhat.com> * doc/extend.texi (Using Assembly Language with C): Add Asm constexprs to @menu. (Basic Asm): Move @node asm constexprs before Asm Labels, rename to Asm constexprs, change wording so that it is clearer that the constant expression actually must not return a string literal, just some specific container and other wording tweaks. Only talk about top-level for basic asms in this @node, move restrictions on top-level extended asms to ... (Extended Asm): ... here.
2025-01-15doc: cleanup trailing whitespaceSam James1-3/+3
gcc/ChangeLog: * doc/extend.texi: Cleanup trailing whitespace.
2025-01-15doc: trivial grammar fixSam James1-1/+1
We say 'a constant .. expression' elsewhere. Fix the grammar. gcc/ChangeLog: * doc/extend.texi: Add 'a' for grammar fix.
2025-01-15AArch64: Deprecate -mabi=ilp32Wilco Dijkstra1-0/+2
ILP32 was originally intended to make porting to AArch64 easier. Support was never merged in the Linux kernel or GLIBC, so it has been unsupported for many years. There isn't a benefit in keeping unsupported features forever, so deprecate it now (and it could be removed in a future release). gcc: * config/aarch64/aarch64.cc (aarch64_override_options): Add warning. * doc/invoke.texi: Document -mabi=ilp32 as deprecated. gcc/testsuite: * gcc.target/aarch64/inline-mem-set-pr112804.c: Add -Wno-deprecated. * gcc.target/aarch64/pr100518.c: Likewise. * gcc.target/aarch64/pr113114.c: Likewise. * gcc.target/aarch64/pr80295.c: Likewise. * gcc.target/aarch64/pr94201.c: Likewise. * gcc.target/aarch64/pr94577.c: Likewise. * gcc.target/aarch64/sve/pr108603.c: Likewise.
2025-01-14OpenMP: New tree nodes for metadirective and dynamic selector support.Sandra Loosemore1-0/+63
This patch adds basic support for three new tree node types that will be used in subsequent patches to support OpenMP metadirectives and dynamic selectors. OMP_METADIRECTIVE is the internal representation of parsed OpenMP metadirective constructs. It's produced by the front ends and is expanded during gimplification. OMP_NEXT_VARIANT is used as a "magic cookie" for late resolution of variant constructs that cannot be fully resolved during gimplification, used to set the controlling variable of a switch statement that branches to the next alternative once the candidate list can be filtered and sorted. These nodes are expanded into constants in the ompdevlow pass. In some gimple passes, they need to be treated as constants. OMP_TARGET_DEVICE_MATCHES is a similar "magic cookie" used to resolve the target_device dynamic selector. It is wrapped in an OpenMP target construct, and can be resolved to a constant in the ompdevlow pass. gcc/ChangeLog: * doc/generic.texi (OpenMP): Document OMP_METADIRECTIVE, OMP_NEXT_VARIANT, and OMP_TARGET_DEVICE_MATCHES. * fold-const.cc (operand_compare::hash_operand): Ignore the new nodes. * gimple-expr.cc (is_gimple_val): Allow OMP_NEXT_VARIANT and OMP_TARGET_DEVICE_MATCHES. * gimple.cc (get_gimple_rhs_num_ops): OMP_NEXT_VARIANT and OMP_TARGET_DEVICE_MATCHES are both GIMPLE_SINGLE_RHS. * tree-cfg.cc (tree_node_can_be_shared): Allow sharing of OMP_NEXT_VARIANT. * tree-inline.cc (remap_gimple_op_r): Ignore subtrees of OMP_NEXT_VARIANT. * tree-pretty-print.cc (dump_generic_node): Handle OMP_METADIRECTIVE, OMP_NEXT_VARIANT, and OMP_TARGET_DEVICE_MATCHES. * tree-ssa-operands.cc (operands_scanner::get_expr_operands): Ignore operands of OMP_NEXT_VARIANT and OMP_TARGET_DEVICE_MATCHES. * tree.def (OMP_METADIRECTIVE): New. (OMP_NEXT_VARIANT): New. (OMP_TARGET_DEVICE_MATCHES): New. * tree.h (OMP_METADIRECTIVE_VARIANTS): New. (OMP_METADIRECTIVE_VARIANT_SELECTOR): New. (OMP_METADIRECTIVE_VARIANT_DIRECTIVE): New. (OMP_METADIRECTIVE_VARIANT_BODY): New. (OMP_NEXT_VARIANT_INDEX): New. (OMP_NEXT_VARIANT_STATE): New. (OMP_TARGET_DEVICE_MATCHES_SELECTOR): New. (OMP_TARGET_DEVICE_MATCHES_PROPERTIES): New. Co-Authored-By: Kwok Cheung Yeung <kcy@codesourcery.com> Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com>
2025-01-10docs: Document new hardreg PRE passAndrew Carlotti1-0/+7
gcc/ChangeLog: * doc/passes.texi: Document hardreg PRE pass.
2025-01-10docs: Add new AArch64 flagsAndrew Carlotti1-4/+18
gcc/ChangeLog: * doc/invoke.texi: Add new AArch64 flags.
2025-01-09nvptx: PTX 'alloca' for '-mptx=7.3'+, '-march=sm_52'+ [PR65181]Thomas Schwinge2-1/+18
..., and use it for '-mno-soft-stack': PTX "native" stacks. PR target/65181 gcc/ * config/nvptx/nvptx.cc (nvptx_get_drap_rtx): Handle '!TARGET_SOFT_STACK'. * config/nvptx/nvptx.md (define_c_enum "unspec"): Add 'UNSPEC_STACKSAVE', 'UNSPEC_STACKRESTORE'. (define_expand "allocate_stack", define_expand "save_stack_block") (define_expand "save_stack_block"): Handle '!TARGET_SOFT_STACK', PTX 'alloca'. (define_insn "@nvptx_alloca_<mode>") (define_insn "@nvptx_stacksave_<mode>") (define_insn "@nvptx_stackrestore_<mode>"): New. * doc/invoke.texi (Nvidia PTX Options): Update '-msoft-stack', '-mno-soft-stack'. * doc/sourcebuild.texi (nvptx-specific attributes): Document 'nvptx_runtime_alloca_ptx'. (Add Options): Document 'nvptx_alloca_ptx'. gcc/testsuite/ * gcc.target/nvptx/alloca-1.c: Evolve into... * gcc.target/nvptx/alloca-1-O0.c: ... this, ... * gcc.target/nvptx/alloca-1-O1.c: ... this, and... * gcc.target/nvptx/alloca-1-sm_30.c: ... this. * gcc.target/nvptx/vla-1.c: Evolve into... * gcc.target/nvptx/vla-1-O0.c: ... this, ... * gcc.target/nvptx/vla-1-O1.c: ... this, and... * gcc.target/nvptx/vla-1-sm_30.c: ... this. * gcc.c-torture/execute/pr36321.c: Adjust. * gcc.target/nvptx/__builtin_alloca_0-1-O0.c: Likewise. * gcc.target/nvptx/__builtin_alloca_0-1-O1.c: Likewise. * gcc.target/nvptx/__builtin_stack_save___builtin_stack_restore-1.c: Likewise. * gcc.target/nvptx/softstack.c: Likewise. * gcc.target/nvptx/__builtin_stack_save___builtin_stack_restore-1-sm_30.c: New. * gcc.target/nvptx/alloca-2-O0.c: Likewise. * gcc.target/nvptx/alloca-3-O1.c: Likewise. * gcc.target/nvptx/alloca-4-O3.c: Likewise. * gcc.target/nvptx/alloca-5.c: Likewise. * lib/target-supports.exp (check_effective_target_alloca): Adjust. (check_nvptx_default_ptx_isa_target_architecture_at_least) (check_nvptx_runtime_ptx_isa_target_architecture_at_least) (check_effective_target_nvptx_runtime_alloca_ptx) (add_options_for_nvptx_alloca_ptx): New. libgomp/ * fortran.c (omp_get_device_from_uid_): Adjust. * testsuite/libgomp.oacc-fortran/privatized-ref-2.f90: Likewise.
2025-01-08nvptx: For '-march=sm_52' and higher, default at least to '-mptx=7.3'Thomas Schwinge1-3/+3
PR target/65181 gcc/ * config/nvptx/nvptx.cc (default_ptx_version_option): For '-march=sm_52' and higher, default at least to '-mptx=7.3'. * doc/invoke.texi (Nvidia PTX Options): Update '-mptx=[...]'. gcc/testsuite/ * gcc.target/nvptx/march-map=sm_52.c: Adjust. * gcc.target/nvptx/march-map=sm_53.c: Likewise. * gcc.target/nvptx/march-map=sm_60.c: Likewise. * gcc.target/nvptx/march-map=sm_61.c: Likewise. * gcc.target/nvptx/march-map=sm_62.c: Likewise. * gcc.target/nvptx/march-map=sm_70.c: Likewise. * gcc.target/nvptx/march-map=sm_72.c: Likewise. * gcc.target/nvptx/march-map=sm_75.c: Likewise. * gcc.target/nvptx/march-map=sm_80.c: Likewise. * gcc.target/nvptx/march-map=sm_86.c: Likewise. * gcc.target/nvptx/march-map=sm_87.c: Likewise. * gcc.target/nvptx/march=sm_52.c: Likewise. * gcc.target/nvptx/march=sm_53.c: Likewise. * gcc.target/nvptx/march=sm_70.c: Likewise. * gcc.target/nvptx/march=sm_75.c: Likewise. * gcc.target/nvptx/march=sm_80.c: Likewise. * gcc.target/nvptx/mptx=_.c: Use '-march=sm_89'.
2025-01-08nvptx: Support '-mptx=7.3'Thomas Schwinge1-1/+1
gcc/ * config/nvptx/nvptx-opts.h (enum ptx_version): Add 'PTX_VERSION_7_3'. * config/nvptx/nvptx.cc (ptx_version_to_string) (ptx_version_to_number): Adjust. * config/nvptx/nvptx.h (TARGET_PTX_7_3): New. * config/nvptx/nvptx.opt (Enum(ptx_version)): Add 'EnumValue' '7.3' for 'PTX_VERSION_7_3'. * doc/invoke.texi (Nvidia PTX Options): Document '-mptx=7.3'. gcc/testsuite/ * gcc.target/nvptx/mptx=7.3.c: New.
2025-01-08nvptx: Add effective-target 'nvptx_softstack', use for effective-target 'alloca'Thomas Schwinge1-0/+3
..., and thereby making the check for effective-target 'alloca' more explicit. As of commit 5012919d0bd344ac1888e8e531072f0ccbe24d2c (Subversion r242503) "nvptx backend prerequisites for OpenMP offloading", the check for effective-target 'alloca' did "use a compile test"; let's make this more explicit: supported for '-msoft-stack', not supported otherwise. gcc/testsuite/ * lib/target-supports.exp (check_effective_target_nvptx_softstack): New. (check_effective_target_alloca) [nvptx]: Use it. gcc/ * doc/sourcebuild.texi (Effective-Target Keywords): Document 'nvptx_softstack'.
2025-01-08nvptx: Support '-march=sm_37': update '-march-map=sm_50' documentationThomas Schwinge1-1/+1
Fix-up for recent commit 7151d885c47ec93ba06f52a4be2a19a706f0750e "nvptx: Support '-march=sm_37'". gcc/ * doc/invoke.texi (Nvidia PTX Options): Update '-march-map=sm_50'.
2025-01-07[PR modula2/118010, modula2/118183] Unable to rebuild the bootstrap tools ↵Gaius Mulley1-0/+4
and Wtypemismatch This patch combines fixes for both PR-118010 (Wtypemismatch) and PR-118183 (unable to rebuild the bootstrap tools). PR-118010 required a new data type (COFF_T) to be exported from SYSTEM and used in all return types for libc.lseek. The patch also includes COFF_T implemented in mc and this data type has been propagated though the translated versions of pge and mc. Finally the patch adjusts the modula-2 declaration of location_t to reflect the new gcc 64 bit type. A new command line option -fm2-file-offset-bits= has been implemented to override the default 64 bit declaration of COFF_T. gcc/ChangeLog: PR modula2/118010 * doc/gm2.texi (Compiler options): New option -fm2-file-offset-bits=. gcc/m2/ChangeLog: PR modula2/118010 PR modula2/118183 * gm2-compiler/M2GCCDeclare.mod (Import): COffT, GetCOffTType. (DeclareDefaultSimpleTypes): Declare COFF_T. * gm2-compiler/M2GenGCC.mod (GetParamSize): Correct first parameter to BuildSize to use location rather than a token position. * gm2-compiler/M2Options.def (SetFileOffsetBits): New procedure. (GetFileOffsetBits): New procedure function. * gm2-compiler/M2Options.mod (SetFileOffsetBits): New procedure. (GetFileOffsetBits): New procedure function. (OffTBits): New variable. * gm2-compiler/M2System.def (COffT): New variable. * gm2-compiler/M2System.mod (MakeExtraSystemTypes): Declare COffT. * gm2-compiler/P1SymBuild.mod (EndBuildProcedure): Call PutProcedureDefined. * gm2-compiler/P2SymBuild.mod (Debug): Reimplement. * gm2-compiler/SymbolTable.mod (InitProcedureDeclaration): Initialize ProcedureTok. * gm2-gcc/gcctypes.def (location_t): Declare as CARDINAL64. * gm2-gcc/m2linemap.cc (m2linemap_GetLocationBinary): Add call to linemap_add indication a LC_LEAVE. * gm2-gcc/m2options.h (M2Options_SetFileOffsetBits): New procedure. (M2Options_GetFileOffsetBits): New procedure function. * gm2-gcc/m2type.cc (m2_offt_type_node): New variable. (m2type_GetCSizeTType): Reword comment. (m2type_GetCSSizeTType): Reword comment. (m2type_GetCOffTType): New function. (build_m2_offt_type_node): New function. (m2type_InitSystemTypes): Initialize m2_offt_type_node. * gm2-gcc/m2type.def (GetCSizeTType): Reword comment. (GetCOffTType): New procedure function. * gm2-gcc/m2type.h (m2type_GetCOffTType): New prototype. * gm2-lang.cc (gm2_langhook_handle_option): New clause OPT_fm2_file_offset_bits_. * gm2-libs-coroutines/SYSTEM.def: Add COFF_T to export list. * gm2-libs-iso/SYSTEM.def: Ditto. * gm2-libs-min/SYSTEM.def: Ditto. * gm2-libs/SYSTEM.def: Add COFF_T and CARDINAL64 to export list. * gm2-libs/libc.def (lseek): Change return type to COFF_T. * lang.opt (-fm2-file-offset-bits=): New option. * mc-boot-ch/Glibc.c (libc_lseek): Change result to use off_t. * mc-boot/GASCII.cc: Rebuilt. * mc-boot/GASCII.h: Ditto. * mc-boot/GArgs.cc: Ditto. * mc-boot/GArgs.h: Ditto. * mc-boot/GAssertion.cc: Ditto. * mc-boot/GAssertion.h: Ditto. * mc-boot/GBreak.cc: Ditto. * mc-boot/GBreak.h: Ditto. * mc-boot/GCOROUTINES.h: Ditto. * mc-boot/GCmdArgs.cc: Ditto. * mc-boot/GCmdArgs.h: Ditto. * mc-boot/GDebug.cc: Ditto. * mc-boot/GDebug.h: Ditto. * mc-boot/GDynamicStrings.cc: Ditto. * mc-boot/GDynamicStrings.h: Ditto. * mc-boot/GEnvironment.cc: Ditto. * mc-boot/GEnvironment.h: Ditto. * mc-boot/GFIO.cc: Ditto. * mc-boot/GFIO.h: Ditto. * mc-boot/GFormatStrings.cc: Ditto. * mc-boot/GFormatStrings.h: Ditto. * mc-boot/GFpuIO.cc: Ditto. * mc-boot/GFpuIO.h: Ditto. * mc-boot/GIO.cc: Ditto. * mc-boot/GIO.h: Ditto. * mc-boot/GIndexing.cc: Ditto. * mc-boot/GIndexing.h: Ditto. * mc-boot/GM2Dependent.cc: Ditto. * mc-boot/GM2Dependent.h: Ditto. * mc-boot/GM2EXCEPTION.cc: Ditto. * mc-boot/GM2EXCEPTION.h: Ditto. * mc-boot/GM2RTS.cc: Ditto. (M2RTS_Halt): Call libc_exit. (M2RTS_HaltC): Ditto. * mc-boot/GM2RTS.h: Rebuilt. * mc-boot/GMemUtils.cc: Ditto. * mc-boot/GMemUtils.h: Ditto. * mc-boot/GNumberIO.cc: Ditto. * mc-boot/GNumberIO.h: Ditto. * mc-boot/GPushBackInput.cc: Ditto. * mc-boot/GPushBackInput.h: Ditto. * mc-boot/GRTExceptions.cc: Ditto. * mc-boot/GRTExceptions.h: Ditto. * mc-boot/GRTco.h: Ditto. * mc-boot/GRTentity.h: Ditto. * mc-boot/GRTint.cc: Ditto. * mc-boot/GRTint.h: Ditto. * mc-boot/GSArgs.cc: Ditto. * mc-boot/GSArgs.h: Ditto. * mc-boot/GSFIO.cc: Ditto. * mc-boot/GSFIO.h: Ditto. * mc-boot/GSYSTEM.h: Ditto. * mc-boot/GSelective.h: Ditto. * mc-boot/GStdIO.cc: Ditto. * mc-boot/GStdIO.h: Ditto. * mc-boot/GStorage.cc: Ditto. * mc-boot/GStorage.h: Ditto. * mc-boot/GStrCase.cc: Ditto. * mc-boot/GStrCase.h: Ditto. * mc-boot/GStrIO.cc: Ditto. * mc-boot/GStrIO.h: Ditto. * mc-boot/GStrLib.cc: Ditto. * mc-boot/GStrLib.h: Ditto. * mc-boot/GStringConvert.cc: Ditto. * mc-boot/GStringConvert.h: Ditto. * mc-boot/GSysExceptions.h: Ditto. * mc-boot/GSysStorage.cc: Ditto. * mc-boot/GSysStorage.h: Ditto. * mc-boot/GTimeString.cc: Ditto. * mc-boot/GTimeString.h: Ditto. * mc-boot/GUnixArgs.h: Ditto. * mc-boot/Galists.cc: Ditto. * mc-boot/Galists.h: Ditto. * mc-boot/Gdecl.cc: Ditto. * mc-boot/Gdecl.h: Rebuilt. * mc-boot/Gdtoa.h: Ditto. * mc-boot/Gerrno.h: Ditto. * mc-boot/Gkeyc.cc: Ditto. * mc-boot/Gkeyc.h: Rebuilt. * mc-boot/Gldtoa.h: Ditto. * mc-boot/Glibc.h: Ditto. * mc-boot/Glibm.h: Ditto. * mc-boot/Glists.cc: Ditto. * mc-boot/Glists.h: Ditto. * mc-boot/GmcComment.cc: Ditto. * mc-boot/GmcComment.h: Ditto. * mc-boot/GmcComp.cc: Ditto. * mc-boot/GmcComp.h: Ditto. * mc-boot/GmcDebug.cc: Ditto. * mc-boot/GmcDebug.h: Ditto. * mc-boot/GmcError.cc: Ditto. * mc-boot/GmcError.h: Ditto. * mc-boot/GmcFileName.cc: Ditto. * mc-boot/GmcFileName.h: Ditto. * mc-boot/GmcLexBuf.cc: Ditto. * mc-boot/GmcLexBuf.h: Ditto. * mc-boot/GmcMetaError.cc: Ditto. * mc-boot/GmcMetaError.h: Ditto. * mc-boot/GmcOptions.cc: Ditto. * mc-boot/GmcOptions.h: Ditto. * mc-boot/GmcPreprocess.cc: Ditto. * mc-boot/GmcPreprocess.h: Ditto. * mc-boot/GmcPretty.cc: Ditto. * mc-boot/GmcPretty.h: Ditto. * mc-boot/GmcPrintf.cc: Ditto. * mc-boot/GmcPrintf.h: Ditto. * mc-boot/GmcQuiet.cc: Ditto. * mc-boot/GmcQuiet.h: Ditto. * mc-boot/GmcReserved.cc: Ditto. * mc-boot/GmcReserved.h: Ditto. * mc-boot/GmcSearch.cc: Ditto. * mc-boot/GmcSearch.h: Ditto. * mc-boot/GmcStack.cc: Ditto. * mc-boot/GmcStack.h: Ditto. * mc-boot/GmcStream.cc: Ditto. * mc-boot/GmcStream.h: Ditto. * mc-boot/Gmcflex.h: Ditto. * mc-boot/Gmcp1.cc: Ditto. * mc-boot/Gmcp1.h: Ditto. * mc-boot/Gmcp2.cc: Ditto. * mc-boot/Gmcp2.h: Ditto. * mc-boot/Gmcp3.cc: Ditto. * mc-boot/Gmcp3.h: Ditto. * mc-boot/Gmcp4.cc: Ditto. * mc-boot/Gmcp4.h: Ditto. * mc-boot/Gmcp5.cc: Ditto. * mc-boot/Gmcp5.h: Ditto. * mc-boot/GnameKey.cc: Ditto. * mc-boot/GnameKey.h: Ditto. * mc-boot/GsymbolKey.cc: Ditto. * mc-boot/GsymbolKey.h: Ditto. * mc-boot/Gtermios.h: Ditto. * mc-boot/Gtop.cc: Ditto. * mc-boot/Gvarargs.cc: Ditto. * mc-boot/Gvarargs.h: Ditto. * mc-boot/Gwlists.cc: Ditto. * mc-boot/Gwlists.h: Ditto. * mc-boot/Gwrapc.h: Ditto. * mc/decl.mod (cofft): New enum. (cardinal64): Ditto. (cofftN): New variable. (cardinal64N): Ditto. (isProcedure): Remove. (getSymName): Add clause for cofft and cardinal64. (makeBase): Ditto. (isOrdinal): Ditto. (getType): Ditto. (doGetExprType): Ditto. (getScope): Ditto. (doExprC): Ditto. (isSystem): Ditto. (doSystemC): Ditto. (doDependants): Ditto. (visitDependants): Ditto. (genKind): Ditto. (doSystemM2): Ditto. (doDupExpr): Ditto. (makeSystem): Initialize cofftN and cardinal64N. * mc/keyc.mod (useUIntMin): Remove. (useUIntMax): Ditto. * pge-boot/GIndexing.h: Rebuilt. * pge-boot/GSEnvironment.h: Ditto. * pge-boot/GScan.h: Ditto. * pge-boot/Glibc.h: Ditto. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2025-01-02[GCN] install.texi: Refer to Newlib 4.5.0 instead to certain git commitsTobias Burnus1-3/+2
gcc/ChangeLog: * doc/install.texi (amdgcn-x-amdhsa): Refer to Newlib 4.5.0 for the I/O locking fixes.
2025-01-02Update copyright years.Jakub Jelinek77-81/+81
2025-01-02Use u'' instead of '' in libgdiagnostics/conf.pyJakub Jelinek1-2/+2
libgdiagnostics/conf.py breaks update-copyright.py --this-year, which only accepts copyright year in u'' literals in python files, not in ''. 2025-01-02 Jakub Jelinek <jakub@redhat.com> * doc/libgdiagnostics/conf.py: Use u'' instead of '' in project and copyright initialization.
2025-01-02Update copyright dates.Jakub Jelinek7-9/+9
Manual part of copyright year updates. 2025-01-02 Jakub Jelinek <jakub@redhat.com> gcc/ * gcc.cc (process_command): Update copyright notice dates. * gcov-dump.cc (print_version): Ditto. * gcov.cc (print_version): Ditto. * gcov-tool.cc (print_version): Ditto. * gengtype.cc (create_file): Ditto. * doc/cpp.texi: Bump @copying's copyright year. * doc/cppinternals.texi: Ditto. * doc/gcc.texi: Ditto. * doc/gccint.texi: Ditto. * doc/gcov.texi: Ditto. * doc/install.texi: Ditto. * doc/invoke.texi: Ditto. gcc/ada/ * gnat_ugn.texi: Bump @copying's copyright year. * gnat_rm.texi: Likewise. gcc/d/ * gdc.texi: Bump @copyrights-d year. gcc/fortran/ * gfortranspec.cc (lang_specific_driver): Update copyright notice dates. * gfc-internals.texi: Bump @copying's copyright year. * gfortran.texi: Ditto. * intrinsic.texi: Ditto. * invoke.texi: Ditto. gcc/go/ * gccgo.texi: Bump @copyrights-go year. libgomp/ * libgomp.texi: Bump @copying's copyright year. libitm/ * libitm.texi: Bump @copying's copyright year. libquadmath/ * libquadmath.texi: Bump @copying's copyright year.
2025-01-01doc: cpp: fix version test example syntaxSam James1-1/+1
gcc/ChangeLog: * doc/cpp.texi (Common Predefined Macros): Fix syntax.
2025-01-01Documentation: Fix Machine-Dependent Options orderingSandra Loosemore1-167/+168
Per comments in invoke.texi, target option groups in the Option Summary section are supposed to be alphabetized and in the same order as the documentation sections they refer to. "M32C Options" was misordered in the Option Summary. "Cygwin and MinGW Options" was ordered incorrectly in both places, which also caused Texinfo diagnostics because the ordering in the menu (which was correctly alphabetized) didn't match the node order. I also added a reference to the appropriate section to each entry in the Option Summary so that you can go directly to the detailed description for that set of target options. I'm not real happy with the formatting of the tables in that section but the experiments I tried all looked worse. :-( gcc/ChangeLog * doc/invoke.texi (Option Summary): Put "M32C Options" and "Cygwin and MinGW Options" in alphabetical order. Add cross-references. (Cygwin and MinGW Options): Likewise move the section to its correct alphabetical location. * config/lynx.opt.urls: Regenerated. * config/mingw/cygming.opt.urls: Regenerated.
2024-12-30Don't include subst attributes in "@" md helpersRichard Sandiford1-0/+5
In a later patch, I need to add "@" to a pattern that uses subst attributes. This combination is problematic for two reasons: (1) define_substs are applied and filtered at a later stage than the handling of "@" patterns, so that the handling of "@" patterns doesn't know which subst variants are valid and which will later be dropped. Just adding a "@" therefore triggers a build error due to references to non-existent patterns. (2) Currently, the code will treat a single "@" pattern as contributing to a single set of overloaded functions. These overloaded functions will have an integer argument for every subst attribute. For example, the vczle and vczbe in: "@aarch64_rev<REVERSE:rev_op><mode><vczle><vczbe>" are subst attributes, and so currently we'd try to generate a single set of overloads that take four arguments: one for rev_op, one for the mode, one for vczle, and one for vczbe. The gen_* and maybe_gen_* functions will also have one rtx argument for each operand in the original pattern. This model doesn't really make sense for define_substs, since define_substs are allowed to add extra operands to an instruction. The number of rtx operands to the generators would then be incorrect. I think a more sensible way of handling define_substs would be to apply them first (and thus expand things like <vczle> and <vczbe> above) and then apply "@". However, that's a relatively invasive change and not suitable for stage 3. This patch instead skips over subst attributes and restricts "@" overload handling to the cases where no define_subst is applied. I looked through all uses of "@" names in target code and there seemed to be only one current use of "@" with define_substs, in x86 vector code. The current behaviour seemed to be unwanted there, and the x86 code was having to work around it. gcc/ * read-rtl.cc (md_reader::handle_overloaded_name): Don't add arguments for uses of subst attributes. (apply_iterators): Only add instructions to an overloaded helper if they use the default subst iterator values. * doc/md.texi: Update documentation accordingly. * config/i386/i386-expand.cc (expand_vec_perm_broadcast_1): Update accordingly.
2024-12-28doc: Simplify references to PTFs for AIXGerald Pfeifer1-9/+5
gcc: * doc/install.texi (Specific) <*-ibm-aix*>: Drop verbose references to PTFs for AIX.
2024-12-26doc: Move Modula 2 PM4 link to httpsGerald Pfeifer1-1/+1
gcc: * doc/gm2.texi (Dialect): Move PM4 link to https.
2024-12-23doc: Remove references to HP-UX 8 and HP-UX 9Gerald Pfeifer1-2/+1
gcc: * doc/invoke.texi (HPPA Options): Remove references to HP-UX 8 and HP-UX 9.
2024-12-20c++/modules: Ignore TU-local entities where necessaryNathaniel Shead1-1/+19
[basic.link] p14 lists a number of circumstances where a declaration naming a TU-local entity is not an exposure, notably the bodies of non-inline templates and friend declarations in classes. This patch ensures that these references do not error when exporting the module. We do need to still error on instantiation from a different module, however, in case this refers to a TU-local entity. As such this patch adds a new tree TU_LOCAL_ENTITY which is used purely as a placeholder to poison any attempted template instantiations that refer to it. This is also streamed for friend decls so that merging (based on the index of an entity into the friend decl list) doesn't break and to prevent complicating the logic; I imagine this shouldn't ever come up though. We also add a new warning, '-Wtemplate-names-tu-local', to handle the case where someone accidentally refers to a TU-local value from within a non-inline function template. This will compile without errors as-is, but any attempt to instantiate the decl will fail; this warning can be used to ensure that this doesn't happen. The warning is silenced for any declarations with explicit instantiations, since uses of those instantiations would not be exposures. The main piece that this patch doesn't yet attempt to solve is ADL: as specified, if ADL adds an overload set that includes a translation-unit local entity when instantiating a template, that overload set is now poisoned and counts as an exposure. Unfortunately, we don't currently differentiate between decls that are hidden due to not being exported, or decls that are hidden due to being hidden friends, so this patch instead just keeps the current (wrong) behaviour of non-exported entities not being visible to ADL at all. Additionally, this patch doesn't attempt to ignore non-ODR uses of constants in constexpr functions or templates. The obvious approach of folding them early in 'mark_use' doesn't seem to work (for a variety of reasons), so this leaves this to a later patch to implement, as it's at least no worse than the current behaviour and easy enough to workaround. For completeness this patch adds a new xtreme-header testcase to ensure that we have no regressions with regards to exposures of TU-local declarations in the standard library header files. A more restrictive test would be to do 'export extern "C++"' here, but unfortunately the system headers on some targets declare TU-local entities, so we'll make do with checking that at least the C++ standard library headers don't refer to such entities. gcc/c-family/ChangeLog: * c.opt: New warning '-Wtemplate-names-tu-local'. gcc/cp/ChangeLog: * cp-objcp-common.cc (cp_tree_size): Add TU_LOCAL_ENTITY. * cp-tree.def (TU_LOCAL_ENTITY): New tree code. * cp-tree.h (DECL_TEMPLATE_INSTANTIATIONS): Update comment. (struct tree_tu_local_entity): New type. (TU_LOCAL_ENTITY_NAME): New accessor. (TU_LOCAL_ENTITY_LOCATION): New accessor. (enum cp_tree_node_structure_enum): Add TS_CP_TU_LOCAL_ENTITY. (union GTY): Add tu_local_entity field. * module.cc (enum tree_tag): New flag DB_REFS_TU_LOCAL_BIT. (depset::has_defn): Override for TU-local entities. (depset::refs_tu_local): New accessor. (depset::hash::ignore_tu_local): New field. (depset::hash::hash): Initialize it. (trees_out::tree_tag::tt_tu_local): New flag. (trees_out::writing_local_entities): New field. (trees_out::is_initial_scan): New function. (trees_out::tu_local_count): New counter. (trees_out::trees_out): Initialize writing_local_entities. (dumper::impl::nested_name): Handle TU_LOCAL_ENTITY. (trees_out::instrument): Report TU-local entity counts. (trees_out::decl_value): Early exit for TU-local entities. (trees_in::decl_value): Handle typedefs of TU-local entities. (trees_out::decl_node): Adjust assertion to cope with early exit of TU-local deps. Always write TU-local entities by value. (trees_out::type_node): Handle TU-local types. (trees_out::has_tu_local_dep): New function. (trees_out::find_tu_local_decl): New function. (trees_out::tree_node): Intercept TU-local entities and write placeholder values for them instead of normal streaming. (trees_in::tree_node): Handle TU-local entities and TU-local template results. (trees_out::write_function_def): Ignore exposures in non-inline function bodies. (trees_out::write_var_def): Ignore exposures in initializers. (trees_out::write_class_def): Ignore exposures in friend decls. (trees_in::read_class_def): Skip TU-local friends. (trees_out::write_definition): Record whether we're writing a decl which refers to TU-local entities. (depset::hash::add_dependency): Only mark as exposure if we're not ignoring TU-local entities. (depset::hash::find_dependencies): Use depset's own is_key_order function rather than delegating via walker. Pass whether the decl has ignored TU-local entities in its definition. (template_has_explicit_inst): New function. (depset::hash::finalize_dependencies): Implement new warning Wtemplate-names-tu-local. (module_state::intercluster_seed): Don't seed TU-local deps. (module_state::write_cluster): Pass whether the decl has ignored TU-local entities in its definition. * pt.cc (register_specialization): Always register in a module. (complain_about_tu_local_entity): New function. (expr_contains_tu_local_entity): New function. (function_contains_tu_local_entity): New function. (instantiate_class_template): Skip TU-local friends. (tsubst_decl): Handle typedefs of TU-local entities. (tsubst): Complain about TU-local entities. (dependent_operand_p): Early exit for TU-local entities so we don't attempt to constant-evaluate them. (tsubst_expr): Detect and complain about TU-local entities. gcc/ChangeLog: * doc/invoke.texi: Document -Wtemplate-names-tu-local. gcc/testsuite/ChangeLog: * g++.dg/modules/internal-5_a.C: New test. * g++.dg/modules/internal-5_b.C: New test. * g++.dg/modules/internal-6.C: New test. * g++.dg/modules/internal-7_a.C: New test. * g++.dg/modules/internal-7_b.C: New test. * g++.dg/modules/internal-8_a.C: New test. * g++.dg/modules/xtreme-header-8.C: New test. Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com> Reviewed-by: Jason Merrill <jason@redhat.com>
2024-12-18Revert "PR81358: Enable automatic linking of libatomic."Prathamesh Kulkarni1-5/+1
This reverts commit e2f6ed54f75bbf8dd0292af90304890f06a9be17.
2024-12-18PR81358: Enable automatic linking of libatomic.Prathamesh Kulkarni1-1/+5
ChangeLog: PR driver/81358 * Makefile.def: Add dependencies so libatomic is built before target libraries are configured. * Makefile.tpl: Export TARGET_CONFIGDIRS. * configure.ac: Add libatomic to bootstrap_target_libs. * Makefile.in: Regenerate. * configure: Regenerate. gcc/ChangeLog: PR driver/81358 * common.opt: New option -flink-libatomic. * gcc.cc (LINK_LIBATOMIC_SPEC): New macro. * config/gnu-user.h (GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC): Use LINK_LIBATOMIC_SPEC. * doc/invoke.texi: Document -flink-libatomic. * configure.ac: Define TARGET_PROVIDES_LIBATOMIC. * configure: Regenerate. * config.in: Regenerate. libatomic/ChangeLog: PR driver/81358 * Makefile.am: Pass -fno-link-libatomic. New rule all. * configure.ac: Assert that CFLAGS is set and pass -fno-link-libatomic. * Makefile.in: Regenerate. * configure: Regenerate. Signed-off-by: Prathamesh Kulkarni <prathameshk@nvidia.com> Co-authored-by: Matthew Malcolmson <mmalcolmson@nvidia.com>
2024-12-18inline-asm: Add - constraint modifier support for toplevel extended asm ↵Jakub Jelinek1-0/+22
[PR41045] The following patch adds - constraint modifier support (only in toplevel asms), which one can use to allow i, s and n constraint to accept SYMBOL_REFs even with -fpic. So, the recommended way mark toplevel asm as defining some symbol would be ":" constraint (usually with cc modifier in the pattern), while to mark toplevel asm as using some symbol (again, either function or variable), one would use "-s" constraint again with address of that function or variable. 2024-12-18 Jakub Jelinek <jakub@redhat.com> PR c/41045 gcc/ * stmt.cc (parse_output_constraint, parse_input_constraint): Handle - modifier. * recog.h (raw_constraint_p): Declare. * recog.cc (raw_constraint_p): New variable. (asm_operand_ok, constrain_operands): Handle - modifier. * common.md (i, s, n): For raw_constraint_p don't require LEGITIMATE_PIC_OPERAND_P. * doc/md.texi: Document - constraint modifier. gcc/c/ * c-typeck.cc (build_asm_expr): Reject - constraint modifier inside of a function. gcc/cp/ * semantics.cc (finish_asm_stmt): Reject - constraint modifier inside of a function. gcc/testsuite/ * c-c++-common/toplevel-asm-4.c: Add missing %cc2 use in template, add bar, x, &y operands with "-i" and "-s" constraints. (x, y): New variables. (bar): Declare. * c-c++-common/toplevel-asm-7.c: New test. * c-c++-common/toplevel-asm-8.c: New test.
2024-12-18inline-asm: Add support for cc operand modifierJakub Jelinek2-0/+12
As mentioned in the "inline asm: Add new constraint for symbol definitions" patch description, while the c operand modifier is documented to: Require a constant operand and print the constant expression with no punctuation. it actually doesn't do that with -fpic at least on some targets and has been behaving that way for at least 3 decades. It prints the operand using output_addr_const if CONSTANT_ADDRESS_P is true, but CONSTANT_ADDRESS_P can do all sorts of target specific checks. And if it is false, it falls back to output_operand (operands[opnum], 'c'); which will on various targets just result in an error that it is invalid modifier letter (weird because it is documented), on others like x86 or alpha will handle the operand in some weird way if it is a comparison and otherwise complain the argument isn't a comparison, on others like arm perhaps do what the user wanted. As I wrote, we are pretty much out of modifier letters because some targets use a lot of them, and almost out of % punctuation chars (I think ` is left) but right now punctuation chars aren't normally followed by operand number anyway. So, the following patch takes one of the generic letters (c) and adds an extra modifier char after it, I chose cc, which behaves like c but just always uses output_addr_const instead of falling back to the machine dependent code. 2024-12-18 Jakub Jelinek <jakub@redhat.com> * final.cc (output_asm_insn): Add support for cc operand modifier. * doc/extend.texi (Generic Operand Modifiers): Document cc operand modifier. * doc/md.texi (@samp{:} in constraint): Mention the cc operand modifier and add small example. * c-c++-common/toplevel-asm-4.c: Don't use -fno-pie option. Use cc modifier instead of c. (v, w): Add extern keyword. * c-c++-common/toplevel-asm-6.c: New test.
2024-12-18inline asm: Add new constraint for symbol definitionsJakub Jelinek1-0/+7
The following patch on top of the PR41045 toplevel extended asm patch allows marking inline asms (both toplevel and function-local, admittedly it is less useful for the latter, so if you want, I can add restrictions) as defining symbols, either functions or variables. As most remaining constraint letters are used at least on some targets, I'm using : as the new constraint. It is similar to "s" in that it wants CONSTANT_P && !CONST_SCALAR_INT_P, but 1) it specially requires an address of a function or variable declaration, so for functions the expected use is void foo (void); ... ":" (foo) or ":" (&foo) and for variables (unless they are arrays) extern int var; ... ":" (&var) 2) it makes no sense to say that either something is defined or it is used in a register or something similar, so the patch diagnoses if one attempts to mix it with other constraints; ":,:,:" is allowed just because one could be using 3 alternatives in some other operand 3) unlike "s", the constraint doesn't check LEGITIMATE_PIC_OPERAND_P for -fpic, even in -fpic one should be able to use it the same way 4) the cgraph portion needs to be really added later 5) and last but not least, I'm afraid %c0 print modifier isn't very good for printing it; it works fine without -fpic/-fpie, but 'c' modifier is handled as if (CONSTANT_ADDRESS_P (operands[opnum])) output_addr_const (asm_out_file, operands[opnum]); else output_operand (operands[opnum], 'c'); and because at least on some arches like x86 CONSTANT_ADDRESS_P is redefined to do backend specific PIC mess, it will just output_operand and likely just be rejected (on x86 with an error that the argument is not a comparison) Guess for x86 one can use %p0 instead. But I'm afraid we are mostly out of generic modifiers, and targetm.asm_out.print_operand_punct_valid_p seems to use most of the punctuation characters as well. I think ` is unused, but wonder if we want to use up the last remaining letter that way, perhaps make %`<letter>0? Or extend the existing generic modifiers, keep %c0 behave as it does right now and make %cc0 be a 2 letter modifier which is PIC friendly and prints using output_addr_const anything that can be printed that way? A follow-up patch implements the %cc0 version. 2024-12-18 Jakub Jelinek <jakub@redhat.com> gcc/ * genpreds.cc (mangle): Add ':' mangling. (add_constraint): Allow : constraint. * common.md (:): New define_constraint. * stmt.cc (parse_output_constraint): Diagnose "=:". (parse_input_constraint): Handle ":" and diagnose invalid uses. * doc/md.texi (Simple Constraints): Document ":" constraint. gcc/c/ * c-typeck.cc (build_asm_expr): Diagnose invalid ":" constraint uses. gcc/cp/ * semantics.cc (finish_asm_stmt): Diagnose invalid ":" constraint uses. gcc/testsuite/ * c-c++-common/toplevel-asm-4.c: New test. * c-c++-common/toplevel-asm-5.c: New test.
2024-12-18Documentation: Fix paste-o in recent OpenMP/OpenACC patchSandra Loosemore1-1/+1
gcc/ChangeLog * doc/extend.texi (OpenACC): Fix paste-o.
2024-12-17Documentation: Make OpenMP/OpenACC docs easier to find [PR26154]Sandra Loosemore2-113/+188
PR c/26154 is one of our oldest documentation issues. The only discussion of OpenMP support in the GCC manual is buried in the "C Dialect Options" section, with nothing at all under "Extensions". The Fortran manual does have separate sections for OpenMP and OpenACC extensions so I have copy-edited/adapted that text for similar sections in the GCC manual, as well as breaking out the OpenMP and OpenACC options into their own section (they apply to all of C, C++, and Fortran). I also updated the information about what versions of OpenMP and OpenACC are supported and removed some redundant text from the Fortran manual to prevent it from getting out of sync on future updates, and inserted some cross-references to the new sections elsewhere. gcc/c-family/ChangeLog PR c/26154 * c.opt.urls: Regenerated. gcc/ChangeLog PR c/26154 * common.opt.urls: Regenerated. * doc/extend.texi (C Extensions): Adjust menu for new sections. (Attribute Syntax): Mention OpenMP directives. (Pragmas): Mention OpenMP and OpenACC directives. (OpenMP): New section. (OpenACC): New section. * doc/invoke.texi (Invoking GCC): Adjust menu for new section. (Option Summary): Move OpenMP and OpenACC options to their own category. (C Dialect Options): Move documentation for -foffload, -fopenacc, -fopenacc-dim, -fopenmp, -fopenmd-simd, and -fopenmp-target-simd-clone to... (OpenMP and OpenACC Options): ...this new section. Light copy-editing of the option descriptions. gcc/fortran/ChangeLog: PR c/26154 * gfortran.texi (Standards): Remove redundant info about OpenMP/OpenACC standard support. (OpenMP): Copy-editing and update version info. (OpenACC): Likewise. * lang.opt.urls: Regenerated.
2024-12-17[PATCH v2 2/2] RISC-V: Add Tenstorrent Ascalon 8 wide architectureAnton Blanchard1-1/+2
This adds the Tenstorrent Ascalon 8 wide architecture (tt-ascalon-d8) to the list of known cores. gcc/ChangeLog: * config/riscv/riscv-cores.def: Add tt-ascalon-d8. * config/riscv/riscv.cc (tt_ascalon_d8_tune_info): New. * doc/invoke.texi (RISC-V): Add tt-ascalon-d8 to -mcpu. gcc/testsuite/ChangeLog: * gcc.target/riscv/mcpu-tt-ascalon-d8.c: New test.
2024-12-17[PATCH v2 1/2] RISC-V: Document thead-c906, xiangshan-nanhu, and generic-oooAnton Blanchard1-5/+6
gcc/ChangeLog * doc/invoke.texi (RISC-V): Add thead-c906, xiangshan-nanhu to -mcpu, add generic-ooo and remove thead-c906 from -mtune.
2024-12-17RISC-V: Add new constraint R for register even-odd pairsKito Cheng1-0/+3
Although this constraint is not currently used for any instructions, it is very useful for custom instructions. Additionally, some new standard extensions (not yet upstream), such as `Zilsd` and `Zclsd`, are potential users of this constraint. Therefore, I believe there is sufficient justification to add it now. gcc/ChangeLog: * config/riscv/constraints.md (R): New constraint. * doc/md.texi: Document new constraint `R`. gcc/testsuite/ChangeLog: * gcc.target/riscv/constraint-R.c: New.
2024-12-17RISC-V: Implment N modifier for printing the register number rather than the ↵Kito Cheng1-0/+1
register name The modifier `N`, to print the raw encoding of a register. This is used when using `.insn <length>, <encoding>`, where the user wants to pass a value to the instruction in a known register, but where the instruction doesn't follow the existing instruction formats, so the assembly parser is not expecting a register name, just a raw integer. gcc/ChangeLog: * config/riscv/riscv.cc (riscv_print_operand): Add N. * doc/extend.texi: Document for N, gcc/testsuite/ChangeLog: * gcc.target/riscv/modifier-N-fpr.c: New. * gcc.target/riscv/modifier-N-vr.c: New. * gcc.target/riscv/modifier-N.c: New.
2024-12-17RISC-V: Add cr and cf constraintKito Cheng1-0/+7
gcc/ChangeLog: * config/riscv/constraints.md (cr): New. (cf): New. * config/riscv/riscv.h (reg_class): Add RVC_GR_REGS and RVC_FP_REGS. (REG_CLASS_NAMES): Ditto. (REG_CLASS_CONTENTS): Ditto. * doc/md.texi: Document cr and cf constraint. * config/riscv/riscv.cc (riscv_regno_to_class): Update FP_REGS to RVC_FP_REGS since it smaller set. (riscv_secondary_memory_needed): Handle RVC_FP_REGS. (riscv_register_move_cost): Ditto. gcc/testsuite/ChangeLog: * gcc.target/riscv/constraint-cf-zfinx.c: New. * gcc.target/riscv/constraint-cf.c: New. * gcc.target/riscv/constraint-cr.c: New.
2024-12-16libgdiagnostics: consolidate logical locationsDavid Malcolm1-0/+6
This patch updates diagnostic_manager_new_logical_location so that repeated calls with the same input values yield the same instance of diagnostic_logical_location. Doing so allows the path-printing logic to properly consolidate runs of events, whereas previously it could treat each event as having a distinct logical location, and thus require them to be printed separately; this greatly improves the output of sarif-replay when displaying execution paths. gcc/ChangeLog: * doc/libgdiagnostics/topics/logical-locations.rst (diagnostic_manager_new_logical_location): Add note about repeated calls. * libgdiagnostics.cc: Define INCLUDE_MAP. (class owned_nullable_string): Add copy ctor and move ctor. (owned_nullable_string::operator<): New. (diagnostic_logical_location::operator<): New. (diagnostic_manager::new_logical_location): Use m_logical_locs to "uniquify" instances, converting it to a std::map. (diagnostic_manager::logical_locs_map_t): New typedef. (diagnostic_manager::t m_logical_locs): Convert from a std::vector to a std::map. (diagnostic_execution_path::same_function_p): Update comment. gcc/testsuite/ChangeLog: * libgdiagnostics.dg/test-logical-location.c: Include <assert.h>. Verify that creating a diagnostic_logical_location with equal values yields the same instance. * sarif-replay.dg/2.1.0-valid/malloc-vs-local-4.c.sarif: New test. * sarif-replay.dg/2.1.0-valid/signal-1.c.moved.sarif: Update expected output to show logical location and for consolidation of events into runs. * sarif-replay.dg/2.1.0-valid/signal-1.c.sarif: Likewise. * sarif-replay.dg/2.1.0-valid/spec-example-4.sarif: Likewise. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2024-12-16sarif-replay: quote source from artifact contents [PR117943]David Malcolm2-4/+4
The diagnostic source-quoting machinery uses class file_cache implemented in gcc/input.cc for (re)reading the source when issuing diagnostics. When sarif-replay issues a saved diagnostic it might be running in a different path to where the .sarif file was captured, or on an entirely different machine. Previously such invocations would lead to the source-quoting silently failing, even if the content of the file is recorded in the .sarif file in the artifact "contents" property (which gcc populates when emitting .sarif output). This patch: - adds the ability for slots in file_cache to be populated from memory rather than from the filesystem - exposes it in libgdiagnostics via a new entrypoint - uses this in sarif-replay for any artifacts with a "contents" property, so that source-quoting uses that rather than trying to read from the path on the filesystem gcc/ChangeLog: PR sarif-replay/117943 * doc/libgdiagnostics/topics/physical-locations.rst (diagnostic_manager_new_file): Drop "const" from return type. * doc/libgdiagnostics/tutorial/02-physical-locations.rst: Drop "const" from "main_file" decl. * input.cc (file_cache::add_buffered_content): New. (file_cache_slot::set_content): New. (file_cache_slot::dump): Use m_file_path being null rather than m_fp to determine empty slots. Dump m_fp. (find_end_of_line): Drop "const" from return type and param. Add forward decl. (file_cache_slot::get_next_line): Fix "const"-ness. (selftest::test_reading_source_buffer): New. (selftest::input_cc_tests): Call it. * input.h (file_cache::add_buffered_content): New decl. * libgdiagnostics++.h (class file): Drop const-ness from m_inner. (file::set_buffered_content): New. * libgdiagnostics.cc (class content_buffer): New. (diagnostic_file::diagnostic_file): Add "mgr" param. (diagnostic_file::get_content): New. (diagnostic_file::set_buffered_content): New. (diagnostic_file::m_mgr): New. (diagnostic_file::m_content): New. (diagnostic_manager::new_file): Drop const-ness. Pass *this to ctor. (diagnostic_file::set_buffered_content): New. (diagnostic_manager_new_file): Drop "const" from return type. (diagnostic_file_set_buffered_content): New entrypoint. (diagnostic_manager_debug_dump_file): Dump the content size, if any. * libgdiagnostics.h (diagnostic_manager_new_file): Drop "const" from return type. (diagnostic_file_set_buffered_content): New decl. * libgdiagnostics.map (diagnostic_file_set_buffered_content): New symbol. * libsarifreplay.cc (sarif_replayer::m_artifacts_arr): Convert from json::value to json::array. (sarif_replayer::handle_run_obj): Call handle_artifact_obj on all artifacts. (sarif_replayer::handle_artifact_obj): New. gcc/testsuite/ChangeLog: PR sarif-replay/117943 * sarif-replay.dg/2.1.0-valid/error-with-note.sarif: Update expected output to include quoted source code and underlines. * sarif-replay.dg/2.1.0-valid/signal-1.c.moved.sarif: New test. * sarif-replay.dg/2.1.0-valid/signal-1.c.sarif: Update expected output to include quoted source code and underlines. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2024-12-16docs: Fix [us]abd pattern name.Robin Dapp1-2/+2
The uabd and sabd optab name is missing a 3 suffix (for its three arguments). This patch adds it. gcc/ChangeLog: * doc/md.texi: Add "3" suffix.
2024-12-14doc: Fix typos for --enable-host-pie docs in install.texiHeiko Eißfeldt1-1/+1
gcc/ChangeLog: * doc/install.texi (Configuration): Fix typos in documentation for --enable-host-pie.
2024-12-13Fix -fstrict-flex-arrays documentation, again [PR111659]Sandra Loosemore2-9/+15
My previous attempt to fix this issue ended up garbling the text instead. Trying again to make the descriptions of the attribute and command-line option consistent. gcc/ChangeLog PR middle-end/111659 * doc/extend.texi (Common Variable Attributes): Copy-edit description of the strict_flex_array attribute levels. * doc/invoke.texi (C Dialect Options): Swap documented behavior for levels 0 and 3. Copy the description for the other levels from the attribute instead of indirecting to it.
2024-12-12Clean up documentation of -Wsuggest-attribute= [PR115532]Sandra Loosemore1-5/+7
The list of -Wsuggest-attribute= variants was out of date in the option summary (and getting too long to fit on one line), and an index entry was missing for -Wsuggest-attribute=returns_nonnull. gcc/c-family/ChangeLog PR c/115532 * c.opt.urls: Regenerated. gcc/ChangeLog PR c/115532 * common.opt.urls: Regenerated. * doc/invoke.texi (Option Summary): Don't try to list all the -Wsuggest-attribute= variants inline here. (Warning Options): Likewise. Add @opindex for Wsuggest-attribute=returns_nonnull and its no- form. Remove @itemx for no- form. Co-Authored-By: Peter Eisentraut <peter@eisentraut.org>
2024-12-12AVR: target/118001 - Add __flashx as 24-bit named address space.Georg-Johann Lay1-3/+11
This patch adds __flashx as a new named address space that allocates objects in .progmemx.data. The handling is mostly the same or similar to that of 24-bit space __memx, except that the asm routines are simpler and more efficient. Loads are emit inline when ELPMX or LPMX is available. The address space uses a 24-bit addresses even on devices with a program memory size of 64 KiB or less. PR target/118001 gcc/ * doc/extend.texi (AVR Named Address Spaces): Document __flashx. * config/avr/avr.h (ADDR_SPACE_FLASHX): New enum value. * config/avr/avr-protos.h (avr_out_fload, avr_mem_flashx_p) (avr_fload_libgcc_p, avr_load_libgcc_mem_p) (avr_load_libgcc_insn_p): New. * config/avr/avr.cc (avr_addrspace): Add ADDR_SPACE_FLASHX. (avr_decl_flashx_p, avr_mem_flashx_p, avr_fload_libgcc_p) (avr_load_libgcc_mem_p, avr_load_libgcc_insn_p, avr_out_fload): New functions. (avr_adjust_insn_length) [ADJUST_LEN_FLOAD]: Handle case. (avr_progmem_p) [avr_decl_flashx_p]: return 2. (avr_addr_space_legitimate_address_p) [ADDR_SPACE_FLASHX]: Has same behavior like ADDR_SPACE_MEMX. (avr_addr_space_convert): Use pointer sizes rather then ASes. (avr_addr_space_contains): New function. (avr_convert_to_type): Use it. (avr_emit_cpymemhi): Handle ADDR_SPACE_FLASHX. * config/avr/avr.md (adjust_len) <fload>: New attr value. (gen_load<mode>_libgcc): Renamed from load<mode>_libgcc. (xload8<mode>_A): Iterate over MOVMODE rather than over ALL1. (fxmov<mode>_A): New from xloadv<mode>_A. (xmov<mode>_8): New from xload<mode>_A. (fmov<mode>): New insns. (fxload<mode>_A): New from xload<mode>_A. (fxload_<mode>_libgcc): New from xload_<mode>_libgcc. (*fxload_<mode>_libgcc): New from *xload_<mode>_libgcc. (mov<mode>) [avr_mem_flashx_p]: Hande ADDR_SPACE_FLASHX. (cpymemx_<mode>): Make sure the address space is not lost when splitting. (*cpymemx_<mode>) [ADDR_SPACE_FLASHX]: Use __movmemf_<mode> for asm. (*ashlqi.1.zextpsi_split): New combine pattern. * config/avr/predicates.md (nox_general_operand): Don't match when avr_mem_flashx_p is true. * config/avr/avr-passes.cc (AVR_LdSt_Props): ADDR_SPACE_FLASHX has no post_inc. gcc/testsuite/ * gcc.target/avr/torture/addr-space-1.h [AVR_HAVE_ELPM]: Use a function to bump .progmemx.data to a high address. * gcc.target/avr/torture/addr-space-2.h: Same. * gcc.target/avr/torture/addr-space-1-fx.c: New test. * gcc.target/avr/torture/addr-space-2-fx.c: New test. libgcc/ * config/avr/t-avr (LIB1ASMFUNCS): Add _fload_1, _fload_2, _fload_3, _fload_4, _movmemf. * config/avr/lib1funcs.S (.branch_plus): New .macro. (__xload_1, __xload_2, __xload_3, __xload_4): When the address is located in flash, then forward to... (__fload_1, __fload_2, __fload_3, __fload_4): ...these new functions, respectively. (__movmemx_hi): When the address is located in flash, forward to... (__movmemf_hi): ...this new function.
2024-12-12Fix misplaced x86 -mstack-protector-guard-symbol documentation [PR117150]Sandra Loosemore1-4/+6
Commit e1769bdd4cef522ada32aec863feba41116b183a accidentally inserted the documentation for the x86 -mstack-protector-guard-symbol option in the wrong place. Fixed thusly. gcc/ChangeLog PR target/117150 * doc/invoke.texi (RS/6000 and PowerPC Options): Move description of -mstack-protector-guard-symbol from here... (x86 Options): ...to here.
2024-12-11gimple: Add limit after which slower switchlower algs are used [PR117091] ↵Filip Kastl1-0/+3
[PR117352] This patch adds a limit on the number of cases of a switch. When this limit is exceeded, switch lowering decides to use faster but less powerful algorithms. In particular this means that for finding bit tests switch lowering decides between the old dynamic programming O(n^2) algorithm and the new greedy algorithm that Andi Kleen recently added but then reverted due to PR117352. It also means that switch lowering may bail out on finding jump tables if the switch is too large (Btw it also may not bail! It can happen that the greedy algorithms finds some bit tests which then basically split the switch into multiple smaller switches and those may be small enough to fit under the limit.) The limit is implemented as --param switch-lower-slow-alg-max-cases. Exceeding the limit is reported through -Wdisabled-optimization. This patch fixes the issue with the greedy algorithm described in PR117352. The problem was incorrect usage of the is_beneficial() heuristic. gcc/ChangeLog: PR middle-end/117091 PR middle-end/117352 * doc/invoke.texi: Add switch-lower-slow-alg-max-cases. * params.opt: Add switch-lower-slow-alg-max-cases. * tree-switch-conversion.cc (jump_table_cluster::find_jump_tables): Note in a comment that we are looking for jump tables in case sequences delimited by the already found bit tests. (bit_test_cluster::find_bit_tests): Decide between find_bit_tests_fast() and find_bit_tests_slow(). (bit_test_cluster::find_bit_tests_fast): New function. (bit_test_cluster::find_bit_tests_slow): New function. (switch_decision_tree::analyze_switch_statement): Report exceeding the limit. * tree-switch-conversion.h: Add find_bit_tests_fast() and find_bit_tests_slow(). Co-Authored-By: Andi Kleen <ak@gcc.gnu.org> Signed-off-by: Filip Kastl <fkastl@suse.cz>