aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2022-09-23testsuite: make check-functions-body dump expected and seen cases on failure.Tamar Christina1-1/+6
Often times when a check_function_body check fails it can be quite hard to figure out why as no additional information is provided. This changes it so that on failures it prints out the regex expression it's using and the text it's comparing against to the verbose log. This makes it much easier to figure out why a test has failed. gcc/testsuite/ChangeLog: * lib/scanasm.exp (check_function_body): Add debug output to verbose log on failure.
2022-09-23frange: drop endpoints to min/max representable numbers for -ffinite-math-only.Aldy Hernandez3-45/+94
Similarly to how we drop NANs to UNDEFINED when -ffinite-math-only, I think we can drop the numbers outside of the min/max representable numbers to the representable number. This means the endpoings to VR_VARYING for -ffinite-math-only can now be the min/max representable, instead of -INF and +INF. Saturating in the setter means that the upcoming implementation for binary operators no longer have to worry about doing the right thing for -ffinite-math-only. If the range goes outside the limits, it'll get chopped down. Tested on x86-64 Linux. gcc/ChangeLog: * range-op-float.cc (build_le): Use vrp_val_*. (build_lt): Same. (build_ge): Same. (build_gt): Same. * value-range.cc (frange::set): Chop ranges outside of the representable numbers for -ffinite-math-only. (frange::normalize_kind): Use vrp_val*. (frange::verify_range): Same. (frange::set_nonnegative): Same. (range_tests_floats): Remove tests that depend on -INF and +INF. * value-range.h (real_max_representable): Add prototype. (real_min_representable): Same. (vrp_val_max): Set max representable number for -ffinite-math-only. (vrp_val_min): Same but for min. (frange::set_varying): Use vrp_val*.
2022-09-23Add debug functions for REAL_VALUE_TYPE.Aldy Hernandez1-0/+8
We currently have no way of dumping REAL_VALUE_TYPEs when debugging. Tested on a gdb session examining the real value 10.0: (gdb) p min $9 = {cl = 1, decimal = 0, sign = 0, signalling = 0, canonical = 0, uexp = 4, sig = {0, 0, 11529215046068469760}} (gdb) p debug (min) 0x0.ap+4 gcc/ChangeLog: * real.cc (debug): New.
2022-09-23frange: dump hex values when dumping FP numbers.Aldy Hernandez2-4/+16
It has been suggested that if we start bumping numbers by an ULP when calculating open ranges (for example the numbers less than 3.0) that dumping these will become increasingly harder to read, and instead we should opt for the hex representation. I still find the floating point representation easier to read for most numbers, but perhaps we could have both? With this patch this is the representation for [15.0, 20.0]: [frange] float [1.5e+1 (0x0.fp+4), 2.0e+1 (0x0.ap+5)] Would you find this useful, or should we stick to the hex representation only? Tested on x86-64 Linux. gcc/ChangeLog: * value-range-pretty-print.cc (vrange_printer::print_real_value): New. (vrange_printer::visit): Call print_real_value. * value-range-pretty-print.h: New print_real_value.
2022-09-23opts: fix --help=common with '\t' descriptionMartin Liska2-2/+2
Fixes -flto-compression option: - -flto-compression-level=<number> Use z Use zlib/zstd compression level <number> for IL. + -flto-compression-level=<0,19> Use zlib/zstd compression level <number> for IL. gcc/ChangeLog: * common.opt: Update -flto-compression-level documentation. * opts.cc (print_filtered_help): Do not append range to an option that uses \t syntax.
2022-09-23testsuite: Fix up pr106922.C testJakub Jelinek1-2/+2
On Thu, Sep 22, 2022 at 01:10:08PM +0200, Richard Biener via Gcc-patches wrote: > * g++.dg/tree-ssa/pr106922.C: Adjust. > --- a/gcc/testsuite/g++.dg/tree-ssa/pr106922.C > +++ b/gcc/testsuite/g++.dg/tree-ssa/pr106922.C > @@ -87,5 +87,4 @@ void testfunctionfoo() { > } > } > > -// { dg-final { scan-tree-dump-times "Found fully redundant value" 4 "pre" { xfail { ! lp64 } } } } > -// { dg-final { scan-tree-dump-not "m_initialized" "cddce3" { xfail { ! lp64 } } } } > +// { dg-final { scan-tree-dump-not "m_initialized" "dce3" } } I've noticed +UNRESOLVED: g++.dg/tree-ssa/pr106922.C -std=gnu++20 scan-tree-dump-not dce3 "m_initialized" +UNRESOLVED: g++.dg/tree-ssa/pr106922.C -std=gnu++2b scan-tree-dump-not dce3 "m_initialized" with this change, both on x86_64 and i686. The dump is still cddce3, additionally as the last reference to the pre dump is gone, not sure it is worth creating that dump. With the following patch, there aren't FAILs nor UNRESOLVED tests with GXX_TESTSUITE_STDS=98,11,14,17,20,2b make check-g++ RUNTESTFLAGS="--target_board=unix\{-m32,-m64\} dg.exp='pr106922.C'" 2022-09-23 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/106922 * g++.dg/tree-ssa/pr106922.C: Scan in cddce3 dump rather than dce3. Remove -fdump-tree-pre-details from dg-options.
2022-09-23attribs: Improve diagnosticsJakub Jelinek1-0/+3
When looking at the attribs code, I've noticed weird diagnostics like int a __attribute__((section ("foo", "bar"))); a.c:1:1: error: wrong number of arguments specified for ‘section’ attribute 1 | int a __attribute__((section ("foo", "bar"))); | ^~~ a.c:1:1: note: expected between 1 and 1, found 2 As roughly 50% of attributes that accept any arguments have spec->min_length == spec->max_length, I think it is worth it to have separate wording for such common case and just write simpler a.c:1:1: note: expected 1, found 2 2022-09-23 Jakub Jelinek <jakub@redhat.com> * attribs.cc (decl_attributes): Improve diagnostics, instead of saying expected between 1 and 1, found 2 just say expected 1, found 2.
2022-09-23i386: Optimize code generation of __mm256_zextsi128_si256(__mm_set1_epi8(-1))Hu, Lin112-13/+235
gcc/ChangeLog: PR target/94962 * config/i386/constraints.md (BH): New define_constraint. * config/i386/i386.cc (standard_sse_constant_p): Add return 3/4 when operand matches new predicate. (standard_sse_constant_opcode): Add new alternative branch to return "vpcmpeqd". * config/i386/predicates.md (vector_all_ones_zero_extend_half_operand): New define_predicate. (vector_all_ones_zero_extend_quarter_operand): Ditto. * config/i386/sse.md: Add constraint to insn "mov<mode>_internal". gcc/testsuite/ChangeLog: PR target/94962 * gcc.target/i386/avx256-unaligned-load-1.c: Modify test. * gcc.target/i386/avx256-unaligned-store-1.c: Ditto. * gcc.target/i386/avx256-unaligned-store-2.c: Ditto. * gcc.target/i386/avx256-unaligned-store-3.c: Ditto. * gcc.target/i386/pr94962-1.c: New test. * gcc.target/i386/pr94962-2.c: Ditto. * gcc.target/i386/pr94962-3.c: Ditto. * gcc.target/i386/pr94962-4.c: Ditto.
2022-09-22c++: ICE-on-invalid with designated initializer [PR106983]Marek Polacek2-1/+14
We ICE in the code added in r12-7117: type_build_dtor_call gets the error_mark_node because the type of 'prev' wasn't declared. PR c++/106983 gcc/cp/ChangeLog: * typeck2.cc (split_nonconstant_init_1): Check TYPE_P. gcc/testsuite/ChangeLog: * g++.dg/other/error36.C: New test.
2022-09-23Daily bump.GCC Administrator8-1/+320
2022-09-22Update gcc fr.poJoseph Myers1-11/+8
* fr.po: Update.
2022-09-22Convert CFN_BUILT_IN_PARITY to range-ops.Andrew MacLeod3-52/+31
Also, as the last builtin remaining, also remove the builtin infrastrucure routines from fold_using_range. * gimple-range-fold.cc (range_of_range_op): Handle no operands. (range_of_call): Do not check for builtins. (fold_using_range::range_of_builtin_call): Delete. (fold_using_range::range_of_builtin_int_call): Delete. * gimple-range-fold.h: Adjust prototypes. * gimple-range-op.cc (class cfn_parity): New. (gimple_range_op_handler::maybe_builtin_call): Set arguments.
2022-09-22Convert CFN_BUILT_IN_GOACC_DIM_* to range-ops.Andrew MacLeod2-19/+47
* gimple-range-fold.cc (range_of_builtin_int_call): Remove case for CFN_GOACC_DIM_*. * gimple-range-op.cc (class cfn_goacc_dim): New. (gimple_range_op_handler::maybe_builtin_call): Set arguments.
2022-09-22Convert CFN_BUILT_IN_STRLEN to range-ops.Andrew MacLeod2-21/+37
* gimple-range-fold.cc (range_of_builtin_int_call): Remove case for CFN_BUILT_IN_STRLEN. * gimple-range-op.cc (class cfn_strlen): New. (gimple_range_op_handler::maybe_builtin_call): Set arguments.
2022-09-22Convert CFN_BUILT_IN_UBSAN_CHECK_* to range-ops.Andrew MacLeod2-46/+57
* gimple-range-fold.cc (range_of_builtin_ubsan_call): Delete. (range_of_builtin_int_call): Remove cases for CFN_BUILT_IN_UBSAN_CHECK. * gimple-range-op.cc (class cfn_ubsan): New. (gimple_range_op_handler::maybe_builtin_call): Set arguments.
2022-09-22Convert CFN_BUILT_IN_CLRSB to range-ops.Andrew MacLeod2-7/+23
* gimple-range-fold.cc (range_of_builtin_int_call): Remove case for CFN_BUILT_IN_CLRSB. * gimple-range-op.cc (class cfn_clrsb): New. (gimple_range_op_handler::maybe_builtin_call): Set arguments.
2022-09-22Convert CFN_CTZ builtins to range-ops.Andrew MacLeod2-60/+80
* gimple-range-fold.cc (range_of_builtin_int_call): Remove case for CFN_CTZ. * gimple-range-op.cc (class cfn_ctz): New. (gimple_range_op_handler::maybe_builtin_call): Set arguments.
2022-09-22Convert CFN_CLZ builtins to range-ops.Andrew MacLeod2-61/+84
* gimple-range-fold.cc (range_of_builtin_int_call): Remove case for CFN_CLZ. * gimple-range-op.cc (class cfn_clz): New. (gimple_range_op_handler::maybe_builtin_call): Set arguments.
2022-09-22Convert CFN_BUILT_FFS and CFN_POPCOUNT to range-ops.Andrew MacLeod2-22/+34
* gimple-range-fold.cc (range_of_builtin_int_call): Remove case for CFN_FFS and CFN_POPCOUNT. * gimple-range-op.cc (class cfn_pocount): New. (gimple_range_op_handler::maybe_builtin_call): Set arguments.
2022-09-22Convert CFN_BUILT_IN_TOUPPER and TOLOWER to range-ops.Andrew MacLeod2-66/+77
* gimple-range-fold.cc (get_letter_range): Move to new class. (range_of_builtin_int_call): Remove case for CFN_BUILT_IN_TOUPPER and CFN_BUILT_IN_TOLOWER. * gimple-range-op.cc (class cfn_toupper_tolower): New. (gimple_range_op_handler::maybe_builtin_call): Set arguments.
2022-09-22Convert CFN_BUILT_IN_SIGNBIT to range-ops.Andrew MacLeod2-20/+27
* gimple-range-fold.cc (range_of_builtin_int_call): Remove case for CFN_BUILT_IN_SIGNBIT. * gimple-range-op.cc (class cfn_signbit): New. (gimple_range_op_handler::maybe_builtin_call): Set arguments.
2022-09-22Add range-ops support for builtin functions.Andrew MacLeod3-25/+97
Convert CFN_BUILT_IN_CONSTANT_P as first POC. * gimple-range-fold.cc (fold_using_range::range_of_builtin_int_call): Remove case for CFN_BUILT_IN_CONSTANT_P. * gimple-range-op.cc (gimple_range_op_handler::supported_p): Check if a call also creates a range-op object. (gimple_range_op_handler): Also check builtin calls. (class cfn_constant_float_p): New. Float CFN_BUILT_IN_CONSTANT_P. (class cfn_constant_p): New. Integral CFN_BUILT_IN_CONSTANT_P. (gimple_range_op_handler::maybe_builtin_call): Set arguments and handler for supported built-in calls. * gimple-range-op.h (maybe_builtin_call): New prototype.
2022-09-22Always check the return value of fold_range.Andrew MacLeod4-8/+16
The fold_range routine in range-ops returns FALSE if the operation fails. There are a few places which assume the operation was successful. Fix those. * gimple-range-fold.cc (range_of_range_op): Set result to VARYING if the call to fold_range fails. * tree-data-ref.cc (compute_distributive_range): Ditto. * tree-vrp.cc (range_fold_binary_expr): Ditto. (range_fold_unary_expr): Ditto. * value-query.cc (range_query::get_tree_range): Ditto.
2022-09-22Add missing float fold_range prototype for floats.Andrew MacLeod3-3/+25
Unary operations require op2 to be the range of the type of the LHS. This is so the type for the LHS can be properly set. * range-op-float.cc (range_operator_float::fold_range): New base method for "int = float op int". * range-op.cc (range_op_handler::fold_range): New case. * range-op.h: Update prototypes.
2022-09-22Fix calc_op1 for undefined op2_range.Andrew MacLeod1-2/+6
Unary operations pass the type of operand 1 into op1_range. If that range is undefined, the routine blindly picks the type of operand 2, which in the case of a unary op, does not exist and traps. * gimple-range-op.cc (gimple_range_op_handler::calc_op1): Use operand 1 for second range if there is no operand 2.
2022-09-22Create gimple_range_op_handler in a new source file.Andrew MacLeod12-293/+386
Range-ops is meant to be IL independent. Some gimple processing has be placed in range-ops, and some is located in gori. Split it all into a file and isolate it in a new class gimple_range_op_handler. * Makefile.in (OBJS): Add gimple-range-op.o. * gimple-range-edge.cc (gimple_outgoing_range_stmt_p): Use gimple_range_op_handler. * gimple-range-fold.cc (gimple_range_base_of_assignment): Move to a method in gimple_range_op_handler. (gimple_range_operand1): Ditto. (gimple_range_operand2): Ditto. (fold_using_range::fold_stmt): Use gimple_range_op_handler. (fold_using_range::range_of_range_op): Ditto. (fold_using_range::relation_fold_and_or): Ditto. (fur_source::register_outgoing_edges): Ditto. (gimple_range_ssa_names): Relocate to gimple-range-op.cc. * gimple-range-fold.h: Adjust prototypes. * gimple-range-gori.cc (gimple_range_calc_op1): Move to a method in gimple_range_op_handler. (gimple_range_calc_op2): Ditto. (gori_compute::compute_operand_range): Use gimple_range_op_handler. (gori_compute::compute_logical_operands): Ditto. (compute_operand1_range): Ditto. (gori_compute::compute_operand2_range): Ditto. (gori_compute::compute_operand1_and_operand2_range): Ditto. * gimple-range-gori.h: Adjust protoypes. * gimple-range-op.cc: New. Supply gimple_range_op_handler methods. * gimple-range-op.h: New. Supply gimple_range_op_handler class. * gimple-range.cc (gimple_ranger::prefill_name): Use gimple_range_op_handler. (gimple_ranger::prefill_stmt_dependencies): Ditto. * gimple-range.h: Include gimple-range-op.h. * range-op.cc (range_op_handler::range_op_handler): Adjust and remove gimple * parameter option. * range-op.h: Adjust prototypes.
2022-09-22Adjust range_op_handler to store the handler directly.Andrew MacLeod2-140/+114
Range_op_handler currently stores a tree code and a type. It defers checking to see if there is a valid handler until asked. This change checks at constuctor time and store a pointer to the handler if there is one. * range-op.cc (range_op_handler::set_op_handler): Set new fields. (ange_op_handler::range_op_handler): Likewise. (range_op_handler::operator bool): Remove. (range_op_handler::fold_range): Use appropriate handler. (range_op_handler::op1_range): Likewise. (range_op_handler::op2_range): Likewise. (range_op_handler::lhs_op1_relation): Likewise. (range_op_handler::lhs_op2_relation): Likewise. (range_op_handler::op1_op2_relation): Likewise. * range-op.h (class range_op_handler): Store handler pointers. (range_op_handler:: operator bool): Inline.
2022-09-22Replace another snippet with a call to gimple_range_ssa_names.Andrew MacLeod1-17/+3
When the original patch was applied, I missed a spot which could also be rewritten to use gimple_range_ssa_names. * tree-ssa-threadbackward.cc (back_threader::find_paths_to_names): Replace sequence with a call to gimple_range_ssa_names.
2022-09-22Fortran: Fix automatic reallocation inside select rank [PR100103]José Rui Faustino de Sousa2-2/+78
gcc/fortran/ChangeLog: PR fortran/100103 * trans-array.cc (gfc_is_reallocatable_lhs): Add select rank temporary associate names as possible targets of automatic reallocation. gcc/testsuite/ChangeLog: PR fortran/100103 * gfortran.dg/PR100103.f90: New test.
2022-09-22Fortran: fix ICE in generate_coarray_sym_init [PR82868]Harald Anlauf2-0/+16
gcc/fortran/ChangeLog: PR fortran/82868 * trans-decl.cc (generate_coarray_sym_init): Skip symbol if attr.associate_var. gcc/testsuite/ChangeLog: PR fortran/82868 * gfortran.dg/associate_26a.f90: New test.
2022-09-22cmd/cgo: add and use runtime/cgo.Incomplete instead of //go:notinheapIan Lance Taylor1-1/+1
This ports https://go.dev/cl/421879 to libgo. This is a quick port to update gofrontend to work with the version of cgo in gc mainline. A more complete port will follow, changing the gc version of cmd/cgo to choose an approach based on feature testing the gccgo in use. Updates golang/go#46731 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/432338
2022-09-22tree-optimization/102801 - testcase for uninit diagnosticRichard Biener1-0/+55
The following testcase is fixed in GCC 12+ PR tree-optimization/102801 gcc/testsuite/ * g++.dg/warn/Wuninitialized-33.C: New testcase.
2022-09-22c++ modules: partial variable template specializations [PR106826]Patrick Palka3-14/+82
With partial variable template specializations, it looks like we stream the VAR_DECL (i.e. the DECL_TEMPLATE_RESULT of the corresponding TEMPLATE_DECL) since process_partial_specialization adds it to the specializations table, but we end up never streaming the corresponding TEMPLATE_DECL itself that's reachable only from the primary template's DECL_TEMPLATE_SPECIALIZATIONS list, which leads to this list being incomplete on stream-in. The modules machinery already has special logic for streaming partial specializations of class templates; this patch attempts to generalize it to handle those of variable templates as well. PR c++/106826 gcc/cp/ChangeLog: * module.cc (trees_out::decl_value): Use get_template_info in the MK_partial case to handle both VAR_DECL and TYPE_DECL. (trees_out::key_mergeable): Likewise. (trees_in::key_mergeable): Likewise. (has_definition): Consider DECL_INITIAL of a partial variable template specialization. (depset::hash::make_dependency): Handle partial variable template specializations too. gcc/testsuite/ChangeLog: * g++.dg/modules/partial-2_a.C: New test. * g++.dg/modules/partial-2_b.C: New test.
2022-09-22remove -gz=zlib-gnu option valueMartin Liska4-115/+20
The option value is legacy and probably not used at all, thus ignore it. gcc/ChangeLog: * configure: Regenerate. * configure.ac: Simplify to gcc_cv_ld_compress_debug={0,1} and gcc_cv_as_compress_debug={0,1}. * doc/invoke.texi: Document the removal. * gcc.cc (LINK_COMPRESS_DEBUG_SPEC): Simplify and ignore zlib-gnu. (ASM_COMPRESS_DEBUG_SPEC): Likewise. Co-Authored-By: Fangrui Song <i@maskray.me>
2022-09-22c: fix uninitialized c_expr::m_decimal [PR106830]David Malcolm6-7/+35
I added c_expr::m_decimal in r13-2386-gbedfca647a9e9c1a as part of the implementation of -Wxor-used-as-pow, but I missed various places where the field needed to be initialized. Fixed thusly. gcc/c-family/ChangeLog: PR c/106830 * c-warn.cc (check_for_xor_used_as_pow): Don't try checking values that don't fit in uhwi. gcc/c/ChangeLog: PR c/106830 * c-parser.cc (c_parser_initelt): Initialize m_decimal. (c_parser_cast_expression): Likewise. (c_parser_alignof_expression): Likewise. (c_parser_postfix_expression_after_paren_type): Likewise. (c_parser_postfix_expression_after_primary): Likewise. (c_parser_expression): Likewise. (c_parser_omp_variable_list): Likewise. (c_parser_transaction_expression): Likewise. * c-tree.h (c_expr::set_error): Likewise. * c-typeck.cc (c_expr_sizeof_expr): Likewise. (parser_build_unary_op): Likewise. (parser_build_binary_op): Likewise. (digest_init): Likewise. (pop_init_level): Likewise. * gimple-parser.cc (c_parser_gimple_call_internal): Likewise. gcc/testsuite/ChangeLog: PR c/106830 * gcc.dg/Wxor-used-as-pow-pr106830.c: New test. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2022-09-22tree-optimization/106922 - missed FRE/PRERichard Biener3-32/+93
The following enhances the store-with-same-value trick in vn_reference_lookup_3 by not only looking for a = val; *ptr = val; .. = a; but also *ptr = val; other = x; .. = a; where the earlier store is more than one hop away. It does this by queueing the actual value to compare until after the walk but as disadvantage only allows a single such skipped store from a constant value. Unfortunately we cannot handle defs from non-constants this way since we're prone to pick up values from the past loop iteration this way and we have no good way to identify values that are invariant in the currently iterated cycle. That's why we keep the single-hop lookup for those cases. gcc.dg/tree-ssa/pr87126.c would be a testcase that's un-XFAILed when we'd handle those as well. PR tree-optimization/106922 * tree-ssa-sccvn.cc (vn_walk_cb_data::same_val): New member. (vn_walk_cb_data::finish): Perform delayed verification of a skipped may-alias. (vn_reference_lookup_pieces): Likewise. (vn_reference_lookup): Likewise. (vn_reference_lookup_3): When skipping stores of the same value also handle constant stores that are more than a single VDEF away by delaying the verification. * gcc.dg/tree-ssa/ssa-fre-100.c: New testcase. * g++.dg/tree-ssa/pr106922.C: Adjust.
2022-09-22xtensa: gcc: enable section anchors supportMax Filippov1-0/+3
gcc/ * config/xtensa/xtensa.cc (TARGET_MAX_ANCHOR_OFFSET): New definition.
2022-09-22xtensa: gcc: implement MI thunk generation for call0 ABIMax Filippov1-1/+115
gcc/ * config/xtensa/xtensa.cc (xtensa_can_output_mi_thunk) (xtensa_output_mi_thunk): New functions. (TARGET_ASM_CAN_OUTPUT_MI_THUNK) (TARGET_ASM_OUTPUT_MI_THUNK): New macro definitions. (xtensa_prepare_expand_call): Use fixed register a8 as temporary when called with reload_completed set to 1.
2022-09-22tree-optimization/99407 - DSE with data-ref analysisRichard Biener3-3/+52
The following resolves the issue that DSE cannot handle references with variable offsets well when identifying possible uses of a store. Instead of just relying on ref_maybe_used_by_stmt_p we use data-ref analysis, making sure to perform that at most once per stmt. The new mode is only exercised by the DSE pass before loop optimization as specified by a new pass parameter and when expensive optimizations are enabled, so it's disabled below -O2. PR tree-optimization/99407 * tree-ssa-dse.cc (dse_stmt_to_dr_map): New global. (dse_classify_store): Use data-ref analysis to disambiguate more uses. (pass_dse::use_dr_analysis_p): New pass parameter. (pass_dse::set_pass_param): Implement. (pass_dse::execute): Allocate and deallocate dse_stmt_to_dr_map. * passes.def: Allow DR analysis for the DSE pass before loop. * gcc.dg/vect/tsvc/vect-tsvc-s243.c: Remove XFAIL.
2022-09-22Some VN TLCRichard Biener1-16/+27
The following was prompted by review of the patch introducing equivalences to VN. * tree-ssa-sccvn.cc (can_track_predicate_on_edge): New function split out from ... (vn_nary_op_insert_pieces_predicated): ... here.
2022-09-22Fix typo in floorv2sf2, should be register_operand for op1, not vector_operand.liuhongt2-1/+25
gcc/ChangeLog: PR target/106994 * config/i386/mmx.md (floorv2sf2): Fix typo, use register_operand instead of vector_operand for operands[1]. gcc/testsuite/ChangeLog: * gcc.target/i386/pr106994.c: New test.
2022-09-22Daily bump.GCC Administrator3-1/+83
2022-09-21[PR106967] Set known NANs to undefined for flag_finite_math_only.Aldy Hernandez1-2/+7
Explicit NANs in the IL can be treated as undefined for flag_finite_math_only. This causes all the right things to happen wrt threading, folding, etc. It also saves us special casing throughout. PR tree-optimization/106967 gcc/ChangeLog: * value-range.cc (frange::set): Set known NANs to undefined for flag_finite_math_only.
2022-09-21Clear unused flags in frange for undefined ranges.Aldy Hernandez2-4/+8
gcc/ChangeLog: * value-range.cc (frange::combine_zeros): Call set_undefined. (frange::intersect_nans): Same. (frange::intersect): Same. (frange::verify_range): Undefined ranges do not have a type. * value-range.h (frange::set_undefined): Clear NAN flags and type.
2022-09-21tree-optimization/106984 - tsan and COND_EXPR GIMPLERichard Biener2-6/+14
The following adjusts a missed spot in TSAN for the RHS COND_EXPR GIMPLE IL rework. PR tree-optimization/106984 * tsan.cc (instrument_builtin_call): Build the COND_EXPR condition in a separate statement. * gcc.dg/tsan/pr106984.c: New testcase.
2022-09-21Fortran: handle RADIX kind in IEEE_SET_ROUNDING_MODEFrancois-Xavier Coudert1-0/+27
Make sure that calling IEEE_SET_ROUNDING_MODE with RADIX=10 does not affect the binary rounding mode. 2022-09-21 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> libgfortran/ * ieee/ieee_arithmetic.F90 (IEEE_SET_ROUNDING_MODE): Handle RADIX argument better. gcc/testsuite/ * gfortran.dg/ieee/rounding_3.f90: New test.
2022-09-21aarch64: Rewrite -march=native to -mcpu if no other -mcpu or -mtune is givenKyrylo Tkachov1-18/+32
We have received requests to improve the out-of-the box experience and performance of AArch64 GCC users, particularly those porting software from other architectures. This has many aspects. One such aspect are apps built natively with an -march=native used as a tuning flag in the Makefile. On AArch64 this selects the right architecture features on GNU+Linux for the host system but tunes for the "generic" CPU target. This patch makes GCC also tune for the host CPU, as well as selecting its architecture. That is, it translates -march=native into -mcpu=native. This maintains the documentation that it "causes the compiler to pick the architecture of the host system" since -mcpu=native does that, but it also gives a better performance experience for the user. If the user explicitly asked for a particular CPU tuning through -mcpu or -mtune then we don't do this rewriting so that the user option is honoured. This would have been a one-line patch if it wasn't for --with-tune configure-time arguments. When GCC is configured with --with-tune=<CORE> the OPTION_DEFAULT_SPECS will insert an -mtune=<CORE> in the options if no other -mcpu or -mtune options were given. This will spook the aforementioned desired rewriting of -march=native into -mcpu=native, though I'd argue that we want to do the rewrite even then. Therefore, this patch moves some specs in aarch64.h around and refactors the --with-tune rewriting into CONFIG_TUNE_SPEC so that the materialization of the implicit -mtune=<CORE> does not happen if -march=native is used. Bootstrapped and tested on aarch64-none-linux-gnu and checked with the output of -### from the driver that the option rewriting works as expected on aarch64-linux-gnu. gcc/ChangeLog: * config/aarch64/aarch64.h (HAVE_LOCAL_CPU_DETECT, EXTRA_SPEC_FUNCTIONS, MCPU_MTUNE_NATIVE_SPECS): Move definitions up before OPTION_DEFAULT_SPECS. (MCPU_MTUNE_NATIVE_SPECS): Pass "cpu" to local_cpu_detect when rewriting -march=native and no -mcpu or -mtune is given. (CONFIG_TUNE_SPEC): Define. (OPTION_DEFAULT_SPECS): Use CONFIG_TUNE_SPEC for "tune".
2022-09-21[PR106967] frange: revamp relational operators for NANs.Aldy Hernandez2-93/+193
Since NANs can be inserted by other passes even for -ffinite-math-only, we can't depend on the flag to determine if a NAN is a possiblity. Instead, we must explicitly check for them. In the case of -ffinite-math-only, paths leading up to a NAN are undefined and can be considered unreachable. I have audited all the relational code and made sure we're handling the known NAN case before anything else, setting undefined when appropriate. In the process, I revamped all the relational code handling NANs to correctly notice paths that are unreachable. The basic structure for ordered relational operators (except != of course) is this: If either operand is a known NAN, return FALSE. The true side of a relop when one operand is a NAN is unreachable. On the false side of a relop when one operand is a NAN, we know nothing about the other operand. Regstrapped on x86-64 and ppc64le Linux. lapack testing on x86-64 with and without -ffinite-math-only. PR tree-optimization/106967 gcc/ChangeLog: * range-op-float.cc (foperator_equal::fold_range): Adjust for NAN. (foperator_equal::op1_range): Same. (foperator_not_equal::fold_range): Same. (foperator_not_equal::op1_range): Same. (foperator_lt::fold_range): Same. (foperator_lt::op1_range): Same. (foperator_lt::op2_range): Same. (foperator_le::fold_range): Same. (foperator_le::op1_range): Same. (foperator_le::op2_range): Same. (foperator_gt::fold_range): Same. (foperator_gt::op1_range): Same. (foperator_gt::op2_range): Same. (foperator_ge::fold_range): Same. (foperator_ge::op1_range): Same. (foperator_ge::op2_range): Same. (foperator_unordered::op1_range): Same. (foperator_ordered::fold_range): Same. (foperator_ordered::op1_range): Same. (build_le): Assert that we don't have a NAN. (build_lt): Same. (build_gt): Same. (build_ge): Same. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/pr106967.c: New test.
2022-09-21Don't check can_vec_perm_const_p for nonlinear iv_init when it's constant.liuhongt2-1/+18
When init_expr is INTEGER_CST or REAL_CST, can_vec_perm_const_p is not necessary since there's no real vec_perm needed, but vec_gen_perm_mask_checked will gcc_assert (can_vec_perm_const_p). So it's better to use vec_gen_perm_mask_any in vect_create_nonlinear_iv_init. gcc/ChangeLog: PR tree-optimization/106963 * tree-vect-loop.cc (vect_create_nonlinear_iv_init): Use vec_gen_perm_mask_any instead of vec_gen_perm_mask_check. gcc/testsuite/ChangeLog: * gcc.target/i386/pr106963.c: New test.
2022-09-21Daily bump.GCC Administrator6-1/+227