aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
AgeCommit message (Collapse)AuthorFilesLines
2024-01-24MIPS: Accept arguments for -mexplicit-relocsYunQiang Su1-0/+16
GAS introduced explicit relocs since 2001, and %pcrel_hi/low were introduced in 2014. In future, we may introduce more. Let's convert -mexplicit-relocs option, and accpet options: none, base, pcrel. We also update gcc/configure.ac to set the value to option the gas support when GCC itself is built. gcc * configure.ac: Detect the explicit relocs support for mips, and define C macro MIPS_EXPLICIT_RELOCS. * config.in: Regenerated. * configure: Regenerated. * doc/invoke.texi(MIPS Options): Add -mexplicit-relocs. * config/mips/mips-opts.h: Define enum mips_explicit_relocs. * config/mips/mips.cc(mips_set_compression_mode): Sorry if !TARGET_EXPLICIT_RELOCS instead of just set it. * config/mips/mips.h: Define TARGET_EXPLICIT_RELOCS and TARGET_EXPLICIT_RELOCS_PCREL with mips_opt_explicit_relocs. * config/mips/mips.opt: Introduce -mexplicit-relocs= option and define -m(no-)explicit-relocs as aliases.
2024-01-23LoongArch: doc: Add attribute descriptions defined in the target-supports.exp.chenxiaolong1-0/+20
gcc/ChangeLog: * doc/sourcebuild.texi: Add attributes for keywords.
2024-01-23Correct lists of options enabled by -Wall and -Wextra [PR90463]Sandra Loosemore1-29/+50
gcc/ChangeLog PR c++/90463 * doc/invoke.texi (Warning Options): Correct lists of options enabled by -Wall and -Wextra by checking against common.opt and c-family/c.opt.
2024-01-21Make the manual clearer about what options -Wunused enables [PR90464]Sandra Loosemore1-10/+18
gcc/ChangeLog PR c++/90464 * doc/invoke.texi (Warning Options): Document that -Wunused-parameter isn't enabled by -Wunused unless -Wextra is provided, and that -Wunused does enable -Wunused-const-variable=1 for C. Clarify that -Wunused doesn't enable -Wunused-* options documented as behaving otherwise, and list them explicitly.
2024-01-21Clean up examples for -Wdangling-pointer [PR109708]Sandra Loosemore1-22/+34
gcc/ChangeLog PR c/109708 * doc/invoke.texi (Warning Options): Fix broken example and clean up/reorganize the others. Also describe what the short-form options mean.
2024-01-20Correct documentation for -Warray-parameter [PR102998]Sandra Loosemore1-8/+16
gcc/ChangeLog PR c/102998 * doc/invoke.texi (Option Summary): Add -Warray-parameter. (Warning Options): Correct/edit discussion of -Warray-parameter to make the first example less confusing, and fill in missing info.
2024-01-19RISC-V: Documnet the list of supported extensionsKito Cheng1-0/+461
Try to list all supported extensions: name, version and few description for each extension. v2 changes: - Fix several typo. - Add expantion info for vector crypto extensions. - Drop zvl8192b, zvl16384b, zvl32768b and zvl65536b. - Aadd zicntr and zihpm gcc/ChangeLog: * doc/invoke.texi (RISC-V Options): Add list of supported extensions.
2024-01-19RISC-V: Document the syntax of -marchKito Cheng1-0/+16
gcc/ChangeLog * doc/invoke.texi (RISC-V Options): Document the syntax of -march.
2024-01-19More precise documentation for cleanup attribute [PR110029]Sandra Loosemore1-0/+5
gcc/ChangeLog PR c/110029 * doc/extend.texi (Common Variable Attributes): Explain what happens when multiple variables with cleanups are in the same scope.
2024-01-18Improve documentation of noinline and noipa attributes [PR108470]Sandra Loosemore1-7/+10
gcc/ChangeLog PR ipa/108470 * doc/extend.texi (Common Function Attributes): Document that noinline also disables some interprocedural optimizations and improve flow to the part about using inline asm instead to disable calls from being optimized away completely. Remove the sentence that says noipa is mainly for internal compiler testing.
2024-01-18Remove remnant of removed Cygwin options from invoke.texi [PR108521]Brian Inglis1-1/+1
The -mcygwin option for x86 Windows was removed in 2010 by commit 3edeb30d044a4852881c34229e618b34f95b0d9e, but this reference was overlooked. gcc/ChangeLog PR target/108521 * doc/invoke.texi (Option Summary): Remove -mcygwin and -mno-cygwin from x86 Windows Options.
2024-01-18Restore documentation for const/volatile functions [PR107942]Sandra Loosemore1-2/+35
In r5-7698-g8648c55f3b703a I accidentally removed the documentation of GCC's special interpretation of const/volatile qualifiers on functions from the function attributes section, thinking this was just a bit-rotten leftover from old versions of GCC. PR107942 points out that this functionality is still present even though the docs are now gone. I decided this material didn't really belong in the function attributes discussion, but a new subsection in the general list of GCC extensions to the C language. And I agree with the comment in the issue that we shouldn't really recommend this usage any more. gcc/ChangeLog PR c/107942 * doc/extend.texi (C Extensions): Add new section to menu. (Function Attributes): Move dangling index entries to.... (Const and Volatile Functions): New section.
2024-01-18Document negative forms of -Wtsan and -Wxor-used-as-pow [PR110847]Sandra Loosemore1-11/+11
These warnings are enabled by default, thus the manual should document the -no form instead of the positive form. gcc/ChangeLog PR middle-end/110847 * doc/invoke.texi (Option Summary): Document negative forms of -Wtsan and -Wxor-used-as-pow. (Warning Options): Likewise.
2024-01-18Re-alphabetize attribute tables in extend.texi.Sandra Loosemore1-393/+396
These sections used to be alphabetized, but when I was working on the fix for PR111659 I noticed documentation for some newer attributes had been inserted at random places in the tables instead of maintaining alphabetical order. There's no change to content here, just moving blocks of text around. gcc/ChangeLog * doc/extend.texi (Common Function Attributes): Re-alphabetize the table. (Common Variable Attributes): Likewise. (Common Type Attributes): Likewise.
2024-01-17Clean up documentation for -Wstrict-flex-arrays [PR111659]Sandra Loosemore2-34/+47
gcc/ChangeLog PR middle-end/111659 * doc/extend.texi (Common Variable Attributes): Fix long lines in documentation of strict_flex_array + other minor copy-editing. Add a cross-reference to -Wstrict-flex-arrays. * doc/invoke.texi (Option Summary): Fix whitespace in tables before -fstrict-flex-arrays and -Wstrict-flex-arrays. (C Dialect Options): Combine the docs for the two -fstrict-flex-arrays forms into a single entry. Note this option is for C/C++ only. Add a cross-reference to -Wstrict-flex-arrays. (Warning Options): Note -Wstrict-flex-arrays is for C/C++ only. Minor copy-editing. Add cross references to the strict_flex_array attribute and -fstrict-flex-arrays option. Add note that this option depends on -ftree-vrp.
2024-01-17Move docs for -Wuse-after-free and -Wuseless-cast [PR111693]Sandra Loosemore1-79/+79
These options were categorized as C++ options, but they apply to all C-family languages. gcc/ChangeLog PR c/111693 * doc/invoke.texi (Option Summary): Move -Wuseless-cast from C++ Language Options to Warning Options. Add entry for -Wuse-after-free. (C++ Dialect Options): Move -Wuse-after-free and -Wuseless-cast from here.... (Warning Options): ...to here. Minor copy-editing to fix typo and grammar.
2024-01-17Tidy documentation for BPF builtins [PR112973]Sandra Loosemore1-14/+24
gcc/Changelog PR target/112973 * doc/extend.texi (BPF Built-in Functions): Wrap long lines and give the section a light copy-editing pass.
2024-01-16AArch64: Add -mcpu=cobalt-100Wilco Dijkstra1-1/+1
Add support for -mcpu=cobalt-100 (Neoverse N2 with a different implementer ID). gcc/ChangeLog: * config/aarch64/aarch64-cores.def (AARCH64_CORE): Add 'cobalt-100' CPU. * config/aarch64/aarch64-tune.md: Regenerated. * doc/invoke.texi (-mcpu): Add cobalt-100 core.
2024-01-16AVR: Add AVR16EB, AVR16EA and AVR32EA devices.Georg-Johann Lay1-1/+1
gcc/ * config/avr/avr-mcus.def (avr16eb14, avr16eb20, avr16eb28, avr16eb32) (avr16ea28, avr16ea32, avr16ea48, avr32ea28, avr32ea32, avr32ea48): Add. * doc/avr-mmcu.texi: Regenerate.
2024-01-15AVR: Document option -mskip-bug.Georg-Johann Lay1-4/+10
gcc/ * doc/invoke.texi (AVR Options) [-mskip-bug]: Add documentation.
2024-01-14AVR: Support .rodata in Flash for AVR64* and AVR128* Devices.Georg-Johann Lay1-2/+38
These devices see a 32 KiB block of their program memory (flash) in the RAM address space. This can be used to support .rodata in flash provided Binutils support PR31124 (Add new emulations which locate .rodata in flash). This patch does the following: * configure checks availability of Binutils PR31124. * Add new command line options -mrodata-in-ram and -mflmap. While -flmap is for internal usage (communicate hardware properties from device-specs to the compiler proper), -mrodata-in-ram is a user space option that allows to return to the current rodata-in-ram layout. * Adjust gen-avr-mmcu-specs.cc so that device-specs are generated that sanity check options, and that translate -m[no-]rodata-in-ram to its emulation. * Objects in .rodata don't drag __do_copy_data. * Document new options and built-in macros. PR target/112944 gcc/ * configure.ac [target=avr]: Check availability of emulations avrxmega2_flmap and avrxmega4_flmap, resulting in new config vars HAVE_LD_AVR_AVRXMEGA2_FLMAP and HAVE_LD_AVR_AVRXMEGA4_FLMAP. * configure: Regenerate. * config.in: Regenerate. * doc/invoke.texi (AVR Options): Document -mflmap, -mrodata-in-ram, __AVR_HAVE_FLMAP__, __AVR_RODATA_IN_RAM__. * config/avr/avr.opt (-mflmap, -mrodata-in-ram): New options. * config/avr/avr-arch.h (enum avr_device_specific_features): Add AVR_ISA_FLMAP. * config/avr/avr-mcus.def (AVR_MCU) [avr64*, avr128*]: Set isa flag AVR_ISA_FLMAP. * config/avr/avr.cc (avr_arch_index, avr_has_rodata_p): New vars. (avr_set_core_architecture): Set avr_arch_index. (have_avrxmega2_flmap, have_avrxmega4_flmap) (have_avrxmega3_rodata_in_flash): Set new static const bool according to configure results. (avr_rodata_in_flash_p): New function using them. (avr_asm_init_sections): Let readonly_data_section->unnamed.callback track avr_need_copy_data_p only if not avr_rodata_in_flash_p(). (avr_asm_named_section): Track avr_has_rodata_p. (avr_file_end): Emit __do_copy_data also when avr_has_rodata_p and not avr_rodata_in_flash_p (). * config/avr/specs.h (CC1_SPEC): Add %(cc1_rodata_in_ram). (LINK_SPEC): Add %(link_rodata_in_ram). (LINK_ARCH_SPEC): Remove. * config/avr/gen-avr-mmcu-specs.cc (have_avrxmega3_rodata_in_flash) (have_avrxmega2_flmap, have_avrxmega4_flmap): Set new static const bool according to configure results. (diagnose_mrodata_in_ram): New function. (print_mcu): Generate specs with the following changes: <*cc1_misc, *asm_misc, *link_misc>: New specs so that we don't need to extend avr/specs.h each time we add a new bell or whistle. <*cc1_rodata_in_ram, *link_rodata_in_ram>: New specs to diagnose -m[no-]rodata-in-ram. <*cpp_rodata_in_ram>: New. Does -D__AVR_RODATA_IN_RAM__=0/1. <*cpp_mcu>: Add -D__AVR_AVR_FLMAP__ if it applies. <*cpp>: Add %(cpp_rodata_in_ram). <*link_arch>: Use emulation avrxmega2_flmap, avrxmega4_flmap as requested. <*self_spec>: Add -mflmap or %<mflmap as needed. gcc/testsuite/ * gcc.target/avr/torture/pr112944-flmap-0.c: New test. * gcc.target/avr/torture/pr112944-flmap-1.c: New test.
2024-01-12AVR: Documentation: Web-Link an example ld-Script for Address-Space __flashN.Georg-Johann Lay1-1/+3
gcc/ * doc/extend.texi (AVR Named Address Spaces, Limitations and Caveats): Add web-link to the avr-gcc wiki.
2024-01-12AVR: Documentation: Attribute address has exactly one argument.Georg-Johann Lay1-2/+1
gcc/ * doc/extend.texi (AVR Variable Attributes) [address]: Remove documentation for a version without argument, which is not supported.
2024-01-12testsuite: Make bitint early vect test more accurateTamar Christina1-0/+12
This changes the tests I committed for PR113287 to also run on targets that don't support bitint. gcc/ChangeLog: PR tree-optimization/113287 * doc/sourcebuild.texi (check_effective_target_bitint65535): New. gcc/testsuite/ChangeLog: PR tree-optimization/113287 * gcc.dg/vect/vect-early-break_100-pr113287.c: Support non-bitint. * gcc.dg/vect/vect-early-break_99-pr113287.c: Likewise. * lib/target-supports.exp (bitint, bitint128, bitint575, bitint65535): Document them.
2024-01-12Update documents for fcf-protection=liuhongt1-0/+3
After r14-2692-g1c6231c05bdcca, the option is defined as EnumSet and -fcf-protection=branch won't unset any others bits since they're in different groups. So to override -fcf-protection, an explicit -fcf-protection=none needs to be added and then with -fcf-protection=XXX gcc/ChangeLog: PR target/113039 * doc/invoke.texi (fcf-protection=): Update documents.
2024-01-11AVR: invoke.texi: Put internal options in their own @subsubsection.Georg-Johann Lay1-34/+39
gcc/ * doc/invoke.texi (AVR Options): Move -mrmw, -mn-flash, -mshort-calls and -msp8 to... (AVR Internal Options): ...this new @subsubsection.
2024-01-11AVR: Some minor improvements to the TEXI documentation.Georg-Johann Lay3-27/+44
gcc/ * config/avr/avr-devices.cc (avr_texinfo): Adjust documentation for Reduced Tiny. * config/avr/gen-avr-mmcu-texi.cc (main): Add @anchor for each core. * doc/extend.texi (AVR Variable Attributes): Improve documentation of io, io_low and address attributes. * doc/invoke.texi (AVR Options): Add some anchors for external refs. * doc/avr-mmcu.texi: Rebuild.
2024-01-11Add -mevex512 into invoke.texiHaochen Jiang1-1/+6
Hi Richard, It seems that I send out a not updated patch. This patch should what I want to send. Thx, Haochen gcc/ChangeLog: * doc/invoke.texi: Add -mevex512.
2024-01-10middle-end: Don't apply copysign optimization if target does not implement ↵Tamar Christina1-0/+4
optab [PR112468] Currently GCC does not treat IFN_COPYSIGN the same as the copysign tree expr. The latter has a libcall fallback and the IFN can only do optabs. Because of this the change I made to optimize copysign only works if the target has impemented the optab, but it should work for those that have the libcall too. More annoyingly if a target has vector versions of ABS and NEG but not COPYSIGN then the change made them lose vectorization. The proper fix for this is to treat the IFN the same as the tree EXPR and to enhance expand_COPYSIGN to also support vector calls. I have such a patch for GCC 15 but it's quite big and too invasive for stage-4. As such this is a minimal fix, just don't apply the transformation and leave targets which don't have the optab unoptimized. Targets list for check_effective_target_ifn_copysign was gotten by grepping for copysign and looking at the optab. gcc/ChangeLog: PR tree-optimization/112468 * doc/sourcebuild.texi: Document ifn_copysign. * match.pd: Only apply transformation if target supports the IFN. gcc/testsuite/ChangeLog: PR tree-optimization/112468 * gcc.dg/fold-copysign-1.c: Modify tests based on if target supports IFN_COPYSIGN. * gcc.dg/pr55152-2.c: Likewise. * gcc.dg/tree-ssa/abs-4.c: Likewise. * gcc.dg/tree-ssa/backprop-6.c: Likewise. * gcc.dg/tree-ssa/copy-sign-2.c: Likewise. * gcc.dg/tree-ssa/mult-abs-2.c: Likewise. * lib/target-supports.exp (check_effective_target_ifn_copysign): New.
2024-01-10i386: [APX] Document inline asm behavior and new switch for APXHongyu Wang1-0/+8
For APX, the inline asm behavior was not mentioned in any document before. Add description for it. gcc/ChangeLog: * config/i386/i386.opt: Adjust document. * doc/invoke.texi: Add description for -mapx-inline-asm-use-gpr32.
2024-01-09arm: Add Arm Cortex-M52 CPU documentation.Chung-Ju Wu1-13/+13
Signed-off-by: Chung-Ju Wu <jasonwucj@gmail.com> gcc/ChangeLog: * doc/invoke.texi (Arm Options): Document Cortex-M52 options.
2024-01-08Clarify -mmovbe documentationRichard Biener1-2/+2
It was noticed that -mmovbe doesn't use movbe for __builtin_bswap{32,64} when not optimizing. The follownig adjusts the documentation to say it will be used for optimizing and applies to all byte swaps, not just those carried out via builtin function calls. * doc/invoke.texi (-mmovbe): Clarify.
2024-01-08i386: [APX] Add missing document for APXHongyu Wang1-0/+6
The supported sub-features for APX was missing in option document and target attribute section. Add those missing ones. gcc/ChangeLog: * config/i386/i386.opt: Add supported sub-features. * doc/extend.texi: Add description for target attribute.
2024-01-05aarch64: Extend VECT_COMPARE_COSTS to !SVE [PR113104]Richard Sandiford1-8/+17
When SVE is enabled, we try vectorising with multiple different SVE and Advanced SIMD approaches and use the cost model to pick the best one. Until now, we've not done that for Advanced SIMD, since "the first mode that works should always be the best". The testcase is a counterexample. Each iteration of the scalar loop vectorises naturally with 64-bit input vectors and 128-bit output vectors. We do try that for SVE, and choose it as the best approach. But the first approach we try is instead to use: - a vectorisation factor of 2 - 1 128-bit vector for the inputs - 2 128-bit vectors for the outputs But since the stride is variable, the cost of marshalling the input vector from two iterations outweighs the benefit of doing two iterations at once. This patch therefore generalises aarch64-sve-compare-costs to aarch64-vect-compare-costs and applies it to non-SVE compilations. gcc/ PR target/113104 * doc/invoke.texi (aarch64-sve-compare-costs): Replace with... (aarch64-vect-compare-costs): ...this. * config/aarch64/aarch64.opt (-param=aarch64-sve-compare-costs=): Replace with... (-param=aarch64-vect-compare-costs=): ...this new param. * config/aarch64/aarch64.cc (aarch64_override_options_internal): Don't disable it when vectorizing for Advanced SIMD only. (aarch64_autovectorize_vector_modes): Apply VECT_COMPARE_COSTS whenever aarch64_vect_compare_costs is true. gcc/testsuite/ PR target/113104 * gcc.target/aarch64/pr113104.c: New test. * gcc.target/aarch64/sve/cond_arith_1.c: Update for new parameter names. * gcc.target/aarch64/sve/cond_arith_1_run.c: Likewise. * gcc.target/aarch64/sve/cond_arith_3.c: Likewise. * gcc.target/aarch64/sve/cond_arith_3_run.c: Likewise. * gcc.target/aarch64/sve/gather_load_6.c: Likewise. * gcc.target/aarch64/sve/gather_load_7.c: Likewise. * gcc.target/aarch64/sve/load_const_offset_2.c: Likewise. * gcc.target/aarch64/sve/load_const_offset_3.c: Likewise. * gcc.target/aarch64/sve/mask_gather_load_6.c: Likewise. * gcc.target/aarch64/sve/mask_gather_load_7.c: Likewise. * gcc.target/aarch64/sve/mask_load_slp_1.c: Likewise. * gcc.target/aarch64/sve/mask_struct_load_1.c: Likewise. * gcc.target/aarch64/sve/mask_struct_load_2.c: Likewise. * gcc.target/aarch64/sve/mask_struct_load_3.c: Likewise. * gcc.target/aarch64/sve/mask_struct_load_4.c: Likewise. * gcc.target/aarch64/sve/mask_struct_store_1.c: Likewise. * gcc.target/aarch64/sve/mask_struct_store_1_run.c: Likewise. * gcc.target/aarch64/sve/mask_struct_store_2.c: Likewise. * gcc.target/aarch64/sve/mask_struct_store_2_run.c: Likewise. * gcc.target/aarch64/sve/pack_1.c: Likewise. * gcc.target/aarch64/sve/reduc_4.c: Likewise. * gcc.target/aarch64/sve/scatter_store_6.c: Likewise. * gcc.target/aarch64/sve/scatter_store_7.c: Likewise. * gcc.target/aarch64/sve/strided_load_3.c: Likewise. * gcc.target/aarch64/sve/strided_store_3.c: Likewise. * gcc.target/aarch64/sve/unpack_fcvt_signed_1.c: Likewise. * gcc.target/aarch64/sve/unpack_fcvt_unsigned_1.c: Likewise. * gcc.target/aarch64/sve/unpack_signed_1.c: Likewise. * gcc.target/aarch64/sve/unpack_unsigned_1.c: Likewise. * gcc.target/aarch64/sve/unpack_unsigned_1_run.c: Likewise. * gcc.target/aarch64/sve/vcond_11.c: Likewise. * gcc.target/aarch64/sve/vcond_11_run.c: Likewise.
2024-01-04options: add gcc/regenerate-opt-urls.pyDavid Malcolm2-0/+35
In r14-5118-gc5db4d8ba5f3de I added a mechanism to automatically add URLs to quoted strings in diagnostics. This was based on a data table mapping strings to URLs, with placeholder data covering various pragmas and a couple of options. The following patches add automatic URLification in our diagnostic messages to mentions of *all* of our options in quoted strings, linking to our HTML documentation. For example, with these patches, given: ./xgcc -B. -S t.c -Wctad-maybe-unsupported cc1: warning: command-line option ‘-Wctad-maybe-unsupported’ is valid for C++/ObjC++ but not for C the quoted string '-Wctad-maybe-unsupported' gets automatically URLified in a sufficiently modern terminal to: https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html#index-Wctad-maybe-unsupported Objectives: - integrate with DOCUMENTATION_ROOT_URL - integrate with the existing .opt mechanisms - automate keeping the URLs up-to-date - work with target-specific options based on current configuration - work with lang-specific options based on current configuration - keep autogenerated material separate from the human-maintained .opt files - no new build-time requirements (by using awk at build time) - be maintainable The approach is a new regenerate-opt-urls.py which: - scrapes the generated HTML documentation finding anchors for options, - reads all the .opt files in the source tree - for each .opt file, generates a .opt.urls file; for each option in the .opt file it has either a UrlSuffix directives giving the final part of the URL of that option's documentation (relative to DOCUMENTATION_ROOT_URL), or a comment describing the problem. regenerate-opt-urls.py is written in Python 3, and has unit tests. I tested it with Python 3.8, and it probably works with earlier releases of Python 3. The .opt.urls files it generates become part of the source tree, and would be regenerated by maintainers whenever new options are added. Forgetting to update the files (or not having Python 3 handy) merely means that URLs might be missing or out of date until someone else regenerates them. At build time, the .opt.urls are added to .opt files when regenerating the optionslist file. A new "options-urls-cc-gen.awk" is run at build time on the optionslist to generate a "options-urls.cc" file, and this is then used by the gcc_urlifier class when emitting diagnostics. Changed in v5: - removed commented-out code Changed in v4: - added PER_LANGUAGE_OPTION_INDEXES - added info to sourcebuild.texi on adding a new front end - removed TODOs and out-of-date comment Changed in v3: - Makefile.in: added OPT_URLS_HTML_DEPS and a comment Changed in v2: - added convenience targets to Makefile for regenerating the .opt.urls files, and for running unit tests for the generation code - parse gdc and gfortran documentation, and create LangUrlSuffix_{lang} directives for language-specific URLs. - add documentation to sourcebuild.texi gcc/ChangeLog: * Makefile.in (OPT_URLS_HTML_DEPS): New. (regenerate-opt-urls): New target. (regenerate-opt-urls-unit-test): New target. * doc/options.texi (Option properties): Add UrlSuffix and description of regenerate-opt-urls.py. Add LangUrlSuffix_*. * doc/sourcebuild.texi (Anatomy of a Language Front End): Add reference to regenerate-opt-urls.py's PER_LANGUAGE_OPTION_INDEXES and Makefile.in's OPT_URLS_HTML_DEPS. (Anatomy of a Target Back End): Add reference to regenerate-opt-urls.py's TARGET_SPECIFIC_PAGES. * regenerate-opt-urls.py: New file. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2024-01-03Update copyright years.Jakub Jelinek55-59/+59
2024-01-03Update copyright dates.Jakub Jelinek7-9/+9
Manual part of copyright year updates. 2024-01-03 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.
2023-12-24testsuite: Add tests for early break vectorizationTamar Christina1-0/+13
This adds new test to check for all the early break functionality. It includes a number of codegen and runtime tests checking the values at different needles in the array. They also check the values on different array sizes and peeling positions, datatypes, VL, ncopies and every other variant I could think of. Additionally it also contains reduced cases from issues found running over various codebases. Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Also regtested with: -march=armv8.3-a+sve -march=armv8.3-a+nosve -march=armv9-a Bootstrapped Regtested x86_64-pc-linux-gnu and no issues. On the tests I have disabled x86_64 on it's because the target is missing cbranch for all types. I think it should be possible to add them for the missing type since all we care about is if a bit is set or not. Bootstrap and Regtest on arm-none-linux-gnueabihf still running and test on arm-none-eabi -march=armv8.1-m.main+mve -mfpu=auto running. gcc/ChangeLog: * doc/sourcebuild.texi (check_effective_target_vect_early_break_hw, check_effective_target_vect_early_break): Document. gcc/testsuite/ChangeLog: * lib/target-supports.exp (add_options_for_vect_early_break, check_effective_target_vect_early_break_hw, check_effective_target_vect_early_break): New. * g++.dg/vect/vect-early-break_1.cc: New test. * g++.dg/vect/vect-early-break_2.cc: New test. * g++.dg/vect/vect-early-break_3.cc: New test. * gcc.dg/vect/vect-early-break-run_1.c: New test. * gcc.dg/vect/vect-early-break-run_10.c: New test. * gcc.dg/vect/vect-early-break-run_2.c: New test. * gcc.dg/vect/vect-early-break-run_3.c: New test. * gcc.dg/vect/vect-early-break-run_4.c: New test. * gcc.dg/vect/vect-early-break-run_5.c: New test. * gcc.dg/vect/vect-early-break-run_6.c: New test. * gcc.dg/vect/vect-early-break-run_7.c: New test. * gcc.dg/vect/vect-early-break-run_8.c: New test. * gcc.dg/vect/vect-early-break-run_9.c: New test. * gcc.dg/vect/vect-early-break-template_1.c: New test. * gcc.dg/vect/vect-early-break-template_2.c: New test. * gcc.dg/vect/vect-early-break_1.c: New test. * gcc.dg/vect/vect-early-break_10.c: New test. * gcc.dg/vect/vect-early-break_11.c: New test. * gcc.dg/vect/vect-early-break_12.c: New test. * gcc.dg/vect/vect-early-break_13.c: New test. * gcc.dg/vect/vect-early-break_14.c: New test. * gcc.dg/vect/vect-early-break_15.c: New test. * gcc.dg/vect/vect-early-break_16.c: New test. * gcc.dg/vect/vect-early-break_17.c: New test. * gcc.dg/vect/vect-early-break_18.c: New test. * gcc.dg/vect/vect-early-break_19.c: New test. * gcc.dg/vect/vect-early-break_2.c: New test. * gcc.dg/vect/vect-early-break_20.c: New test. * gcc.dg/vect/vect-early-break_21.c: New test. * gcc.dg/vect/vect-early-break_22.c: New test. * gcc.dg/vect/vect-early-break_23.c: New test. * gcc.dg/vect/vect-early-break_24.c: New test. * gcc.dg/vect/vect-early-break_25.c: New test. * gcc.dg/vect/vect-early-break_26.c: New test. * gcc.dg/vect/vect-early-break_27.c: New test. * gcc.dg/vect/vect-early-break_28.c: New test. * gcc.dg/vect/vect-early-break_29.c: New test. * gcc.dg/vect/vect-early-break_3.c: New test. * gcc.dg/vect/vect-early-break_30.c: New test. * gcc.dg/vect/vect-early-break_31.c: New test. * gcc.dg/vect/vect-early-break_32.c: New test. * gcc.dg/vect/vect-early-break_33.c: New test. * gcc.dg/vect/vect-early-break_34.c: New test. * gcc.dg/vect/vect-early-break_35.c: New test. * gcc.dg/vect/vect-early-break_36.c: New test. * gcc.dg/vect/vect-early-break_37.c: New test. * gcc.dg/vect/vect-early-break_38.c: New test. * gcc.dg/vect/vect-early-break_39.c: New test. * gcc.dg/vect/vect-early-break_4.c: New test. * gcc.dg/vect/vect-early-break_40.c: New test. * gcc.dg/vect/vect-early-break_41.c: New test. * gcc.dg/vect/vect-early-break_42.c: New test. * gcc.dg/vect/vect-early-break_43.c: New test. * gcc.dg/vect/vect-early-break_44.c: New test. * gcc.dg/vect/vect-early-break_45.c: New test. * gcc.dg/vect/vect-early-break_46.c: New test. * gcc.dg/vect/vect-early-break_47.c: New test. * gcc.dg/vect/vect-early-break_48.c: New test. * gcc.dg/vect/vect-early-break_49.c: New test. * gcc.dg/vect/vect-early-break_5.c: New test. * gcc.dg/vect/vect-early-break_50.c: New test. * gcc.dg/vect/vect-early-break_51.c: New test. * gcc.dg/vect/vect-early-break_52.c: New test. * gcc.dg/vect/vect-early-break_53.c: New test. * gcc.dg/vect/vect-early-break_54.c: New test. * gcc.dg/vect/vect-early-break_55.c: New test. * gcc.dg/vect/vect-early-break_56.c: New test. * gcc.dg/vect/vect-early-break_57.c: New test. * gcc.dg/vect/vect-early-break_58.c: New test. * gcc.dg/vect/vect-early-break_59.c: New test. * gcc.dg/vect/vect-early-break_6.c: New test. * gcc.dg/vect/vect-early-break_60.c: New test. * gcc.dg/vect/vect-early-break_61.c: New test. * gcc.dg/vect/vect-early-break_62.c: New test. * gcc.dg/vect/vect-early-break_63.c: New test. * gcc.dg/vect/vect-early-break_64.c: New test. * gcc.dg/vect/vect-early-break_65.c: New test. * gcc.dg/vect/vect-early-break_66.c: New test. * gcc.dg/vect/vect-early-break_67.c: New test. * gcc.dg/vect/vect-early-break_68.c: New test. * gcc.dg/vect/vect-early-break_69.c: New test. * gcc.dg/vect/vect-early-break_7.c: New test. * gcc.dg/vect/vect-early-break_70.c: New test. * gcc.dg/vect/vect-early-break_71.c: New test. * gcc.dg/vect/vect-early-break_72.c: New test. * gcc.dg/vect/vect-early-break_73.c: New test. * gcc.dg/vect/vect-early-break_74.c: New test. * gcc.dg/vect/vect-early-break_75.c: New test. * gcc.dg/vect/vect-early-break_76.c: New test. * gcc.dg/vect/vect-early-break_77.c: New test. * gcc.dg/vect/vect-early-break_78.c: New test. * gcc.dg/vect/vect-early-break_79.c: New test. * gcc.dg/vect/vect-early-break_8.c: New test. * gcc.dg/vect/vect-early-break_80.c: New test. * gcc.dg/vect/vect-early-break_81.c: New test. * gcc.dg/vect/vect-early-break_82.c: New test. * gcc.dg/vect/vect-early-break_83.c: New test. * gcc.dg/vect/vect-early-break_84.c: New test. * gcc.dg/vect/vect-early-break_85.c: New test. * gcc.dg/vect/vect-early-break_86.c: New test. * gcc.dg/vect/vect-early-break_87.c: New test. * gcc.dg/vect/vect-early-break_88.c: New test. * gcc.dg/vect/vect-early-break_89.c: New test. * gcc.dg/vect/vect-early-break_9.c: New test. * gcc.dg/vect/vect-early-break_90.c: New test. * gcc.dg/vect/vect-early-break_91.c: New test. * gcc.dg/vect/vect-early-break_92.c: New test. * gcc.dg/vect/vect-early-break_93.c: New test.
2023-12-22LoongArch: Add asm modifiers to the LSX and LASX directives in the doc.chenxiaolong2-1/+48
gcc/ChangeLog: * doc/extend.texi:Add modifiers to the vector of asm in the doc. * doc/md.texi:Refine the description of the modifier 'f' in the doc.
2023-12-21Document cond_copysign and cond_len_copysign optabs [PR112951]Andrew Pinski1-1/+9
This adds the documentation for cond_copysign and cond_len_copysign optabs. Also reorders the optabs.def to be in the similar order as how the internal function was done. gcc/ChangeLog: PR middle-end/112951 * doc/md.texi (cond_copysign): Document. (cond_len_copysign): Likewise. * optabs.def: Reorder cond_copysign to be before cond_fmin. Likewise for cond_len_copysign. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
2023-12-21LoongArch: Fix builtin function prototypes for LASX in doc.chenxiaolong1-12/+12
gcc/ChangeLog: * doc/extend.texi:According to the documents submitted earlier, Two problems with function return types and using the actual types of parameters instead of variable names were found and fixed.
2023-12-21LoongArch: extend.texi: Fix typos in LSX intrinsicsJiajie Chen1-47/+43
Several typos have been found and fixed: missing semicolons, using variable name instead of type, duplicate functions and wrong types. gcc/ChangeLog: * doc/extend.texi(__lsx_vabsd_di): remove extra `i' in name. (__lsx_vfrintrm_d, __lsx_vfrintrm_s, __lsx_vfrintrne_d, __lsx_vfrintrne_s, __lsx_vfrintrp_d, __lsx_vfrintrp_s, __lsx_vfrintrz_d, __lsx_vfrintrz_s): fix return types. (__lsx_vld, __lsx_vldi, __lsx_vldrepl_b, __lsx_vldrepl_d, __lsx_vldrepl_h, __lsx_vldrepl_w, __lsx_vmaxi_b, __lsx_vmaxi_d, __lsx_vmaxi_h, __lsx_vmaxi_w, __lsx_vmini_b, __lsx_vmini_d, __lsx_vmini_h, __lsx_vmini_w, __lsx_vsrani_d_q, __lsx_vsrarni_d_q, __lsx_vsrlni_d_q, __lsx_vsrlrni_d_q, __lsx_vssrani_d_q, __lsx_vssrarni_d_q, __lsx_vssrarni_du_q, __lsx_vssrlni_d_q, __lsx_vssrlrni_du_q, __lsx_vst, __lsx_vstx, __lsx_vssrani_du_q, __lsx_vssrlni_du_q, __lsx_vssrlrni_d_q): add missing semicolon. (__lsx_vpickve2gr_bu, __lsx_vpickve2gr_hu): fix typo in return type. (__lsx_vstelm_b, __lsx_vstelm_d, __lsx_vstelm_h, __lsx_vstelm_w): use imm type for the last argument. (__lsx_vsigncov_b, __lsx_vsigncov_h, __lsx_vsigncov_w, __lsx_vsigncov_d): remove duplicate definitions.
2023-12-20c++: computed goto warning [PR37722]Jason Merrill1-0/+3
PR37722 complains that a computed goto doesn't destroy objects that go out of scope. In the PR we agreed that it never will, but we can warn about it. PR c++/37722 gcc/ChangeLog: * doc/extend.texi: Document that computed goto does not call destructors. gcc/cp/ChangeLog: * decl.cc (identify_goto): Adjust for computed goto. (struct named_label_use_entry): Add computed_goto field. (poplevel_named_label_1): Add to computed_goto vec. (check_previous_goto_1): Dump computed_goto vec. (check_goto_1): Split out from check_goto. (check_goto): Check all addressable labels for computed goto. (struct named_label_entry): Add addressed field. (mark_label_addressed): New. * parser.cc (cp_parser_unary_expression): Call it. * cp-tree.h (mark_label_addressed): Declare it. gcc/testsuite/ChangeLog: * g++.dg/ext/label15.C: New test. * g++.dg/torture/pr42739.C: Expect warning.
2023-12-20Fortran: Use non conflicting file extensions for intermediates [PR81615]Rimvydas Jasinskas1-0/+2
gcc/ChangeLog: * doc/invoke.texi: Document the new file extensions gcc/fortran/ChangeLog: PR fortran/81615 * lang-specs.h (F951_CPP_OPTIONS): Do not hardcode ".f90" extension (F951_CPP_EXTENSION): Use .fi/.fii for fixed/free form sources * options.cc (form_from_filename): Handle the new extensions Signed-off-by: Rimvydas Jasinskas <rimvydas.jas@gmail.com>
2023-12-20c: Split -Wcalloc-transposed-args warning from -Walloc-size, -Walloc-size fixesJakub Jelinek1-3/+18
The following patch changes -Walloc-size warning to no longer warn about int *p = calloc (1, sizeof (int));, because as discussed earlier, the size is IMNSHO sufficient in that case, for alloc_size with 2 arguments warns if the product of the 2 arguments is insufficiently small. Also, it warns also for explicit casts of malloc/calloc etc. calls rather than just implicit, so not just int *p = malloc (1); but also int *p = (int *) malloc (1); It also fixes some ICEs where the code didn't verify the alloc_size arguments properly (Walloc-size-5.c testcase ICEs with vanilla trunk). And lastly, it introduces a coding style warning, -Wcalloc-transposed-args to warn for calloc (sizeof (struct S), 1) and similar calls (regardless of what they are cast to, warning whenever first argument is sizeof and the second is not). 2023-12-20 Jakub Jelinek <jakub@redhat.com> gcc/ * doc/invoke.texi (-Walloc-size): Add to the list of warning options, remove unnecessary line-break. (-Wcalloc-transposed-args): Document new warning. gcc/c-family/ * c.opt (Wcalloc-transposed-args): New warning. * c-common.h (warn_for_calloc, warn_for_alloc_size): Declare. * c-warn.cc (warn_for_calloc, warn_for_alloc_size): New functions. gcc/c/ * c-parser.cc (c_parser_postfix_expression_after_primary): Grow sizeof_arg and sizeof_arg_loc arrays to 6 elements. Call warn_for_calloc if warn_calloc_transposed_args for functions with alloc_size type attribute with 2 arguments. (c_parser_expr_list): Use 6 instead of 3. * c-typeck.cc (build_c_cast): Call warn_for_alloc_size for casts of calls to functions with alloc_size type attribute. (convert_for_assignment): Likewise. gcc/testsuite/ * gcc.dg/Walloc-size-4.c: New test. * gcc.dg/Walloc-size-5.c: New test. * gcc.dg/Wcalloc-transposed-args-1.c: New test.
2023-12-20strub: sparc64: unbias the stack address [PR112917]Alexandre Oliva1-1/+22
The stack pointer is biased by 2047 bytes on sparc64, so the range it delimits is way off. Unbias the addresses returned by __builtin_stack_address (), so that the strub builtins, inlined or not, can function correctly. I've considered introducing a new target macro, but using STACK_POINTER_OFFSET seems safe, and it enables the register save areas to be scrubbed as well. Because of the large fixed-size outgoing args area next to the register save area on sparc, we still need __strub_leave to not allocate its own frame, otherwise it won't be able to clear part of the frame it should. for gcc/ChangeLog PR middle-end/112917 * builtins.cc (expand_bultin_stack_address): Add STACK_POINTER_OFFSET. * doc/extend.texi (__builtin_stack_address): Adjust.
2023-12-18install: Drop hppa*-hp-hpux10, remove old notes on hppa*-hp-hpux11Gerald Pfeifer1-20/+0
gcc: PR target/69374 * doc/install.texi (Specific) <hppa*-hp-hpux10>: Remove section. (Specific) <hppa*-hp-hpux11>: Remove references to GCC 2.95 and 3.0. Also libffi has been ported now.
2023-12-17install: Streamline the hppa*-hp-hpux* sectionGerald Pfeifer1-21/+2
gcc: PR target/69374 * doc/install.texi (Specific) <hppa*-hp-hpux*>: Remove a note on GCC 4.3. Remove details on how the HP assembler, which we document as not working, breaks. <hppa*-hp-hpux11>: Note that only the HP linker is supported.
2023-12-17doc: Remove references to buildstat.htmlGerald Pfeifer1-52/+1
gcc: PR other/69374 * doc/install.texi (Installing GCC): Remove reference to buildstat.html. (Testing): Ditto. (Final install): Remove section on submitting information for buildstat.html. Adjust the request for feedback.
2023-12-16Add support for target_version attributeAndrew Carlotti2-0/+14
This patch adds support for the "target_version" attribute to the middle end and the C++ frontend, which will be used to implement function multiversioning in the aarch64 backend. On targets that don't use the "target" attribute for multiversioning, there is no conflict between the "target" and "target_clones" attributes. This patch therefore makes the mutual exclusion in C-family, D and Ada conditonal upon the value of the expanded_clones_attribute target hook. The "target_version" attribute is only added to C++ in this patch, because this is currently the only frontend which supports multiversioning using the "target" attribute. Support for the "target_version" attribute will be extended to C at a later date. Targets that currently use the "target" attribute for function multiversioning (i.e. i386 and rs6000) are not affected by this patch. gcc/ChangeLog: * attribs.cc (decl_attributes): Pass attribute name to target. (is_function_default_version): Update comment to specify incompatibility with target_version attributes. * cgraphclones.cc (cgraph_node::create_version_clone_with_body): Call valid_version_attribute_p for target_version attributes. * defaults.h (TARGET_HAS_FMV_TARGET_ATTRIBUTE): New macro. * target.def (valid_version_attribute_p): New hook. * doc/tm.texi.in: Add new hook. * doc/tm.texi: Regenerate. * multiple_target.cc (create_dispatcher_calls): Remove redundant is_function_default_version check. (expand_target_clones): Use target macro to pick attribute name. * targhooks.cc (default_target_option_valid_version_attribute_p): New. * targhooks.h (default_target_option_valid_version_attribute_p): New. * tree.h (DECL_FUNCTION_VERSIONED): Update comment to include target_version attributes. gcc/c-family/ChangeLog: * c-attribs.cc (attr_target_exclusions): Make target/target_clones exclusion target-dependent. (attr_target_clones_exclusions): Ditto, and add target_version. (attr_target_version_exclusions): New. (c_common_attribute_table): Add target_version. (handle_target_version_attribute): New. (handle_target_attribute): Amend comment. (handle_target_clones_attribute): Ditto. gcc/ada/ChangeLog: * gcc-interface/utils.cc (attr_target_exclusions): Make target/target_clones exclusion target-dependent. (attr_target_clones_exclusions): Ditto. gcc/d/ChangeLog: * d-attribs.cc (attr_target_exclusions): Make target/target_clones exclusion target-dependent. (attr_target_clones_exclusions): Ditto. gcc/cp/ChangeLog: * decl2.cc (check_classfn): Update comment to include target_version attributes.