gcc/fortran/ChangeLog:
PR fortran/102787
* array.c (expand_constructor): When encountering a constant array
expression or array section within a constructor, simplify it to
enable better expansion.
gcc/testsuite/ChangeLog:
* gfortran.dg/array_constructor_54.f90: New test.
richi's recent unreachable code warning experiments had trouble with the C++
front end folding away an 'if' with a constant condition. Let's do less
folding at the statement level.
gcc/cp/ChangeLog:
* cp-gimplify.c (genericize_if_stmt): Always build a COND_EXPR.
In C++17 mode all callers of _S_relocate have already done:
if constexpr (_S_use_relocate())
so we don't need to repeat that check and use tag dispatching to avoid
ill-formed instantiations.
libstdc++-v3/ChangeLog:
* include/bits/stl_vector.h (vector::_S_do_relocate): Remove
C++20 constexpr specifier.
(vector::_S_relocate) [__cpp_if_constexpr]: Call __relocate_a
directly without tag dispatching.
Clang doesn't define __SANITIZE_ADDRESS__ so use its __has_feature check
to detect Asan instead.
libstdc++-v3/ChangeLog:
PR libstdc++/103453
* config/allocator/malloc_allocator_base.h
(_GLIBCXX_SANITIZE_STD_ALLOCATOR): Define for Clang.
* config/allocator/new_allocator_base.h
(_GLIBCXX_SANITIZE_STD_ALLOCATOR): Likewise.
gcc/fortran/ChangeLog:
PR fortran/101565
* check.c (gfc_check_image_index): Verify that SUB argument to
IMAGE_INDEX is of type integer.
gcc/testsuite/ChangeLog:
PR fortran/101565
* gfortran.dg/coarray_49.f90: New test.
Co-authored-by: Steven G. Kargl <kargl@gcc.gnu.org>
in PR 103267 Honza found out that IPA-SRA does not look at
ECF_LOOPING_CONST_OR_PURE when evaluating if a call can have side
effects. Fixed with this patch. The testcase infinitely loops in a
const function, so it would not make a good addition to the testsuite.
gcc/ChangeLog:
2021-11-29 Martin Jambor <mjambor@suse.cz>
PR ipa/103267
* ipa-sra.c (scan_function): Also check ECF_LOOPING_CONST_OR_PURE flag.
I was too eager about removing ncopies calculations in g:10833849b55.
When emulating gather/scatter, the offset ncopies can be different from
the data ncopies. This patch restores the original calculation.
gcc/
PR tree-optimization/103494
* tree-vect-stmts.c (vect_get_gather_scatter_ops): Remove ncopies
argument and calculate ncopies from gs_info->offset_vectype
where necessary.
(vectorizable_store, vectorizable_load): Update accordingly.
gcc/testsuite/
PR tree-optimization/103494
* gcc.dg/vect/pr103494.c: New test.
* g++.dg/vect/pr103494.cc: Likewise.
PR 103449 revealed that when I was storing result of one hash_map
lookup into another entry in the hash_map, I was still accessing the
entry in the table, which meanwhile could get reallocated, making the
accesses invalid-after-free.
Fixed with the following, which also simplifies the return statement
which must have been true even now.
gcc/ChangeLog:
2021-11-29 Martin Liska <mliska@suse.cz>
Martin Jambor <mjambor@suse.cz>
PR ipa/103449
* ipa-param-manipulation.c
(ipa_param_body_adjustments::prepare_debug_expressions): Be
careful about hash_map reallocating itself. Simpify a return
which always returns true.
My previous change removed an unreachable break; there (an
unreachable continue; would have been more to the point). The
following re-adds a comment explaining that WALK_SUBEXPR_TAIL
does not fall through but tail recurses.
2021-11-30 Richard Biener <rguenther@suse.de>
gcc/fortran/
* frontend-passes.c (gfc_expr_walker): Add comment to
indicate tail recursion.
To "ignore" ranges from equivalences, we should track the range separately,
but still do the other name processing which determiens if there is a single
name or not for equivalence. Otherwise we mistakently think we can introduce
an equivalences.
gcc/
PR tree-optimization/103440
* gimple-range-fold.cc (fold_using_range::range_of_phi): Continue
normal param processing for equiv params.
gcc/testsuite/
* gcc.dg/pr103440.c: New.
bool pattern recog currently does not handle cycles correctly
and when it fails we can ICE later vectorizing PHIs with
mismatched bool and non-bool vector types. The following avoids
blindly trusting bool pattern recog here and verifies things
more thoroughly in vectorizable_phi. A bool pattern recog fix
is for GCC 13.
2021-11-30 Richard Biener <rguenther@suse.de>
PR tree-optimization/103489
* tree-vect-loop.c (vectorizable_phi): Verify argument
vector type compatibility to mitigate bool pattern recog
bug.
* gcc.dg/torture/pr103489.c: New testcase.
This patch adds [[nodiscard]] to std::byteswap, because the function
template doesn't do anything useful if the result isn't used.
2021-11-30 Jakub Jelinek <jakub@redhat.com>
* include/std/bit (byteswap): Add [[nodiscard]].
That is:
-/* Ensure that the middle end does not assign gang level parallelism
- to orphan loop containing reductions. */
+/* Verify that we diagnose "gang reduction on an orphan loop" for automatically
+ assigned gang level of parallelism. */
... to implement what the OpenACC specification actually says.
Fix-up for preceding commit 2b7dac2c0d
"Make OpenACC orphan gang reductions errors".
gcc/
* omp-offload.c (oacc_loop_auto_partitions): Remove erroneous
"Orphan reductions cannot have gang partitioning" handling.
gcc/testsuite/
* c-c++-common/goacc/nested-reductions-1-routine.c: Adjust.
* c-c++-common/goacc/nested-reductions-2-routine.c: Adjust.
* c-c++-common/goacc/orphan-reductions-2.c: Adjust.
* gfortran.dg/goacc/nested-reductions-1-routine.f90: Adjust.
* gfortran.dg/goacc/nested-reductions-2-routine.f90: Adjust.
* gfortran.dg/goacc/orphan-reductions-1.f90: Adjust.
* gfortran.dg/goacc/orphan-reductions-2.f90: Adjust.
No need to implement separately in all front ends what we may implement in the
middle end, once for all.
Follow-up to preceding commit 2b7dac2c0d
"Make OpenACC orphan gang reductions errors".
gcc/
* omp-offload.c (oacc_loop_process): Implement "gang reduction on
an orphan loop" checking.
gcc/c/
* c-typeck.c (c_finish_omp_clauses): Remove "gang reduction on an
orphan loop" checking.
gcc/cp/
* semantics.c (finish_omp_clauses): Remove "gang reduction on an
orphan loop" checking.
gcc/fortran/
* openmp.c (resolve_oacc_loop_blocks): Remove "gang reduction on
an orphan loop" checking.
(oacc_is_parallel, oacc_is_kernels, oacc_is_serial)
(oacc_is_compute_construct): Remove.
gcc/testsuite/
* gfortran.dg/goacc/orphan-reductions-1.f90: Adjust.
Follow-up to preceding commit 2b7dac2c0d
"Make OpenACC orphan gang reductions errors".
gcc/fortran/
* openmp.c (oacc_is_parallel_or_serial): Evolve into...
(oacc_is_compute_construct): ... this function.
(resolve_oacc_loop_blocks): Use "oacc_is_compute_construct"
instead of "oacc_is_parallel_or_serial" for checking that a
loop is not orphaned.
gcc/testsuite/
* gfortran.dg/goacc/orphan-reductions-3.f90: New test
verifying that the "gang reduction on an orphan loop" error message
is not emitted for non-orphaned loops.
* c-c++-common/goacc/orphan-reductions-3.c: Likewise for C and C++.
Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>
This patch promotes all OpenACC gang reductions on orphan loops as
errors. Accord to the spec, orphan loops are those which are not
lexically nested inside an OpenACC parallel or kernels regions. I.e.,
acc loops inside acc routines.
At first I thought this could be a warning because the gang reduction
finalizer uses an atomic update. However, because there is no
synchronization between gangs, there is way to guarantee that reduction
will have completed once a single gang entity returns from the acc
routine call.
gcc/c/
* c-typeck.c (c_finish_omp_clauses): Emit an error on orphan
OpenACC gang reductions.
gcc/cp/
* semantics.c (finish_omp_clauses): Emit an error on orphan
OpenACC gang reductions.
gcc/fortran/
* openmp.c (oacc_is_parallel, oacc_is_kernels): New 'static'
functions.
(resolve_oacc_loop_blocks): Emit an error on orphan OpenACC gang
reductions.
gcc/
* omp-general.h (enum oacc_loop_flags): Add OLF_REDUCTION enum.
* omp-low.c (lower_oacc_head_mark): Use it to mark OpenACC
reductions.
* omp-offload.c (oacc_loop_auto_partitions): Don't assign gang
level parallelism to orphan reductions.
gcc/testsuite/
* c-c++-common/goacc/nested-reductions-1-routine.c: Adjust.
* c-c++-common/goacc/nested-reductions-2-routine.c: Likewise.
* gcc.dg/goacc/loop-processing-1.c: Likewise.
* gfortran.dg/goacc/nested-reductions-1-routine.f90: Likewise.
* gfortran.dg/goacc/nested-reductions-2-routine.f90: Likewise.
* c-c++-common/goacc/orphan-reductions-1.c: New test.
* c-c++-common/goacc/orphan-reductions-2.c: New test.
* gfortran.dg/goacc/orphan-reductions-1.f90: New test.
* gfortran.dg/goacc/orphan-reductions-2.f90: New test.
libgomp/
* testsuite/libgomp.oacc-fortran/parallel-dims.f90: Temporarily
skip.
Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>
I missed a spot when adding the "#if __BYTE_ORDER__ == ..." guards to
the new test case for PR tree-optimization/103345. Committed as obvious.
2021-11-30 Roger Sayle <roger@nextmovesoftware.com>
gcc/testsuite/ChangeLog
PR testsuite/103477
* gcc.dg/tree-ssa/pr103345.c: Correct xor test for big-endian.
This patch extends the previous SLP gather load support so
that it can handle masked loads too.
gcc/
* tree-vect-slp.c (arg1_arg4_map): New variable.
(vect_get_operand_map): Handle IFN_MASK_GATHER_LOAD.
(vect_build_slp_tree_1): Likewise.
(vect_build_slp_tree_2): Likewise.
* tree-vect-stmts.c (vectorizable_load): Expect the mask to be
the last SLP child node rather than the first.
gcc/testsuite/
* gcc.dg/vect/vect-gather-3.c: New test.
* gcc.dg/vect/vect-gather-4.c: Likewise.
* gcc.target/aarch64/sve/mask_gather_load_8.c: Likewise.
This patch is a prerequisite for a later one. At the moment,
if-conversion converts predicated POINTER_PLUS_EXPRs into
non-wrapping forms, which for:
… = base + offset
becomes:
tmp = (unsigned long) base
… = tmp + offset
It then hoists these conversions out of the loop where possible.
However, because “base” is a valid gimple operand, there can be
multiple POINTER_PLUS_EXPRs with the same base, which can in turn
lead to multiple instances of the same conversion. The later VN pass
is (and I think needs to be) restricted to the new if-converted code,
whereas here we're deliberately inserting the conversions before the
.LOOP_VECTORIZED condition:
/* If we versioned loop then make sure to insert invariant
stmts before the .LOOP_VECTORIZED check since the vectorizer
will re-use that for things like runtime alias versioning
whose condition can end up using those invariants. */
We can therefore enter the vectoriser with redundant conversions.
The easiest fix seemed to be to defer the hoisting until after VN.
This catches other hoisting opportunities too.
Hoisting the code from the (artificial) loop in pr99102.c means
that it's no longer worth vectorising. The patch forces vectorisation
instead of relying on the cost model.
The patch also reverts pr87007-4.c and pr87007-5.c back to their
original forms, undoing changes in 783dc66f9c.
The code at the time the tests were added was:
testl %edi, %edi
je .L10
vxorps %xmm1, %xmm1, %xmm1
vsqrtsd d3(%rip), %xmm1, %xmm0
vsqrtsd d2(%rip), %xmm1, %xmm1
...
.L10:
ret
with the operations being hoisted, and the vxorps was specifically
wanted (compared to the previous code). This patch restores the code
to that form, with the hoisted operations and the vxorps.
gcc/
* tree-if-conv.c: Include tree-eh.h.
(predicate_statements): Remove pe argument. Don't hoist
statements here.
(combine_blocks): Remove pe argument.
(ifcvt_available_on_edge_p, ifcvt_can_hoist): New functions.
(ifcvt_hoist_invariants): Likewise.
(tree_if_conversion): Update call to combine_blocks. Call
ifcvt_hoist_invariants after VN.
gcc/testsuite/
* gcc.dg/vect/pr99102.c: Add -fno-vect-cost-model.
Revert:
2020-09-09 Richard Biener [rguenther@suse.de]
* gcc.target/i386/pr87007-4.c: Adjust.
* gcc.target/i386/pr87007-5.c: Likewise.
This patch adds SLP support for IFN_GATHER_LOAD. Like the SLP
support for IFN_MASK_LOAD, it works by treating only some of the
arguments as child nodes. Unlike IFN_MASK_LOAD, it requires the
other arguments (base, scale, and extension type) to be the same
for all calls in the group. It does not require/expect the loads
to be in a group (which probably wouldn't make sense for gathers).
I was worried about the possible alias effect of moving gathers
around to be part of the same SLP group. The patch therefore
makes vect_analyze_data_ref_dependence treat gathers and scatters
as a top-level concern, punting if the accesses aren't completely
independent and if the user hasn't told us that a particular
VF is safe. I think in practice we already punted in the same
circumstances; the idea is just to make it more explicit.
gcc/
PR tree-optimization/102467
* doc/sourcebuild.texi (vect_gather_load_ifn): Document.
* tree-vect-data-refs.c (vect_analyze_data_ref_dependence):
Commonize safelen handling. Punt for anything involving
gathers and scatters unless safelen says otherwise.
* tree-vect-slp.c (arg1_map): New variable.
(vect_get_operand_map): Handle IFN_GATHER_LOAD.
(vect_build_slp_tree_1): Likewise.
(vect_build_slp_tree_2): Likewise.
(compatible_calls_p): If vect_get_operand_map returns nonnull,
check that any skipped arguments are equal.
(vect_slp_analyze_node_operations_1): Tighten reduction check.
* tree-vect-stmts.c (check_load_store_for_partial_vectors): Take
an ncopies argument.
(vect_get_gather_scatter_ops): Take slp_node and ncopies arguments.
Handle SLP nodes.
(vectorizable_store, vectorizable_load): Adjust accordingly.
gcc/testsuite/
* lib/target-supports.exp
(check_effective_target_vect_gather_load_ifn): New target test.
* gcc.dg/vect/vect-gather-1.c: New test.
* gcc.dg/vect/vect-gather-2.c: Likewise.
* gcc.target/aarch64/sve/gather_load_11.c: Likewise.
This patch adds:
- gimple_num_args
- gimple_arg
- gimple_arg_ptr
for accessing rhs operands of an assignment, call or PHI. This is
similar to the existing gimple_get_lhs.
I guess there's a danger that these routines could be overused,
such as in cases where gimple_assign_rhs1 etc. would be more
appropriate. I think the routines are still worth having though.
These days, most new operations are added as internal functions rather
than tree codes, so it's useful to be able to handle assignments and
calls in a consistent way.
The patch also generalises the way that SLP child nodes map
to gimple stmt operands. This is useful for later patches.
gcc/
* gimple.h (gimple_num_args, gimple_arg, gimple_arg_ptr): New
functions.
* tree-vect-slp.c (cond_expr_maps, arg2_map): New variables.
(vect_get_operand_map): New function.
(vect_get_and_check_slp_defs): Fix outdated comment.
Use vect_get_operand_map and new gimple argument accessors.
(vect_build_slp_tree_2): Likewise.
This patch uses code_helper to represent the common (and
alternative) operations when building an SLP node. It's not
much of a saving on its own, but it helps with later patches.
gcc/
* tree-vect-slp.c (vect_build_slp_tree_1): Use code_helper
to record the operations performed by statements, only using
CALL_EXPR for things that don't map to built-in or internal
functions. For shifts, require all shift amounts to be equal
if optab_vector is not supported but optab_scalar is.
If-conversion now applies rewrite_to_defined_overflow to the
address calculation in an IFN_MASK_LOAD. This means that we
end up with:
cast_base = (uintptr_t) base;
uncast_sum = cast_base + offset;
sum = (orig_type *) uncast_sum;
If the target supports IFN_MASK_GATHER_LOAD with pointer-sized
offsets for the given vectype, we wouldn't look through the sum
cast and so would needlessly vectorise the uncast_sum addition.
This showed up as several failures in gcc.target/aarch64/sve.
gcc/
* tree-vect-data-refs.c (vect_check_gather_scatter): Continue
processing conversions if the current offset is a pointer.
The current definition of vect_is_reduction (provided for target
costing) misses some pattern statements.
gcc/
* tree-vectorizer.h (vect_is_reduction): Use STMT_VINFO_REDUC_IDX.
gcc/testsuite/
* gcc.target/aarch64/sve/cost_model_13.c: New test.
vect_check_gather_scatter had a binary “does this target support
internal gather/scatter functions” test. This dates from the time when
we only handled gathers and scatters via direct target support, with
x86_64 using built-in functions and aarch64 using IFNs. But now that we
can emulate gathers, we need to check whether the gather for a particular
mode is going to be emulated or not.
Without this, enabling SVE regresses emulated Advanced SIMD gather
sequences in cases where SVE isn't used.
Livermore kernel 15 can now be vectorised with Advanced SIMD when
SVE is enabled.
gcc/
* genopinit.c (main): Turn supports_vec_gather_load and
supports_vec_scatter_store into signed char arrays and remove
supports_vec_gather_load_cached and supports_vec_scatter_store_cached.
* optabs-query.c (supports_vec_convert_optab_p): Add a mode parameter.
If the mode is not VOIDmode, test only for that mode.
(supports_vec_gather_load_p): Likewise.
(supports_vec_scatter_store_p): Likewise.
* optabs-query.h (supports_vec_gather_load_p): Likewise.
(supports_vec_scatter_store_p): Likewise.
* tree-vect-data-refs.c (vect_check_gather_scatter): Pass the
vector mode to supports_vec_gather_load_p and
supports_vec_scatter_store_p.
gcc/testsuite/
* gfortran.dg/vect/vect-8.f90: Bump number of vectorized loops
to 25 for SVE.
* gcc.target/aarch64/sve/gather_load_10.c: New test.
This patch uses information about internal functions to canonicalize
the argument order of calls.
gcc/
* gimple-fold.c: Include internal-fn.h.
(fold_stmt_1): If a function maps to an internal one, use
first_commutative_argument to canonicalize the order of
commutative arguments.
* gimple-match-head.c (gimple_resimplify2, gimple_resimplify3)
(gimple_resimplify4, gimple_resimplify5): Extend commutativity
checks to functions.
gcc/testsuite/
* gcc.dg/fmax-fmin-1.c: New test.
This patch extends the reduction code to handle calls. So far
it's a structural change only; a later patch adds support for
specific function reductions.
Most of the patch consists of using code_helper and gimple_match_op
to describe the reduction operations. The other main change is that
vectorizable_call now needs to handle fully-predicated reductions.
There are some new functions that are provided for ABI completeness
and aren't currently used:
first_commutative_argument
commutative_ternary_op_p
1- and 3-argument forms of gimple_build
gcc/
* builtins.h (associated_internal_fn): Declare overload that
takes a (combined_cfn, return type) pair.
* builtins.c (associated_internal_fn): Split new overload out
of original fndecl version. Also provide an overload that takes
a (combined_cfn, return type) pair.
* internal-fn.h (commutative_binary_fn_p): Declare.
(commutative_ternary_fn_p): Likewise.
(associative_binary_fn_p): Likewise.
* internal-fn.c (commutative_binary_fn_p, commutative_ternary_fn_p):
New functions, split out from...
(first_commutative_argument): ...here.
(associative_binary_fn_p): New function.
* gimple-match.h (code_helper): Add a constructor that takes
internal functions.
(commutative_binary_op_p): Declare.
(commutative_ternary_op_p): Likewise.
(first_commutative_argument): Likewise.
(associative_binary_op_p): Likewise.
(canonicalize_code): Likewise.
(directly_supported_p): Likewise.
(get_conditional_internal_fn): Likewise.
(gimple_build): New overloads that takes a code_helper.
* gimple-fold.c (gimple_build): Likewise.
* gimple-match-head.c (commutative_binary_op_p): New function.
(commutative_ternary_op_p): Likewise.
(first_commutative_argument): Likewise.
(associative_binary_op_p): Likewise.
(canonicalize_code): Likewise.
(directly_supported_p): Likewise.
(get_conditional_internal_fn): Likewise.
* tree-vectorizer.h: Include gimple-match.h.
(neutral_op_for_reduction): Take a code_helper instead of a tree_code.
(needs_fold_left_reduction_p): Likewise.
(reduction_fn_for_scalar_code): Likewise.
(vect_can_vectorize_without_simd_p): Declare a nNew overload that takes
a code_helper.
* tree-vect-loop.c: Include case-cfn-macros.h.
(fold_left_reduction_fn): Take a code_helper instead of a tree_code.
(reduction_fn_for_scalar_code): Likewise.
(neutral_op_for_reduction): Likewise.
(needs_fold_left_reduction_p): Likewise.
(use_mask_by_cond_expr_p): Likewise.
(build_vect_cond_expr): Likewise.
(vect_create_partial_epilog): Likewise. Use gimple_build rather
than gimple_build_assign.
(check_reduction_path): Handle calls and operate on code_helpers
rather than tree_codes.
(vect_is_simple_reduction): Likewise.
(vect_model_reduction_cost): Likewise.
(vect_find_reusable_accumulator): Likewise.
(vect_create_epilog_for_reduction): Likewise.
(vect_transform_cycle_phi): Likewise.
(vectorizable_reduction): Likewise. Make more use of
lane_reduc_code_p.
(vect_transform_reduction): Use gimple_extract_op but expect
a tree_code for now.
(vect_can_vectorize_without_simd_p): New overload that takes
a code_helper.
* tree-vect-stmts.c (vectorizable_call): Handle reductions in
fully-masked loops.
* tree-vect-patterns.c (vect_mark_pattern_stmts): Use
gimple_extract_op when updating STMT_VINFO_REDUC_IDX.
code_helper provides conversions to tree_code and combined_fn.
Now that the codebase is C++11, we can mark these conversions as
explicit. This avoids accidentally using code_helpers with
functions that take tree_codes, which would previously entail
a hidden unchecked conversion.
gcc/
* gimple-match.h (code_helper): Provide == and != overloads.
(code_helper::operator tree_code): Make explicit.
(code_helper::operator combined_fn): Likewise.
* gimple-match-head.c (convert_conditional_op): Use explicit
conversions where necessary.
(gimple_resimplify1, gimple_resimplify2, gimple_resimplify3): Likewise.
(maybe_push_res_to_seq, gimple_simplify): Likewise.
* gimple-fold.c (replace_stmt_with_simplification): Likewise.
code_helper and gimple_match_op seem like generally useful ways
of summing up a gimple_assign or gimple_call (or gimple_cond).
This patch adds a gimple_extract_op function that can be used
for that.
gcc/
* gimple-match.h (code_helper): Add functions for querying whether
the code represents an internal_fn or a built_in_function.
Provide explicit conversion operators for both cases.
(gimple_extract_op): Declare.
* gimple-match-head.c (gimple_extract): New function, extracted from...
(gimple_simplify): ...here.
(gimple_extract_op): New function.
This fixes a thinko in the fix for the -freorder-blocks-and-partition
glitch with SEH on 64-bit Windows:
https://gcc.gnu.org/pipermail/gcc-patches/2021-February/565208.html
Even if no exceptions are active, e.g. in C, we need to consider calls.
gcc/
PR target/103274
* config/i386/i386.c (ix86_output_call_insn): Beef up comment about
nops emitted with SEH.
* config/i386/winnt.c (i386_pe_seh_unwind_emit): When switching to
the cold section, emit a nop before the directive if the previous
active instruction is a call.
Jonathan mentioned on IRC that:
"Accept P1949R7 (C++ Identifier Syntax using Unicode Standard Annex 31) as
a Defect Report and apply the changes therein to the C++ working paper."
while I've actually implemented it only for -std={gnu,c}++{23,2b}.
As the C++98 rules were significantly different, I'm not trying to change
anything for C++98.
2021-11-30 Jakub Jelinek <jakub@redhat.com>
PR c++/100977
* init.c (lang_defaults): Enable cxx23_identifiers for
-std={gnu,c}++{11,14,17,20} too.
* c-c++-common/cpp/ucnid-2011-1-utf8.c: Expect errors in C++.
* c-c++-common/cpp/ucnid-2011-1.c: Likewise.
* g++.dg/cpp/ucnid-4-utf8.C: Add missing space to dg-options.
* g++.dg/cpp23/normalize3.C: Enable for c++11 rather than just c++23.
* g++.dg/cpp23/normalize4.C: Likewise.
* g++.dg/cpp23/normalize5.C: Likewise.
* g++.dg/cpp23/normalize7.C: Expect errors rather than just warnings
for c++11 and up rather than just c++23.
* g++.dg/cpp23/ucnid-2-utf8.C: Expect errors even for c++11 .. c++20.
I've already committed the patch, but perhaps we shouldn't do it in cp_fold
where it will be folded even for warnings etc. and the locations might not
be the final yet. This patch moves it to cp_fold_r so that it is done just
once for each function and just once for each static initializer.
2021-11-30 Jakub Jelinek <jakub@redhat.com>
* cp-gimplify.c (cp_fold_r): Perform folding of
std::source_location::current() calls here...
(cp_fold): ... rather than here.
This patch addresses PR target/100711 by introducing define_split
patterns so that not/broadcast/pand may be simplified (by combine)
to broadcast/pandn. This introduces two splitters one for optimizing
pandn on TARGET_SSE for V4SI and V2DI, and another for vpandn on
TARGET_AVX2 for V16QI, V8HI, V32QI, V16HI and V8SI. Each splitter
has its own new testcase.
I've also confirmed that not/broadcast/pandn is already getting
simplified to broadcast/pand by the middle-end optimizers.
2021-11-30 Roger Sayle <roger@nextmovesoftware.com>
Uroš Bizjak <ubizjak@gmail.com>
gcc/ChangeLog
PR target/100711
* config/i386/sse.md (define_split): New splitters to simplify
not;vec_duplicate;and as vec_duplicate;andn.
gcc/testsuite/ChangeLog
PR target/100711
* gcc.target/i386/pr100711-1.c: New test case.
* gcc.target/i386/pr100711-2.c: New test case.
This fixes an appearant mistake in gfc_insert_parameter_exprs.
2021-11-29 Richard Biener <rguenther@suse.de>
gcc/fortran/
* decl.c (gfc_insert_parameter_exprs): Only return after
resetting type_param_spec_list.
This makes sure to use a VIEW_CONVERT_EXPR for converting
vector signedness in the -((int)x >> (prec - 1)) to (unsigned)x >> (prec - 1)
simplification.
2021-11-30 Richard Biener <rguenther@suse.de>
PR middle-end/103485
* match.pd (-((int)x >> (prec - 1)) to (unsigned)x >> (prec - 1)):
Use VIEW_CONVERT_EXPR for vectors.
* gcc.dg/pr103485.c: New testcase.
When vxcrtstuff.c was created, the set of #includes was copied from
crtstuff.c. But crtstuff.c also has a bunch of #undefs after the first
#include, because, as the comment says, including auto-host.h when
building objects that are meant for target is technically not
correct.
This manifests when I try do do a canadian cross, with build=linux,
host=windows and target=vxworks, in that we pick up a
#define caddr_t char *
from auto-host.h, which then of course creates a problem when we later
include a target header that has
typedef char * caddr_t;
I assume that the #undefs in crtstuff.c have been added for similar
reasons.
These potentially problematic #defines all seem to be guarded by
#ifndef USED_FOR_TARGET, which tconfig.h defines before including
auto-host.h. So at first, it seems that one could avoid the problem
by simply removing the initial include of auto-host.h. Unfortunately,
we do need some of the things defined in auto-host.h within such an
ifndef USED_FOR_TARGET, namely the define of
HAVE_INITFINI_ARRAY_SUPPORT, which is what later causes
initfini-array.h to define USE_INITFINI_ARRAY. So as the next best
fix, just copy the #undefs from crtstuff.c.
libgcc/
* config/vxcrtstuff.c: Undefine caddr_t, pid_t, rlim_t,
ssize_t and vfork after including auto-host.h.