summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* RISC-V: Remove void_type_node of void_args for vsetvlmax intrinsicJu-Zhe Zhong2023-03-051-3/+2
| | | | | | | | | This patch is to fix https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108927. PR108927 gcc/ChangeLog: * config/riscv/riscv-vector-builtins.cc: Remove void_type_node.
* RISC-V: Add testcase for VSETVL PASSJu-Zhe Zhong2023-03-0532-0/+1622
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/scalar_move-1.c: New test. * gcc.target/riscv/rvv/base/scalar_move-2.c: New test. * gcc.target/riscv/rvv/base/scalar_move-3.c: New test. * gcc.target/riscv/rvv/base/scalar_move-4.c: New test. * gcc.target/riscv/rvv/base/scalar_move-5.c: New test. * gcc.target/riscv/rvv/base/scalar_move-6.c: New test. * gcc.target/riscv/rvv/base/scalar_move-7.c: New test. * gcc.target/riscv/rvv/base/scalar_move-8.c: New test. * gcc.target/riscv/rvv/vsetvl/avl_single-100.c: New test. * gcc.target/riscv/rvv/vsetvl/avl_single-101.c: New test. * gcc.target/riscv/rvv/vsetvl/avl_single-78.c: New test. * gcc.target/riscv/rvv/vsetvl/avl_single-79.c: New test. * gcc.target/riscv/rvv/vsetvl/avl_single-80.c: New test. * gcc.target/riscv/rvv/vsetvl/avl_single-81.c: New test. * gcc.target/riscv/rvv/vsetvl/avl_single-82.c: New test. * gcc.target/riscv/rvv/vsetvl/avl_single-83.c: New test. * gcc.target/riscv/rvv/vsetvl/avl_single-84.c: New test. * gcc.target/riscv/rvv/vsetvl/avl_single-85.c: New test. * gcc.target/riscv/rvv/vsetvl/avl_single-86.c: New test. * gcc.target/riscv/rvv/vsetvl/avl_single-87.c: New test. * gcc.target/riscv/rvv/vsetvl/avl_single-88.c: New test. * gcc.target/riscv/rvv/vsetvl/avl_single-89.c: New test. * gcc.target/riscv/rvv/vsetvl/avl_single-90.c: New test. * gcc.target/riscv/rvv/vsetvl/avl_single-91.c: New test. * gcc.target/riscv/rvv/vsetvl/avl_single-92.c: New test. * gcc.target/riscv/rvv/vsetvl/avl_single-93.c: New test. * gcc.target/riscv/rvv/vsetvl/avl_single-94.c: New test. * gcc.target/riscv/rvv/vsetvl/avl_single-95.c: New test. * gcc.target/riscv/rvv/vsetvl/avl_single-96.c: New test. * gcc.target/riscv/rvv/vsetvl/avl_single-97.c: New test. * gcc.target/riscv/rvv/vsetvl/avl_single-98.c: New test. * gcc.target/riscv/rvv/vsetvl/avl_single-99.c: New test.
* RISC-V: Add scalar move support and fix VSETVL bugsJu-Zhe Zhong2023-03-0523-302/+1911
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc/ChangeLog: * config/riscv/constraints.md (Wb1): New constraint. * config/riscv/predicates.md (vector_least_significant_set_mask_operand): New predicate. (vector_broadcast_mask_operand): Ditto. * config/riscv/riscv-protos.h (enum vlmul_type): Adjust. (gen_scalar_move_mask): New function. * config/riscv/riscv-v.cc (gen_scalar_move_mask): Ditto. * config/riscv/riscv-vector-builtins-bases.cc (class vmv): New class. (class vmv_s): Ditto. (BASE): Ditto. * config/riscv/riscv-vector-builtins-bases.h: Ditto. * config/riscv/riscv-vector-builtins-functions.def (vmv_x): Ditto. (vmv_s): Ditto. (vfmv_f): Ditto. (vfmv_s): Ditto. * config/riscv/riscv-vector-builtins-shapes.cc (struct scalar_move_def): Ditto. (SHAPE): Ditto. * config/riscv/riscv-vector-builtins-shapes.h: Ditto. * config/riscv/riscv-vector-builtins.cc (function_expander::mask_mode): Ditto. (function_expander::use_exact_insn): New function. (function_expander::use_contiguous_load_insn): New function. (function_expander::use_contiguous_store_insn): New function. (function_expander::use_ternop_insn): New function. (function_expander::use_widen_ternop_insn): New function. (function_expander::use_scalar_move_insn): New function. * config/riscv/riscv-vector-builtins.def (s): New operand suffix. * config/riscv/riscv-vector-builtins.h (function_expander::add_scalar_move_mask_operand): New class. * config/riscv/riscv-vsetvl.cc (ignore_vlmul_insn_p): New function. (scalar_move_insn_p): Ditto. (has_vsetvl_killed_avl_p): Ditto. (anticipatable_occurrence_p): Ditto. (insert_vsetvl): Ditto. (get_vl_vtype_info): Ditto. (calculate_sew): Ditto. (calculate_vlmul): Ditto. (incompatible_avl_p): Ditto. (different_sew_p): Ditto. (different_lmul_p): Ditto. (different_ratio_p): Ditto. (different_tail_policy_p): Ditto. (different_mask_policy_p): Ditto. (possible_zero_avl_p): Ditto. (first_ratio_invalid_for_second_sew_p): Ditto. (first_ratio_invalid_for_second_lmul_p): Ditto. (second_ratio_invalid_for_first_sew_p): Ditto. (second_ratio_invalid_for_first_lmul_p): Ditto. (second_sew_less_than_first_sew_p): Ditto. (first_sew_less_than_second_sew_p): Ditto. (compare_lmul): Ditto. (second_lmul_less_than_first_lmul_p): Ditto. (first_lmul_less_than_second_lmul_p): Ditto. (first_ratio_less_than_second_ratio_p): Ditto. (second_ratio_less_than_first_ratio_p): Ditto. (DEF_INCOMPATIBLE_COND): Ditto. (greatest_sew): Ditto. (first_sew): Ditto. (second_sew): Ditto. (first_vlmul): Ditto. (second_vlmul): Ditto. (first_ratio): Ditto. (second_ratio): Ditto. (vlmul_for_first_sew_second_ratio): Ditto. (ratio_for_second_sew_first_vlmul): Ditto. (DEF_SEW_LMUL_FUSE_RULE): Ditto. (always_unavailable): Ditto. (avl_unavailable_p): Ditto. (sew_unavailable_p): Ditto. (lmul_unavailable_p): Ditto. (ge_sew_unavailable_p): Ditto. (ge_sew_lmul_unavailable_p): Ditto. (ge_sew_ratio_unavailable_p): Ditto. (DEF_UNAVAILABLE_COND): Ditto. (same_sew_lmul_demand_p): Ditto. (propagate_avl_across_demands_p): Ditto. (reg_available_p): Ditto. (avl_info::has_non_zero_avl): Ditto. (vl_vtype_info::has_non_zero_avl): Ditto. (vector_insn_info::operator>=): Refactor. (vector_insn_info::parse_insn): Adjust for scalar move. (vector_insn_info::demand_vl_vtype): Remove. (vector_insn_info::compatible_p): New function. (vector_insn_info::compatible_avl_p): Ditto. (vector_insn_info::compatible_vtype_p): Ditto. (vector_insn_info::available_p): Ditto. (vector_insn_info::merge): Ditto. (vector_insn_info::fuse_avl): Ditto. (vector_insn_info::fuse_sew_lmul): Ditto. (vector_insn_info::fuse_tail_policy): Ditto. (vector_insn_info::fuse_mask_policy): Ditto. (vector_insn_info::dump): Ditto. (vector_infos_manager::release): Ditto. (pass_vsetvl::compute_local_backward_infos): Adjust for scalar move support. (pass_vsetvl::get_backward_fusion_type): Adjust for scalar move support. (pass_vsetvl::hard_empty_block_p): Ditto. (pass_vsetvl::backward_demand_fusion): Ditto. (pass_vsetvl::forward_demand_fusion): Ditto. (pass_vsetvl::refine_vsetvls): Ditto. (pass_vsetvl::cleanup_vsetvls): Ditto. (pass_vsetvl::commit_vsetvls): Ditto. (pass_vsetvl::propagate_avl): Ditto. * config/riscv/riscv-vsetvl.h (enum demand_status): New class. (struct demands_pair): Ditto. (struct demands_cond): Ditto. (struct demands_fuse_rule): Ditto. * config/riscv/vector-iterators.md: New iterator. * config/riscv/vector.md (@pred_broadcast<mode>): New pattern. (*pred_broadcast<mode>): Ditto. (*pred_broadcast<mode>_extended_scalar): Ditto. (@pred_extract_first<mode>): Ditto. (*pred_extract_first<mode>): Ditto. (@pred_extract_first_trunc<mode>): Ditto. * config/riscv/riscv-vsetvl.def: New file. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/vsetvl/vsetvlmax-10.c: Adjust test. * gcc.target/riscv/rvv/vsetvl/vsetvlmax-11.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vsetvlmax-12.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vsetvlmax-15.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vsetvlmax-18.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vsetvlmax-9.c: Ditto.
* RISC-V: Allow const0_rtx operand in max/minLin Sinan2023-03-052-2/+12
| | | | | | | | | | | | | | | | | | | | | Optimize cases that use max[u]/min[u] against a zero constant. E.g., the case int f(int x) { return x >= 0 ? x : 0; } the current asm output in rv64gc_zba_zbb li rtmp,0 max a0,a0,rtmp could be optimized into max a0,a0,zero gcc/ChangeLog: * config/riscv/bitmanip.md: allow 0 constant in max/min pattern. gcc/testsuite/ChangeLog: * gcc.target/riscv/zbb-min-max-03.c: New test.
* RISC-V: Fix wrong partial subreg check for bsetidisiLin Sinan2023-03-051-1/+1
| | | | | | | | | | The partial subreg check should be for subreg operand(operand 1) instead of the immediate operand(operand 2). This change also fix pr68648.c in zbs. gcc/ChangeLog: * config/riscv/bitmanip.md: Fix wrong index in the check. Reviewed-by: <philipp.tomsich@vrull.eu>
* Daily bump.GCC Administrator2023-03-056-1/+347
|
* Fix modula-2 rename autogenerated .c files to .ccGaius Mulley2023-03-04110-0/+125948
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the replacement .cc files for the autogenerated tools. gcc/m2/ChangeLog: * mc-boot-ch/GBuiltins.cc: New file. * mc-boot-ch/Gdtoa.cc: New file. * mc-boot-ch/Gerrno.cc: New file. * mc-boot-ch/Gldtoa.cc: New file. * mc-boot-ch/Gm2rtsdummy.cc: New file. * mc-boot/GASCII.cc: New file. * mc-boot/GArgs.cc: New file. * mc-boot/GAssertion.cc: New file. * mc-boot/GBreak.cc: New file. * mc-boot/GCmdArgs.cc: New file. * mc-boot/GDebug.cc: New file. * mc-boot/GDynamicStrings.cc: New file. * mc-boot/GEnvironment.cc: New file. * mc-boot/GFIO.cc: New file. * mc-boot/GFormatStrings.cc: New file. * mc-boot/GFpuIO.cc: New file. * mc-boot/GIO.cc: New file. * mc-boot/GIndexing.cc: New file. * mc-boot/GM2Dependent.cc: New file. * mc-boot/GM2EXCEPTION.cc: New file. * mc-boot/GM2RTS.cc: New file. * mc-boot/GMemUtils.cc: New file. * mc-boot/GNumberIO.cc: New file. * mc-boot/GPushBackInput.cc: New file. * mc-boot/GRTExceptions.cc: New file. * mc-boot/GRTint.cc: New file. * mc-boot/GSArgs.cc: New file. * mc-boot/GSFIO.cc: New file. * mc-boot/GStdIO.cc: New file. * mc-boot/GStorage.cc: New file. * mc-boot/GStrCase.cc: New file. * mc-boot/GStrIO.cc: New file. * mc-boot/GStrLib.cc: New file. * mc-boot/GStringConvert.cc: New file. * mc-boot/GSysStorage.cc: New file. * mc-boot/GTimeString.cc: New file. * mc-boot/Galists.cc: New file. * mc-boot/Gdecl.cc: New file. * mc-boot/Gkeyc.cc: New file. * mc-boot/Glists.cc: New file. * mc-boot/GmcComment.cc: New file. * mc-boot/GmcComp.cc: New file. * mc-boot/GmcDebug.cc: New file. * mc-boot/GmcError.cc: New file. * mc-boot/GmcFileName.cc: New file. * mc-boot/GmcLexBuf.cc: New file. * mc-boot/GmcMetaError.cc: New file. * mc-boot/GmcOptions.cc: New file. * mc-boot/GmcPreprocess.cc: New file. * mc-boot/GmcPretty.cc: New file. * mc-boot/GmcPrintf.cc: New file. * mc-boot/GmcQuiet.cc: New file. * mc-boot/GmcReserved.cc: New file. * mc-boot/GmcSearch.cc: New file. * mc-boot/GmcStack.cc: New file. * mc-boot/GmcStream.cc: New file. * mc-boot/Gmcp1.cc: New file. * mc-boot/Gmcp2.cc: New file. * mc-boot/Gmcp3.cc: New file. * mc-boot/Gmcp4.cc: New file. * mc-boot/Gmcp5.cc: New file. * mc-boot/GnameKey.cc: New file. * mc-boot/GsymbolKey.cc: New file. * mc-boot/Gtop.cc: New file. * mc-boot/Gvarargs.cc: New file. * mc-boot/Gwlists.cc: New file. * pge-boot/GASCII.cc: New file. * pge-boot/GArgs.cc: New file. * pge-boot/GAssertion.cc: New file. * pge-boot/GBuiltins.cc: New file. * pge-boot/GDebug.cc: New file. * pge-boot/GDynamicStrings.cc: New file. * pge-boot/GFIO.cc: New file. * pge-boot/GIO.cc: New file. * pge-boot/GIndexing.cc: New file. * pge-boot/GLists.cc: New file. * pge-boot/GM2Dependent.cc: New file. * pge-boot/GM2EXCEPTION.cc: New file. * pge-boot/GM2LINK.cc: New file. * pge-boot/GM2RTS.cc: New file. * pge-boot/GNameKey.cc: New file. * pge-boot/GNumberIO.cc: New file. * pge-boot/GOutput.cc: New file. * pge-boot/GPushBackInput.cc: New file. * pge-boot/GRTExceptions.cc: New file. * pge-boot/GRTco.cc: New file. * pge-boot/GSFIO.cc: New file. * pge-boot/GSYSTEM.cc: New file. * pge-boot/GSelective.cc: New file. * pge-boot/GStdIO.cc: New file. * pge-boot/GStorage.cc: New file. * pge-boot/GStrCase.cc: New file. * pge-boot/GStrIO.cc: New file. * pge-boot/GStrLib.cc: New file. * pge-boot/GSymbolKey.cc: New file. * pge-boot/GSysExceptions.cc: New file. * pge-boot/GSysStorage.cc: New file. * pge-boot/Gabort.cc: New file. * pge-boot/Gbnflex.cc: New file. * pge-boot/Gcbuiltin.cc: New file. * pge-boot/Gdtoa.cc: New file. * pge-boot/Gerrno.cc: New file. * pge-boot/Gldtoa.cc: New file. * pge-boot/Glibc.cc: New file. * pge-boot/Glibm.cc: New file. * pge-boot/Gmcrts.cc: New file. * pge-boot/Gpge.cc: New file. * pge-boot/Gwrapc.cc: New file. * pge-boot/main.cc: New file. * pge-boot/network.cc: New file. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
* Modula-2 rename autogenerated .c files to .ccGaius Mulley2023-03-04114-126074/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch renames all the pge-boot/*.c files to .cc. It also renames the m2/mc-boot/*.c files to .cc. Finally it renames some of the mc-boot-ch hand built interface files to .cc. gcc/m2/ChangeLog: * Make-lang.in (MC-LIB-BOOT-C): Rename to MC-LIB-BOOT-CC. (MC-BOOT-C): Rename to MC-BOOT-CC. (BUILD-MC-BOOT-C): Rename to BUILD-MC-BOOT-CC. (BUILD-MC-BOOT-AUTO-C): Rename to BUILD-MC-BOOT-AUTO-CC. (m2/mc-boot/$(SRC_PREFIX)%.o): Change source file extension to .cc. (m2/mc-boot-ch/$(SRC_PREFIX)%.o): Ditto. * Make-maintainer.in (m2/gm2-ppg-boot/$(SRC_PREFIX)%.o): Change source file extension to .cc. (m2/gm2-ppg-boot/main.o): Ditto. (m2/gm2-ppg-boot/$(SRC_PREFIX)%.o): Ditto. to .cc. (m2/gm2-pg-boot/main.o): Ditto. (m2/gm2-pge-boot/$(SRC_PREFIX)ldtoa.o): Ditto. (m2/gm2-pge-boot/$(SRC_PREFIX)dtoa.o): Ditto. (m2/gm2-pge-boot/$(SRC_PREFIX)errno.o): Ditto. (m2/gm2-pge-boot/$(SRC_PREFIX)M2RTS.o): Ditto. (m2/gm2-pge-boot/$(SRC_PREFIX)%.o): Ditto. (m2/gm2-pge-boot/$(SRC_PREFIX)%.o): Ditto. (m2/gm2-pge-boot/$(SRC_PREFIX)pge.o): Ditto. (m2/gm2-pge-boot/main.o): Ditto. (mc-push): Ditto. (mc-clean): Ditto. (mc-stage2): Ditto. ((objdir)/m2/mc-boot-gen): Ditto. (m2/mc-boot-gen/$(SRC_PREFIX)decl.c): Ditto. (m2/mc-boot-gen/$(SRC_PREFIX)%.c): Ditto. * mc-boot-ch/GBuiltins.c: Correct comment and rename. * mc-boot-ch/Gdtoa.c: Correct comment and rename. * mc-boot-ch/Gldtoa.c: Correct comment and rename * mc-boot-ch/Gtermios.cc: Rename from Gtermios.c. * mc-boot-ch/Gerrno.c: Rename. * mc-boot-ch/GRTco.c: Removed. * mc-boot/GASCII.c: Rename to mc-boot/GASCII.cc. * mc-boot/GArgs.c: Rename to mc-boot/GArgs.cc. * mc-boot/GAssertion.c: Rename to mc-boot/GAssertion.cc. * mc-boot/GBreak.c: Rename to mc-boot/GBreak.cc. * mc-boot/GCmdArgs.c: Rename to mc-boot/GCmdArgs.cc. * mc-boot/GDebug.c: Rename to mc-boot/GDebug.cc. * mc-boot/GDynamicStrings.c: Rename to mc-boot/GDynamicStrings.cc. * mc-boot/GEnvironment.c: Rename to mc-boot/GEnvironment.cc. * mc-boot/GFIO.c: Rename to mc-boot/GFIO.cc. * mc-boot/GFormatStrings.c: Rename to mc-boot/GFormatStrings.cc. * mc-boot/GFpuIO.c: Rename to mc-boot/GFpuIO.cc. * mc-boot/GIO.c: Rename to mc-boot/GIO.cc. * mc-boot/GIndexing.c: Rename to mc-boot/GIndexing.cc. * mc-boot/GM2Dependent.c: Rename to mc-boot/GM2Dependent.cc. * mc-boot/GM2EXCEPTION.c: Rename to mc-boot/GM2EXCEPTION.cc. * mc-boot/GM2RTS.c: Rename to mc-boot/GM2RTS.cc. * mc-boot/GMemUtils.c: Rename to mc-boot/GMemUtils.cc. * mc-boot/GNumberIO.c: Rename to mc-boot/GNumberIO.cc. * mc-boot/GPushBackInput.c: Rename to mc-boot/GPushBackInput.cc. * mc-boot/GRTExceptions.c: Rename to mc-boot/GRTExceptions.cc. * mc-boot/GRTint.c: Rename to mc-boot/GRTint.cc. * mc-boot/GSArgs.c: Rename to mc-boot/GSArgs.cc. * mc-boot/GSFIO.c: Rename to mc-boot/GSFIO.cc. * mc-boot/GStdIO.c: Rename to mc-boot/GStdIO.cc. * mc-boot/GStorage.c: Rename to mc-boot/GStorage.cc. * mc-boot/GStrCase.c: Rename to mc-boot/GStrCase.cc. * mc-boot/GStrIO.c: Rename to mc-boot/GStrIO.cc. * mc-boot/GStrLib.c: Rename to mc-boot/GStrLib.cc. * mc-boot/GStringConvert.c: Rename to mc-boot/GStringConvert.cc. * mc-boot/GSysStorage.c: Rename to mc-boot/GSysStorage.cc. * mc-boot/GTimeString.c: Rename to mc-boot/GTimeString.cc. * mc-boot/Galists.c: Rename to mc-boot/Galists.cc. * mc-boot/Gdecl.c: Rename to mc-boot/Gdecl.cc. * mc-boot/Gkeyc.c: Rename to mc-boot/Gkeyc.cc. * mc-boot/Glists.c: Rename to mc-boot/Glists.cc. * mc-boot/GmcComment.c: Rename to mc-boot/GmcComment.cc. * mc-boot/GmcComp.c: Rename to mc-boot/GmcComp.cc. * mc-boot/GmcDebug.c: Rename to mc-boot/GmcDebug.cc. * mc-boot/GmcError.c: Rename to mc-boot/GmcError.cc. * mc-boot/GmcFileName.c: Rename to mc-boot/GmcFileName.cc. * mc-boot/GmcLexBuf.c: Rename to mc-boot/GmcLexBuf.cc. * mc-boot/GmcMetaError.c: Rename to mc-boot/GmcMetaError.cc. * mc-boot/GmcOptions.c: Rename to mc-boot/GmcOptions.cc. * mc-boot/GmcPreprocess.c: Rename to mc-boot/GmcPreprocess.cc. * mc-boot/GmcPretty.c: Rename to mc-boot/GmcPretty.cc. * mc-boot/GmcPrintf.c: Rename to mc-boot/GmcPrintf.cc. * mc-boot/GmcQuiet.c: Rename to mc-boot/GmcQuiet.cc. * mc-boot/GmcReserved.c: Rename to mc-boot/GmcReserved.cc. * mc-boot/GmcSearch.c: Rename to mc-boot/GmcSearch.cc. * mc-boot/GmcStack.c: Rename to mc-boot/GmcStack.cc. * mc-boot/GmcStream.c: Rename to mc-boot/GmcStream.cc. * mc-boot/Gmcp1.c: Rename to mc-boot/Gmcp1.cc. * mc-boot/Gmcp2.c: Rename to mc-boot/Gmcp2.cc. * mc-boot/Gmcp3.c: Rename to mc-boot/Gmcp3.cc. * mc-boot/Gmcp4.c: Rename to mc-boot/Gmcp4.cc. * mc-boot/Gmcp5.c: Rename to mc-boot/Gmcp5.cc. * mc-boot/GnameKey.c: Rename to mc-boot/GnameKey.cc. * mc-boot/GsymbolKey.c: Rename to mc-boot/GsymbolKey.cc. * mc-boot/Gtop.c: Rename to mc-boot/Gtop.cc. * mc-boot/Gvarargs.c: Rename to mc-boot/Gvarargs.cc. * mc-boot/Gwlists.c: Rename to mc-boot/Gwlists.cc. * pge-boot/GASCII.c: Rename to pge-boot/GASCII.cc. * pge-boot/GArgs.c: Rename to pge-boot/GArgs.cc. * pge-boot/GAssertion.c: Rename to pge-boot/GAssertion.cc. * pge-boot/GBuiltins.c: Rename to pge-boot/GBuiltins.cc. * pge-boot/GDebug.c: Rename to pge-boot/GDebug.cc. * pge-boot/GDynamicStrings.c: Rename to pge-boot/GDynamicStrings.cc. * pge-boot/GFIO.c: Rename to pge-boot/GFIO.cc. * pge-boot/GIO.c: Rename to pge-boot/GIO.cc. * pge-boot/GIndexing.c: Rename to pge-boot/GIndexing.cc. * pge-boot/GLists.c: Rename to pge-boot/GLists.cc. * pge-boot/GM2Dependent.c: Rename to pge-boot/GM2Dependent.cc. * pge-boot/GM2EXCEPTION.c: Rename to pge-boot/GM2EXCEPTION.cc. * pge-boot/GM2LINK.c: Rename to pge-boot/GM2LINK.cc. * pge-boot/GM2RTS.c: Rename to pge-boot/GM2RTS.cc. * pge-boot/GNameKey.c: Rename to pge-boot/GNameKey.cc. * pge-boot/GNumberIO.c: Rename to pge-boot/GNumberIO.cc. * pge-boot/GOutput.c: Rename to pge-boot/GOutput.cc. * pge-boot/GPushBackInput.c: Rename to pge-boot/GPushBackInput.cc. * pge-boot/GRTExceptions.c: Rename to pge-boot/GRTExceptions.cc. * pge-boot/GRTco.c: Rename to pge-boot/GRTco.cc. * pge-boot/GSFIO.c: Rename to pge-boot/GSFIO.cc. * pge-boot/GSYSTEM.c: Rename to pge-boot/GSYSTEM.cc. * pge-boot/GSelective.c: Rename to pge-boot/GSelective.cc. * pge-boot/GStdIO.c: Rename to pge-boot/GStdIO.cc. * pge-boot/GStorage.c: Rename to pge-boot/GStorage.cc. * pge-boot/GStrCase.c: Rename to pge-boot/GStrCase.cc. * pge-boot/GStrIO.c: Rename to pge-boot/GStrIO.cc. * pge-boot/GStrLib.c: Rename to pge-boot/GStrLib.cc. * pge-boot/GSymbolKey.c: Rename to pge-boot/GSymbolKey.cc. * pge-boot/GSysExceptions.c: Rename to pge-boot/GSysExceptions.cc. * pge-boot/GSysStorage.c: Rename to pge-boot/GSysStorage.cc. * pge-boot/Gabort.c: Rename to pge-boot/Gabort.cc. * pge-boot/Gbnflex.c: Rename to pge-boot/Gbnflex.cc. * pge-boot/Gcbuiltin.c: Rename to pge-boot/Gcbuiltin.cc. * pge-boot/Gdtoa.c: Rename to pge-boot/Gdtoa.cc. * pge-boot/Gerrno.c: Rename to pge-boot/Gerrno.cc. * pge-boot/Gldtoa.c: Rename to pge-boot/Gldtoa.cc. * pge-boot/Glibc.c: Rename to pge-boot/Glibc.cc. * pge-boot/Glibm.c: Rename to pge-boot/Glibm.cc. * pge-boot/Gmcrts.c: Rename to pge-boot/Gmcrts.cc. * pge-boot/Gpge.c: Rename to pge-boot/Gpge.cc. * pge-boot/Gwrapc.c: Rename to pge-boot/Gwrapc.cc. * pge-boot/README: Correct description. * pge-boot/main.c: Rename to pge-boot/main.cc. * pge-boot/network.c: Rename to pge-boot/network.cc. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
* Remove remaining traces of m_vecdata from comments [PR109006]Jakub Jelinek2023-03-043-8/+9
| | | | | | | | | | | | | The following patch adjusts remaining references to the removed m_vecdata array from vec.h in various comments. 2023-03-04 Jakub Jelinek <jakub@redhat.com> PR middle-end/109006 * vec.cc (test_auto_alias): Adjust comment for removal of m_vecdata. * read-rtl-function.cc (function_reader::parse_block): Likewise. * gdbhooks.py: Likewise.
* testsuite: Fix up syntax errors in scan-tree-dump-times target selectorsJakub Jelinek2023-03-042-7/+5
| | | | | | | | | | | | | | | | | | | | On Thu, Mar 02, 2023 at 07:23:32PM +0100, Robin Dapp via Gcc-patches wrote: > this patch changes SLP test expectations. As we only vectorize when no > more than one rgroup is present, no vectorization is performed. This broke the tests, I'm seeing syntax errors: ERROR: gcc.dg/vect/slp-3.c -flto -ffat-lto-objects: error executing dg-final: syntax error in target selector "target ! vect_partial_vectors || vect32 || s390_vx" ERROR: gcc.dg/vect/slp-3.c: error executing dg-final: syntax error in target selector "target ! vect_partial_vectors || vect32 || s390_vx" ERROR: gcc.dg/vect/slp-multitypes-11.c -flto -ffat-lto-objects: error executing dg-final: syntax error in target selector "target vect_unpack && vect_partial_vectors_usage_1 && ! s390_vx" ERROR: gcc.dg/vect/slp-multitypes-11.c: error executing dg-final: syntax error in target selector "target vect_unpack && vect_partial_vectors_usage_1 && ! s390_vx" The following patch fixes those. 2023-03-04 Jakub Jelinek <jakub@redhat.com> * gcc.dg/vect/slp-3.c: Fix up syntax errors in scan-tree-dump-times target selectors. * gcc.dg/vect/slp-multitypes-11.c: Likewise.
* c-family: Incremental fix for -Wsign-compare BIT_NOT_EXPR handling [PR107465]Jakub Jelinek2023-03-042-28/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There can be too many extensions and seems I didn't get everything right in the previously posted patch. The following incremental patch ought to fix that. The code can deal with quite a few sign/zero extensions at various spots and it is important to deal with all of them right. On the argument that contains BIT_NOT_EXPR we have: MSB bits#4 bits#3 BIT_NOT_EXPR bits#2 bits#1 LSB where bits#1 is one or more bits (TYPE_PRECISION (TREE_TYPE (arg0)) at the end of the function) we don't know anything about, for the purposes of this warning it is VARYING that is inverted with BIT_NOT_EXPR to some other VARYING bits; bits#2 is one or more bits (TYPE_PRECISION (TREE_TYPE (op0)) - TYPE_PRECISION (TREE_TYPE (arg0)) at the end of the function) which are known to be 0 before the BIT_NOT_EXPR and 1 after it. bits#3 is zero or more bits from the TYPE_PRECISION (TREE_TYPE (op0)) at the end of function to the TYPE_PRECISION (TREE_TYPE (op0)) at the end of the function to TYPE_PRECISION (TREE_TYPE (op0)) at the start of the function, which are either zero extension or sign extension. And bits#4 is zero or more bits from the TYPE_PRECISION (TREE_TYPE (op0)) at the start of the function to TYPE_PRECISION (result_type), which again can be zero or sign extension. Now, vanilla trunk as well as the previously posted patch mishandles the case where bits#3 are sign extended (as bits#2 are known to be all set, that means bits#3 are all set too) but bits#4 are zero extended and are thus all 0. The patch fixes it by tracking the lowest bit which is known to be clear above the known to be set bits (if any, otherwise it is precision of result_type). 2023-03-04 Jakub Jelinek <jakub@redhat.com> PR c/107465 * c-warn.cc (warn_for_sign_compare): Don't warn for unset bits above innermost zero extension of BIT_NOT_EXPR result. * c-c++-common/Wsign-compare-2.c (f18): New test.
* c-family: Fix up -Wsign-compare BIT_NOT_EXPR handling [PR107465]Jakub Jelinek2023-03-043-31/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following patch fixes multiple bugs in warn_for_sign_compare related to the BIT_NOT_EXPR related warnings. My understanding is that what those 3 warnings are meant to warn (since 1995 apparently) is the case where we have BIT_NOT_EXPR of a zero-extended value, so in result_type the value is something like: 0b11111111XXXXXXXX (e.g. ~ of a 8->16 bit zero extension) 0b000000000000000011111111XXXXXXXX (e.g. ~ of a 8->16 bit zero extension then zero extended to 32 bits) 0b111111111111111111111111XXXXXXXX (e.g. ~ of a 8->16 bit zero extension then sign extended to 32 bits) and the intention of the warning is to warn when this is compared against something that has some 0 bits at the place where the above has guaranteed 1 bits, either ensured through comparison against constant where we know the bits exactly, or through zero extension from some narrower type where again we know at least some upper bits are zero extended. The bugs in the warning code are: 1) misunderstanding of the {,c_common_}get_narrower APIs - the unsignedp it sets is only meaningful if the function actually returns something narrower (in that case it says whether the narrower value is then sign (0) or zero (1) extended to the originally passed value. Though op0 or op1 at this point might be already narrower than result_type, and if the function doesn't return anything narrower, it all depends on whether the passed in op{0,1} had TYPE_UNSIGNED type or not 2) the code didn't check at all whether the BIT_NOT_EXPR operand was actually zero extended (i.e. that it was narrower and unsignedp was set to 1 for it), all it did is check that unsignedp from the call was 1. But that isn't well defined thing, if the argument is returned as is, the function sets unsignedp to 0, but if there is e.g. a useless cast to the same or compatible type in between, it can return 1 if the cast is unsigned; now, if BIT_NOT_EXPR operand is not zero extended, we know nothing at all about any bits in the operand containing BIT_NOT_EXPR, so there is nothing to warn about 3) the code was actually testing both operands after calling c_common_get_narrower on them and on the one with BIT_NOT_EXPR again for constants; I think that is just wrong in case the BIT_NOT_EXPR operand wouldn't be fully folded, the warning makes sense only if the other operand not having BIT_NOT_EXPR in it is constant 4) as can be seen from the above bit pattern examples, the upper bits above (in the patch arg0) aren't always all 1s, there could be some zero extension above it and from it one would have 0s, so that needs to be taken into account for the choice which constant bits to test for being always set otherwise warning is emitted, or for the zero extension guaranteed zero bits 5) the patch also simplifies the handling, we only do it if one but not both operands are BIT_NOT_EXPR after first {,c_common_}get_narrower, so we can just use std::swap to ensure it is the first one 6) the code compared bits against HOST_BITS_PER_LONG, which made sense back in 1995 when the values were stored into long, but now that they are HOST_WIDE_INT should test HOST_BITS_PER_WIDE_INT (or we could rewrite the stuff to wide_int, not done in the patch) 2023-03-04 Jakub Jelinek <jakub@redhat.com> PR c/107465 * c-warn.cc (warn_for_sign_compare): If c_common_get_narrower doesn't return a narrower result, use TYPE_UNSIGNED to set unsignedp0 and unsignedp1. For the one BIT_NOT_EXPR case vs. one without, only check for constant in the non-BIT_NOT_EXPR operand, use std::swap to simplify the code, only warn if BIT_NOT_EXPR operand is extended from narrower unsigned, fix up computation of mask for the constant cases and for unsigned other operand case handle differently BIT_NOT_EXPR result being sign vs. zero extended. * c-c++-common/Wsign-compare-2.c: New test. * c-c++-common/pr107465.c: New test.
* c-family: Account for integral promotions of left shifts for ↵Jakub Jelinek2023-03-042-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | -Wshift-overflow warning [PR107846] The r13-1100-gacb1e6f43dc2bbedd124 change added match.pd narrowing of left shifts, and while I believe the C++ FE calls the warning on unfolded trees, the C FE folds them and so left shifts where integral promotion happened and so were done in int type will be usually narrowed back to char/signed char/unsigned char/short/unsigned short left shifts if the shift count is constant and fits into the precision of the var being shifted. One possibility would be to restrict the match.pd optimization to GIMPLE only, another don't fold in C FE before this warning (well, we need to fold the shift count operand to constant if possible), the following patch just takes integral promotion into account in the warning code. 2023-03-04 Jakub Jelinek <jakub@redhat.com> PR c/107846 * c-warn.cc: Include langhooks.h. (maybe_warn_shift_overflow): Set type0 to what TREE_TYPE (op0) promotes to rather than TREE_TYPE (op0) itself, if TREE_TYPE (op0) is narrower than type0 and unsigned, use wi::min_precision with UNSIGNED and fold_convert op0 to type0 before emitting the warning. * gcc.dg/pr107846.c: New test.
* c++: Don't defer local statics initialized with constant expressions [PR108702]Jakub Jelinek2023-03-042-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The stmtexpr19.C testcase used to be rejected as it has a static variable in statement expression in constexpr context, but as that static variable is initialized by constant expression, when P2647R1 was implemented we agreed to make it valid. Now, as reported, the testcase compiles fine, but doesn't actually link because the static variable isn't defined anywhere, and with -flto ICEs because of this problem. This is because we never varpool_node::finalize_decl those vars, the constant expression in which the DECL_EXPR is present for the static VAR_DECL is folded (constant evaluated) into just the address of the VAR_DECL. Now, similar testcase included below (do we want to include it in the testsuite too?) works fine, because in cp_finish_decl -> make_rtl_for_nonlocal_decl we have since PR70353 fix: /* We defer emission of local statics until the corresponding DECL_EXPR is expanded. But with constexpr its function might never be expanded, so go ahead and tell cgraph about the variable now. */ defer_p = ((DECL_FUNCTION_SCOPE_P (decl) && !var_in_maybe_constexpr_fn (decl)) || DECL_VIRTUAL_P (decl)); and so don't defer them in constexpr/consteval functions. The following patch calls rest_of_decl_compilation which make_rtl_for_nonlocal_decl didn't call when encountering DECL_EXPRs of such vars during constant evaluation if they weren't finalized yet. 2023-03-04 Jakub Jelinek <jakub@redhat.com> PR c++/108702 * constexpr.cc: Include toplev.h. (cxx_eval_constant_expression) <case DECL_EXPR>: When seeing a local static initialized by constant expression outside of a constexpr function which has been deferred by make_rtl_for_nonlocal_decl, call rest_of_decl_compilation on it. * g++.dg/ext/stmtexpr19.C: Use dg-do link rather than dg-do compile.
* diagnostics: Fix up selftests with $COLUMNS < 42 [PR108973]Jakub Jelinek2023-03-041-0/+1
| | | | | | | | | | | | | | | | | | | | | As mentioned in the PR, GCC's diagnostics self-tests fail if $COLUMNS < 42. Guarding each self-test with if (get_terminal_width () > 41) or similar would be a maintainance nightmare (PR has a patch to do so without reformatting to make it work for $COLUMNS in [30, 41] inclusive, but I'm afraid going down to $COLUMNS 1 would mean marking everything). Furthermore, the self-tests don't really emit stuff to the terminal, but into a buffer, so using get_terminal_width () for it seems inappropriate. The following patch makes sure test_diagnostic_context constructor uses exactly 80 columns wide caret max width, of course some tests override it already if they want to test for behavior in narrower cases. 2023-03-04 Jakub Jelinek <jakub@redhat.com> PR testsuite/108973 * selftest-diagnostic.cc (test_diagnostic_context::test_diagnostic_context): Set caret_max_width to 80.
* testsuite: Skip gcc.dg/ipa/pr77653.c for CRISHans-Peter Nilsson2023-03-041-0/+1
| | | | | | | | | | | | | | | | | | CRIS defines DATA_ALIGNMENT such that alignment can be applied differently to different data of the same type, when "references to it must bind to the current definition" (varasm.cc:align_variable). Here, it means that more alignment is then applied to g, but not f, so the test-case fails because another message is emitted than the expected: a same-alignment test dominates the not-discardable test, and we get "Not unifying; original and alias have incompatible alignments" rather than "Not unifying; alias cannot be created; target is discardable". Because this DATA_ALIGNMENT behavior for CRIS depends on target options, and this test is already artificial by the use of -fcommon, better skip it. * gcc.dg/ipa/pr77653.c: Skip for cris-*-*.
* testsuite: Skip gcc.dg/ifcvt-4.c for CRISHans-Peter Nilsson2023-03-041-1/+1
| | | | | | CRIS has no conditional execution and no conditional moves. * gcc.dg/ifcvt-4.c: Add cris-*-* to skip list.
* testsuite: Fix various scan-assembler identifiers not handling _-prefixHans-Peter Nilsson2023-03-043-8/+8
| | | | | | * g++.dg/cpp0x/pr84497.C: Handle USER_LABEL_PREFIX == "_" on scan-assembler identifiers. * gcc.dg/debug/btf/btf-enum64-1.c, gcc.dg/ipa/symver1.c: Ditto.
* Daily bump.GCC Administrator2023-03-0410-1/+319
|
* analyzer: start adding test coverage for OpenMP [PR109016]David Malcolm2023-03-032-0/+45
| | | | | | | | | gcc/testsuite/ChangeLog: PR analyzer/109016 * gcc.dg/analyzer/omp-parallel-for-1.c: New test. * gcc.dg/analyzer/omp-parallel-for-get-min.c: New test. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
* analyzer: provide placeholder implementation of sprintfDavid Malcolm2023-03-034-0/+400
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the analyzer lacked a known_function implementation of sprintf, and thus would handle calls to sprintf with the "anything could happen" fallback. Whilst working on PR analyzer/107565 I noticed that this was preventing a lot of genuine memory leaks from being reported for Doom; fixing thusly. Integration testing of the effect of the patch shows a big increase in true positives due to the case mentioned in Doom, and one new false positive (in pcre2), which I'm tracking as PR analyzer/109014. Comparison: GOOD: 67 -> 123 (+56); 10.91% -> 18.33% BAD: 547 -> 548 (+1) where the affected warnings/projects are: -Wanalyzer-malloc-leak: GOOD: 0 -> 56 (+56); 0.00% -> 41.48% BAD: 79 True positives: 0 -> 56 (+56) (all in Doom) -Wanalyzer-use-of-uninitialized-value: GOOD: 0; 0.00% BAD: 80 -> 81 (+1) False positives: pcre2-10.42: 0 -> 1 (+1) gcc/analyzer/ChangeLog: * kf.cc (class kf_sprintf): New. (register_known_functions): Register it. gcc/testsuite/ChangeLog: * gcc.dg/analyzer/doom-d_main-IdentifyVersion.c: New test. * gcc.dg/analyzer/sprintf-1.c: New test. * gcc.dg/analyzer/sprintf-concat.c: New test. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
* testsuite: remove XFAIL in gcc.dg/analyzer/pr99716-1.c [PR108988]David Malcolm2023-03-031-5/+1
| | | | | | | | | | | Jakub's r13-6441-gdbeccab7a1f5dc fix for PR tree-optimization/108988 has fixed this failing analyzer test. gcc/testsuite/ChangeLog: PR tree-optimization/108988 * gcc.dg/analyzer/pr99716-1.c (test_2): Remove xfail. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
* libstdc++: testsuite: async.cc early timeoutAlexandre Oliva2023-03-031-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The async call and future variable initialization may take a while to complete on uniprocessors, especially if the async call and other unrelated processes run before context switches back to the main thread. Taking steady_begin only then sometimes causes the 11*100ms in the slow clock, counted from before the async call, to not be enough for the measured wait to last 1s in the steady clock. I've seen it fall short of 1s by as little as a third of a tenth of a second in some cases, but in one surprisingly extreme case the elapsed wait time got only up to 216.7ms. Initializing both timestamps next to each other, before the async call, appears to avoid the problem entirely. I've renamed the variable moved out of the block so as to avoid name hiding in the subsequent block, that has another steady_begin variable. The second wait fails a lot less frequently, but the 2s limit has been exceeded, so I'm bumping up the max sleep to ~4s, and the tolerance to 3s. for libstdc++-v3/ChangeLog * testsuite/30_threads/async/async.cc (test04): Initialize steady_start, renamed from steady_begin, next to slow_start. Increase tolerance for final wait.
* d: Document that TypeInfo-based va_arg is not implementedIain Buclaw2023-03-031-0/+6
| | | | | | | | | PR d/108763 gcc/d/ChangeLog: * implement-d.texi (Missing Features): Document that TypeInfo-based va_arg is not implemented.
* [libstdc++] [prettyprint] add local std::string use to more testsAlexandre Oliva2023-03-032-0/+11
| | | | | | | | | | | | | | | | | | | | | | We're getting regressions after ugprading to GDB 13 in a few of the libstdc++ pretty-printing tests. It might seem like a GDB regression, but that update has a new symbol reader, and Tom Tromey says it exposes a latent problem in the pretty-printer, namely, when a name is not defined locally in the local translation unit, GDB will look for it in other units, and if multiple different definitions are available, there are no guarantees as to which one it will find. Since libstdc++ contains units in which std::string maps to different types, in order to ensure the tests get the std::string definition we expect, we need std::string to be present in the debug information for the test itself, as we already do in other tests. for libstdc++-v3/ChangeLog * testsuite/libstdc++-prettyprinters/80276.cc: Add std::string to debug info. * testsuite/libstdc++-prettyprinters/libfundts.cc: Likewise.
* link pthread_join from std::thread ctorAlexandre Oliva2023-03-032-9/+25
| | | | | | | | | | | | | | | | | | Like pthread_create, pthread_join may fail to be statically linked in absent strong uses, so add to user code strong references to both when std::thread objects are created. for libstdc++-v3/ChangeLog PR libstdc++/104852 PR libstdc++/95989 PR libstdc++/52590 * include/bits/std_thread.h (thread::_M_thread_deps): New static implicitly-inline member function. (std::thread template ctor): Pass it to _M_start_thread. * src/c++11/thread.cc (thread::_M_start_thread): Name depend parameter, force it live on entry.
* -Wdangling-pointer: don't mark SSA lhs sets as storesAlexandre Oliva2023-03-033-4/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | check_dangling_stores has some weirdnesses that causes its behavior to change when the target ABI requires C++ ctors to return this: while scanning stmts backwards in e.g. the AS ctor on a target that returns this in ctors, the scan first encounters a copy of this to the SSA name used to hold the return value. m_ptr_query.get_ref resolves lhs (the return SSA name) to the rhs (the default SSA name for this), does not skip it because auto_var_p is false for SSA_NAMEs, and proceeds to add it to stores, which seems to prevent later attempts to add stores into *this from succeeding, which disables warnings that should have triggered. This is also the case when the backwards search finds unrelated stores to other fields of *this before it reaches stores that IMHO should be warned about. The store found first disables checking of other stores, as if the store appearing later in the code would necessarily overwrite the store that should be warned about. I've added an xfailed variant of the existing test (struct An) that triggers this problem, but I'm not sure how to go about fixing it. Meanwhile, this patch prevents assignments with SSA_NAMEs in the lhs from being regarded as stores, which is enough to remove the undesirable side effect on -Wdangling-pointer of ABI-mandated ctors' returning this. Another variant of the existing test (struct Al) that demonstrates the problem regardless of this aspect of the ABI, and that gets the desired warning with the proposed patch, but not without. Curiously, this fix exposes yet another problem in Wdangling-pointer-5.c: it is the return stmt of the unrelated pointer p, not the store into possibly-overlapping *vpp2, that caused the warning to not be issued for the store in *vpp1. I'm not sure whether we should or should not warn in that case, but this patch adjusts the test to reflect the behavior change. for gcc/ChangeLog * gimple-ssa-warn-access.cc (pass_waccess::check_dangling_stores): Skip non-stores. for gcc/testsuite/ChangeLog * g++.dg/warn/Wdangling-pointer.C (warn_init_ref_member): Add two new variants, one fixed, one xfailed. * c-c++-common/Wdangling-pointer-5.c (nowarn_store_arg_store_arg): Add now-expected warnings.
* [arm] adjust tests for quotes around +cdecp<N>Alexandre Oliva2023-03-032-67/+67
| | | | | | | | | | | | | Back when quotes were added around "+cdecp<N>" in the "coproc must be a constant immediate" error in arm-builtins.cc, tests for that message lagged behind. Fixed thusly. for gcc/testsuite/ChangeLog * gcc.target/arm/acle/cde-errors.c: Adjust messages for quote around +cdecp<N>. * gcc.target/arm/acle/cde-mve-error-2.c: Likewise.
* [arm] adjust expectations for armv8_2-fp16-move-[12].cAlexandre Oliva2023-03-032-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 3a7ba8fd0cda387809e4902328af2473662b6a4a, a patch for tree-ssa-sink, enabled the removal of basic blocks in ways that affected the generated code for both of these tests, deviating from the expectations of the tests. The simplest case is that of -2, in which the edge unsplitting ends up enabling a conditional return rather than a conditional branch to a set-and-return block. That looks like an improvement to me, but the condition in which the branch or the return takes place can be reasonably reversed (and, with the current code, it is), I've relaxed the pattern in the test so as to accept reversed and unreversed conditions applied to return or branch opcodes. The situation in -1 is a little more elaborate: conditional branches based on FP compares in test_select_[78] are initially expanded with CCFPE compare-and-cbranch on G{T,E}, but when ce2 turns those into a cmove, because now we have a different fallthrough block, the condition is reversed, and that lands us with a compare-and-cmove sequence that needs CCFP for UNL{E,T}. The insn output reverses the condition and swaps the cmove input operands, so the vcmp and vsel insns come out the same except for the missing 'e' (for the compare mode) in vcmp, so, since such reversals could have happened to any of the tests depending on legitimate basic block layout, I've combined the vcmp and vcmpe counts. I see room for improving cmove sequence generation, e.g. trying direct and reversed conditions and selecting the cheapest one (which would require CCFP conditions to be modeled as more expensive than CCFPE), or for some other machine-specific (peephole2?) optimization to turn CCFP-requiring compare and cmove into CCFPE compare and swapped-inputs cmove, but I haven't tried that. for gcc/testsuite/ChangeLog * gcc.target/arm/armv8_2-fp16-move-1.c: Combine vcmp and vcmpe expected counts into a single pattern. * gcc.target/arm/armv8_2-fp16-move-2.c: Accept conditional return and reversed conditions.
* [PR51534] [arm] split out pr51534 test for softfpAlexandre Oliva2023-03-032-5/+76
| | | | | | | | | | | | | | | | | | | The test uses arm_hard_ok and arm_softfp_ok as if they were mutually exclusive, but they test whether the corresponding -mfloat-abi= flag is usable, not whether it is in effect, so it is possible for both to pass, and then the test comes out with incorrect expectations whichever the default float-abi is. Separate the test into hard and softfp variants, and extend the softfp variant to accept both ARM and Thumb opcodes; it unwarrantedly assumed the latter. for gcc/testsuite/ChangeLog PR target/51534 * gcc.target/arm/pr51534.c: Split softfp variant into... * gcc.target/arm/pr51534s.c: ... this, and support ARM too.
* [arm] complete vmsr/vmrs blank and case adjustmentsAlexandre Oliva2023-03-032-134/+134
| | | | | | | | | | | | | | | | | Back in September last year, some of the vmsr and vmrs patterns had an extraneous blank removed, and the case of register names lowered, but another instance remained, and so did a testcase. for gcc/ChangeLog * config/arm/vfp.md (*thumb2_movsi_vfp): Drop blank after tab after vmsr and vmrs, and lower the case of P0. for gcc/testsuite/ChangeLog * gcc.target/arm/acle/cde-mve-full-assembly.c: Drop blank after tab after vmsr, and lower the case of P0.
* [PR104882] [arm] require mve hw for mve run testAlexandre Oliva2023-03-031-0/+1
| | | | | | | | | | | The pr104882.c test is an execution test, but arm_v8_1m_mve_ok only tests for compile-time support. Add a requirement for mve hardware. for gcc/testsuite/ChangeLog PR target/104882 * gcc.target/arm/simd/pr104882.c: Require mve hardware.
* gcc: Fix gdbhooks.py VecPrinter for vec<> as well as vec<>* [PR109006]Jonathan Wakely2023-03-031-4/+7
| | | | | | | gcc/ChangeLog: PR middle-end/109006 * gdbhooks.py (VecPrinter): Handle vec<T> as well as vec<T>*.
* gcc: Adjust gdbhooks.py VecPrinter for vec layout changes [PR109006]Jonathan Wakely2023-03-031-1/+5
| | | | | | | gcc/ChangeLog: PR middle-end/109006 * gdbhooks.py (VecPrinter): Adjust for new vec layout.
* c++: thinko in extract_local_specs [PR108998]Patrick Palka2023-03-032-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to fix PR100295, r13-4730-g18499b9f848707 attempted to make extract_local_specs walk the given pattern twice, ignoring unevaluated operands the first time around so that we prefer to process a local specialization in an evaluated context if it appears in one (we process each local specialization once even if it appears multiple times in the pattern). But there's a thinko in the patch, namely that we don't actually walk the pattern twice since we don't clear the visited set for the second walk (to avoid processing a local specialization twice) and so the root node (and any node leading up to an unevaluated operand) is considered visited already. So the patch effectively made extract_local_specs ignore unevaluated operands altogether, which this testcase demonstrates isn't quite safe (extract_local_specs never sees 'aa' and we don't record its local specialization, so later we try to specialize 'aa' on the spot with the args {{int},{17}} which causes us to nonsensically substitute its auto with 17.) This patch fixes this by refining the second walk to start from the trees we skipped over during the first walk. PR c++/108998 gcc/cp/ChangeLog: * pt.cc (el_data::skipped_trees): New data member. (extract_locals_r): Push to skipped_trees any unevaluated contexts that we skipped over. (extract_local_specs): For the second walk, start from each tree in skipped_trees. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/lambda-generic11.C: New test.
* s390: libatomic: Fix 16 byte atomic {cas,load,store}Stefan Schulze Frielinghaus2023-03-033-0/+176
| | | | | | | | | | | | This is a follow-up to commit a4c6bd0821099f6b8c0f64a96ffd9d01a025c413 introducing a runtime check for alignment for 16 byte atomic compare-exchange, load, and store. libatomic/ChangeLog: * config/s390/cas_n.c: New file. * config/s390/load_n.c: New file. * config/s390/store_n.c: New file.
* waccess: Fix two -Wnonnull warning issues [PR108986]Jakub Jelinek2023-03-032-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following patch fixes 2 issues with the -Wnonnull warning. One, fixed by the second hunk, is that the warning wording is bogus since r11-3305, instead of printing warning: argument 1 to ‘int[static 7]’ is null where non-null expected [-Wnonnull] it prints warning: argument 1 to ‘int[static 28]’ is null where non-null expected [-Wnonnull] access_size is measured in bytes, so obviously will be correct as array number of elements only if it is 1 byte element array. In the function, access_nelts is either constant (if sizidx == -1) or when the array size is determined by some other parameter, I believe a value passed to that argument. Later on we query the range of it: if (get_size_range (m_ptr_qry.rvals, access_nelts, stmt, sizrng, 1)) which I bet must just return accesS_nelts in sizrng[0] and [1] if it is constant. access_size is later computed as: tree access_size = NULL_TREE; if (tree_int_cst_sgn (sizrng[0]) >= 0) { if (COMPLETE_TYPE_P (argtype)) { ... wide_int minsize = wi::to_wide (sizrng[0], prec); minsize *= wi::to_wide (argsize, prec); access_size = wide_int_to_tree (sizetype, minsize); } } else access_size = access_nelts; } and immediately after this the code does: if (integer_zerop (ptr)) { if (sizidx >= 0 && tree_int_cst_sgn (sizrng[0]) > 0) { some other warning wording } else if (access_size && access.second.static_p) { this spot } } So, because argtype is complete, access_size has been multiplied by argsize, but in case of this exact warning ("this spot" above) I believe access_nelts must be really constant, otherwise "some other warning wording" would handle it. So, I think access_nelts is exactly what we want to print there. The other problem is that since the introduction of -Wdangling-pointer in r12-6606, the pass has early and late instances and while lots of stuff in the pass is guarded on being done in the late pass only, this particular function is not, furthermore it is emitting two different warnings in a loop and already messes up with stuff like clearing warning suppression for one of the warning (ugh!). The end effect is that we warn twice about the same problem, once in the early and once in the late pass. Now, e.g. with -O2 -Wall we warn just once, during the early pass, as it is then optimized away, so I think just making this late warning only wouldn't be best. This patch instead returns early if either of the warnings is suppressed on the call stmt already. I think if one of the passes warned on it already (even if say on some other argument), then warning again (even on some other argument) is unnecessary, if both problems are visible in the same pass we'll still warn about both. 2023-03-03 Jakub Jelinek <jakub@redhat.com> PR c/108986 * gimple-ssa-warn-access.cc (pass_waccess::maybe_check_access_sizes): Return immediately if OPT_Wnonnull or OPT_Wstringop_overflow_ is suppressed on stmt. For [static %E] warning, print access_nelts rather than access_size. Fix up comment wording. * gcc.dg/Wnonnull-8.c: New test.
* s390: Use arch14 instead of z16 for -march=native.Robin Dapp2023-03-031-2/+2
| | | | | | | | | | | | When compiling on a system where binutils do not yet support the 'z16' name assembling fails with -march=native on a z16 machine. Currently, this is interpreted as -march=z16. This patch uses -march=arch14 instead. gcc/ChangeLog: * config/s390/driver-native.cc (s390_host_detect_local_cpu): Use arch14 instead of z16.
* s390: Fix ifcvt test cases.Robin Dapp2023-03-033-6/+6
| | | | | | | | | | | | We seem to flip flop between the "high" and "not low" variants of load on condition. Accept both in the affected test cases. gcc/testsuite/ChangeLog: * gcc.target/s390/ifcvt-two-insns-bool.c: Allow "high" and "not low or equal" load on condition variant. * gcc.target/s390/ifcvt-two-insns-int.c: Dito. * gcc.target/s390/ifcvt-two-insns-long.c: Dito.
* testsuite: Do not expect partial vectorization for s390.Robin Dapp2023-03-033-8/+8
| | | | | | | | | | | This changes SLP test expectations. As we only vectorize when no more than one rgroup is present, no vectorization is performed. gcc/testsuite/ChangeLog: * gcc.dg/vect/slp-3.c: Adapt test expectation. * gcc.dg/vect/slp-multitypes-11.c: Likewise. * gcc.dg/vect/slp-perm-8.c: Likewise.
* moxie: enable LRAAnthony Green2023-03-031-3/+0
| | | | | | | | Remove TARGET_LRA_P definition to enable LRA. gcc/ChangeLog: * config/moxie/moxie.cc (TARGET_LRA_P): Remove.
* moxie: fix memory constraintsAnthony Green2023-03-031-3/+3
| | | | | | | | | | Change define_constraint to define_memory_constraint where appropriate to fix LRA for moxie. gcc/ChangeLog: * config/moxie/constraints.md (A, B, W): Change define_constraint to define_memory_constraint.
* driver: toplev: Fix a typoXi Ruoyao2023-03-031-1/+1
| | | | | | | | | | | The driver emits a warning when -fstack-check and -fstack-clash-protection are used together, but the message refers to "-fstack-clash_protection" (underline instead of dash). gcc/ChangeLog: * toplev.cc (process_options): Fix the spelling of "-fstack-clash-protection".
* tree-optimization/109002 - partial PRE miscompilationRichard Biener2023-03-032-6/+41
| | | | | | | | | | | | | | | | | | | | Partial PRE ends up miscompiling the testcase in PR109002, likely involving a corner case when inifinite loops are involved. The following avoids the miscompilation by addressing a long-standing oddity that manifests in odd partial partial redundancies eliminated that are full redundancies. The oddity is that while we properly PHI translate the PA_IN set from the successors when computing PA_OUT but we fail to do the same for ANTIC_IN which is supposed to be unioned. That results in expressions with wrong virtual operands being placed in the PA_OUT/IN sets and the pruning machinery to go wrong because it assumes the expressions in the sets have virtual operands that are valid in the respective blocks. PR tree-optimization/109002 * tree-ssa-pre.cc (compute_partial_antic_aux): Properly PHI-translate ANTIC_IN. * gcc.dg/torture/pr109002.c: New testcase.
* libiberty: fix memory leak in pex-win32.c and refactorCostas Argyris2023-03-031-21/+10
| | | | | | | | | | | | | Fix memory leak of cmdline buffer and refactor to have cleanup code appear once for all exit cases. libiberty/ChangeLog: * pex-win32.c (win32_spawn): Fix memory leak of cmdline buffer and refactor to have cleanup code appear once for all exit cases. Signed-off-by: Jonathan Yong <10walls@gmail.com>
* gimple-fold: Fix up fputs -> fwrite folding [PR108988]Jakub Jelinek2023-03-031-7/+8
| | | | | | | | | | | | | | | | | gimple_fold_builtin_fputs when folding fputs into fwrite emits the third argument (INTEGER_CST) with incorrect type - get_maxval_strlen or c_strlen return ssizetype, while fwrite argument is size_type_node. The following patch fixes that, I've skimmed through the rest of gimple-fold.cc and in all other places get_maxval_strlen/c_strlen result was fold_converted to size_type_node already (or GIMPLE cast stmt has been emitted directly etc.). 2023-03-03 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/108988 * gimple-fold.cc (gimple_fold_builtin_fputs): Fold len to size_type_node before passing it as argument to fwrite. Formatting fixes.
* libstdc++: Update Solaris baselines for GCC 13.0Rainer Orth2023-03-034-0/+360
| | | | | | | | | | | | | | | | | This patch updates the libstdc++ Solaris baselines for GCC 13. Tested on i386-pc-solaris2.11 and sparc-sun-solaris2.11 (Solaris 11.3 and 11.4). 2022-12-11 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> libstdc++-v3: * config/abi/post/i386-solaris/baseline_symbols.txt: Regenerate. * config/abi/post/i386-solaris/amd64/baseline_symbols.txt: Likewise. * config/abi/post/sparc-solaris/baseline_symbols.txt: Likewise. * config/abi/post/sparc-solaris/sparcv9/baseline_symbols.txt: Likewise.
* target/108738 - limit STV chain discoveryRichard Biener2023-03-034-25/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following puts a hard limit on the inherently quadratic STV chain discovery. Without a limit for the compiler.i testcase in PR26854 we see at -O2 machine dep reorg : 574.45 ( 53%) with release checking while with the proposed limit it's machine dep reorg : 2.86 ( 1%) PR target/108738 * config/i386/i386.opt (--param x86-stv-max-visits): New param. * doc/invoke.texi (--param x86-stv-max-visits): Document it. * config/i386/i386-features.h (scalar_chain::max_visits): New. (scalar_chain::build): Add bitmap parameter, return boolean. (scalar_chain::add_insn): Likewise. (scalar_chain::analyze_register_chain): Likewise. * config/i386/i386-features.cc (scalar_chain::scalar_chain): Initialize max_visits. (scalar_chain::analyze_register_chain): When we exhaust max_visits, abort. Also abort when running into any disallowed insn. (scalar_chain::add_insn): Propagate abort. (scalar_chain::build): Likewise. When aborting amend the set of disallowed insn with the insns set. (convert_scalars_to_vector): Adjust. Do not convert aborted chains.
* debug/108772 - ICE with late debug generated with -fltoRichard Biener2023-03-032-1/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | When combining -g1 with -flto we run into the DIE location annotation machinery for globals calling dwarf2out_late_global_decl but not having any early generated DIE for function scope statics. In this process we'd generate a limbo DIE since also the function scope doesn't have any early generated DIE. The limbo handling then tries to force a DIE for the context chain which ultimatively fails and ICEs at the std namespace decl because at -g1 we don't represent that. The following avoids this situation by making sure to never generate any DIEs from dwarf2out_late_global_decl in the in_lto_p path for function scope globals but rely on DIE generation for the function to output a DIE for the local static (which doesn't happen for -g1). I explored a lot of other options to fix this but in the end this seems to be the most spot-on fix with the least risk of unwanted effects. PR debug/108772 * dwarf2out.cc (dwarf2out_late_global_decl): Do not generate a DIE for a function scope static. * g++.dg/lto/pr108772_0.C: New testcase.
* [PR100127] Test for coroutine header in clang-compatible testsAlexandre Oliva2023-03-033-3/+6
| | | | | | | | | | | | | | | | The test is compatible with clang as well as gcc, but ISTM that testing for the __clang__ macro is just as potentially error-prone as macros that used to be GCC-specific are now defined in compilers that aim for GCC compatibility. Use a __has_include feature test instead. for gcc/testsuite/ChangeLog PR c++/100127 * g++.dg/coroutines/pr100127.C: Test for header rather than compiler macro. * g++.dg/coroutines/pr100772-a.C: Likewise. * g++.dg/coroutines/pr100772-b.C: Likewise.