197531 Commits

Author SHA1 Message Date
Harald Anlauf
aed5584ff6 Fortran: a C interoperable function cannot have the CLASS attribute [PR95375]
gcc/fortran/ChangeLog:

	PR fortran/95375
	* decl.cc (verify_bind_c_sym): Extend interoperability check to
	CLASS variables.

gcc/testsuite/ChangeLog:

	PR fortran/95375
	* gfortran.dg/bind_c_procs_4.f90: New test.
2022-12-20 22:24:01 +01:00
Iain Sandoe
a6504f13a0 coroutines: Accept 'extern "C"' coroutines.
'extern "C"' coroutines are permitted by the standard and expected to work
(although constructing useful cases could be challenging). In order to
permit this we need to arrange for the outlined helper functions to be
named properly, even when no mangling is required.  To do this, we append
the actor and destroy suffixes in all cases.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

gcc/cp/ChangeLog:

	* mangle.cc (write_mangled_name): Append the helper function
	suffixes here...
	(write_encoding): ... rather than here.

gcc/testsuite/ChangeLog:

	* g++.dg/coroutines/torture/extern-c-coroutine.C: New test.
2022-12-20 19:31:47 +00:00
Patrick Palka
49b6b7ac33 c++: NTTP object wrapper substitution fixes [PR103346, ...]
This patch fixes some issues with substitution into a C++20 template
parameter object wrapper:

* The first testcase demonstrates a situation where the same_type_p
  assert in relevant case of tsubst_copy doesn't hold, because (partial)
  substitution of {int,} into the wrapper's TREE_TYPE yields A<int> but
  substitution into the underlying TEMPLATE_PARM_INDEX is a nop due to
  tsubst's level==1/tf_partial early exit tests, hence TREE_TYPE in the
  latter case remains A<T>.  So this patch just gets rid of the assert;
  the type mismatch doesn't seem to be a problem in practice.

* In the second testcase, dependent substitution into the underlying
  TEMPLATE_PARM_INDEX yields a CALL_EXPR with empty TREE_TYPE, which
  tsubst_copy doesn't expect.  This patch fixes this by handling empty
  TREE_TYPE the same way as a non-const TREE_TYPE.  Moreover, after
  this substitution we're left with a VIEW_CONVERT_EXPR wrapping a
  CALL_EXPR instead of a TEMPLATE_PARM_INDEX, which during the subsequent
  non-dependent substitution tsubst_copy doesn't expect either.  So
  this patch also relaxes tsubst_copy to accept such VIEW_CONVERT_EXPR
  too.

* In the third testcase, we end up never resolving the call to
  f.modify() because tsubst_copy doesn't do overload resolution.
  This patch fixes this by moving the handling of these
  VIEW_CONVERT_EXPR wrappers from tsubst_copy to tsubst_copy_and_build.
  For good measure tsubst_copy_and_build should also handle
  REF_PARENTHESIZED_P wrappers instead of delegating to tsubst_copy.

	PR c++/103346
	PR c++/104278
	PR c++/102553

gcc/cp/ChangeLog:

	* pt.cc (tsubst_copy) <case VIEW_CONVERT_EXPR>: Move the
	handling of C++20 template parameter object wrappers to ...
	(tsubst_copy_and_build) <case VIEW_CONVERT_EXPR>: ... here.
	Accept non-TEMPLATE_PARM_INDEX inner operand.  Handle empty
	TREE_TYPE on substituted inner operand.  Remove same_type_p
	assert.  Also handle REF_PARENTHESIZED_P VIEW_CONVERT_EXPRs.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/nontype-class52a.C: New test.
	* g++.dg/cpp2a/nontype-class53.C: New test.
	* g++.dg/cpp2a/nontype-class54.C: New test.
	* g++.dg/cpp2a/nontype-class55.C: New test.
2022-12-20 11:09:11 -05:00
Andrew MacLeod
0bdd2261c2 Don't use PHI equivalences in range-on-entry.
If there is only one argument to a PHI which is defined, an equivalency is
created between the def and the argument.  It is safe to consider the def
equal to the argument, but it is dangerous to assume the argument is also
equivalent to the def as there may be branches which change the range on the
path to the PHI on that argument

This patch avoid using that relation in range-on-entry calculations.

	PR tree-optimization/108139
	gcc/
	* gimple-range-cache.cc (ranger_cache::fill_block_cache): Do not
	use equivalences originating from PHIS.

	gcc/testsuite/
	* gcc.dg/pr108139.c: New.
2022-12-20 09:15:23 -05:00
Richard Biener
05b7cf52e1 d/104749 - document host GDC version requirement
This documents that GDC 9.4 or later is required to build the D
language rather than GDC 9.1 which suffers from PR94240.

	PR d/104749
	* doc/install.texi (GDC): Document GDC 9.4 or later is required
	to build the D language frontend.
2022-12-20 14:37:09 +01:00
Marc Poulhiès
02c031088a rust: fix link serialization [PR108113]
The Make-lang.in was missing the link serialization support.

	PR rust/108113

gcc/rust
	* Make-lang.in (rust.serial): New variable.
	(rust1$(exeext)): Depend on $(rust.prev). Call LINK_PROGRESS.

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2022-12-20 09:11:30 +01:00
Jiufu Guo
1060cd2ad0 rs6000: Optimize cmp on rotated 16bits constant
Hi,

When checking eq/ne with a constant which has only 16bits, it can be
optimized to check the rotated data.  By this, the constant building
is optimized.

As the example in PR103743:
For "in == 0x8000000000000000LL", this patch generates:
        rotldi 3,3,1 ; cmpldi 0,3,1
instead of:
        li 9,-1 ; rldicr 9,9,0,0 ; cmpd 0,3,9

Compare with previous version:
https://gcc.gnu.org/pipermail/gcc-patches/2022-August/600475.html.
This patch refactor the code according to review comments.
e.g. updating function names/comments/code.

This patch pass bootstrap and regtest on ppc64 and ppc64le.
Is it ok for trunk?  Thanks for comments!

BR,
Jeff(Jiufu)

	PR target/103743

gcc/ChangeLog:

	* config/rs6000/rs6000-protos.h (can_be_rotated_to_lowbits): New.
	(can_be_rotated_to_positive_16bits): New.
	(can_be_rotated_to_negative_15bits): New.
	* config/rs6000/rs6000.cc (can_be_rotated_to_lowbits): New definition.
	(can_be_rotated_to_positive_16bits): New definition.
	(can_be_rotated_to_negative_15bits): New definition.
	* config/rs6000/rs6000.md (*rotate_on_cmpdi): New define_insn_and_split.
	(eqne): Move earlier.

gcc/testsuite/ChangeLog:

	* gcc.target/powerpc/pr103743.c: New test.
	* gcc.target/powerpc/pr103743_1.c: New test.
2022-12-20 11:52:10 +08:00
GCC Administrator
d2ef2327bb Daily bump. 2022-12-20 00:17:00 +00:00
Jason Merrill
1e007fa5c9 build: avoid -Wconditionally-supported on qsort check
It's OK to rely on conditionally-supported features in #if CHECKING_P, since
that isn't defined in stage 1.

gcc/ChangeLog:

	* sort.cc: Disable -Wconditionally-supported in
	CHECKING_P code.
2022-12-19 15:46:35 -05:00
Patrick Palka
64f7a3b387 c++: modules and std::source_location::current() def arg [PR100881]
We currently declare __builtin_source_location with a const void* return
type instead of the actual type const std::source_location::__impl*, and
later when folding this builtin we obtain the actual type via name lookup.

But the below testcase demonstrates this approach seems to interact
poorly with modules, since we may import an entity that uses
std::source_location::current() in its default argument (or DMI) without
necessarily importing <source_location>, and thus the name lookup for
std::source_location will fail at the call site (when using the default
argument) unless we also import <source_location>.

This patch fixes this by instead initially declaring the builtin with an
auto return type and updating it appropriately upon its first use (in
standard code the first/only use would be in the definition of
std::source_location).  Thus when folding calls to this builtin we can
get at its return type through the type of the CALL_EXPR and avoid
needing to do a name lookup.

	PR c++/100881

gcc/cp/ChangeLog:

	* constexpr.cc (cxx_eval_builtin_function_call): Adjust calls
	to fold_builtin_source_location.
	* cp-gimplify.cc (cp_gimplify_expr): Likewise.
	(cp_fold): Likewise.
	(get_source_location_impl_type): Remove location_t parameter and
	adjust accordingly.  No longer static.
	(fold_builtin_source_location): Take a CALL_EXPR tree instead of a
	location and obtain the impl type from its return type.
	* cp-tree.h (enum cp_tree_index): Remove CPTI_SOURCE_LOCATION_IMPL
	enumerator.
	(source_location_impl): Remove.
	(fold_builtin_source_location): Adjust parameter type.
	(get_source_location_impl_type): Declare.
	* decl.cc (cxx_init_decl_processing): Declare
	__builtin_source_location with auto return type instead of
	const void*.
	(require_deduced_type): Update the return type of
	__builtin_source_location.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/srcloc3.C: Adjust expected note s/evaluating/using.
	* g++.dg/cpp2a/srcloc4.C: Likewise.
	* g++.dg/cpp2a/srcloc5.C: Likewise.
	* g++.dg/cpp2a/srcloc6.C: Likewise.
	* g++.dg/cpp2a/srcloc7.C: Likewise.
	* g++.dg/cpp2a/srcloc8.C: Likewise.
	* g++.dg/cpp2a/srcloc9.C: Likewise.
	* g++.dg/cpp2a/srcloc10.C: Likewise.
	* g++.dg/cpp2a/srcloc11.C: Likewise.
	* g++.dg/cpp2a/srcloc12.C: Likewise.
	* g++.dg/cpp2a/srcloc13.C: Likewise.
	* g++.dg/modules/pr100881_a.C: New test.
	* g++.dg/modules/pr100881_b.C: New test.
2022-12-19 15:35:51 -05:00
Patrick Palka
a7c8036b26 c++: ICE with concepts TS multiple auto deduction [PR101886]
In extract_autos_r, we need to recompute TYPE_CANONICAL for the template
type parameter after adjusting its index, otherwise we end up with a
comptypes ICE for the below testcase.  Note that such in-place type
adjustment isn't generally safe to do since the type could be the
TYPE_CANONICAL of another (unadjusted) type, but in this case the
canonical auto (of some level and 0 index) is the first auto (of that
level) that's created, and so any auto that we do end up adjusting can't
be the canonical one.

	PR c++/101886

gcc/cp/ChangeLog:

	* pt.cc (extract_autos_r): Recompute TYPE_CANONICAL after
	adjusting the template type parameter's index.  Simplify
	by using TEMPLATE_TYPE_IDX.  Add some sanity checks.

gcc/testsuite/ChangeLog:

	* g++.dg/concepts/auto5.C: New test.
2022-12-19 15:26:37 -05:00
Arsen Arsenović
a39f454f0f contracts: Lowercase {MAYBE,NEVER}_CONTINUE
The lowercase constants are more consistent with the standard, and it is
unlikely that the uppercase versions would've been accepted.

gcc/cp/ChangeLog:

	* contracts.cc: Rename references to
	contract_violation_continuation_mode constants to be lowercase.

libstdc++-v3/ChangeLog:

	* include/experimental/contract: Lowercase the constants in
	contract_violation_continuation_mode.
2022-12-19 15:08:08 -05:00
Jakub Jelinek
4e4620d8c7 c: Diagnose compound literals with function type [PR108043]
Both C99 and latest C2X say that compound literal shall have an object type
(complete object type in the latter case) or array of unknown bound,
so complit with function type is invalid.  When the initializer had to be
non-empty for such case, we used to diagnose it as incorrect initializer,
but with (fntype){} now allowed we just ICE on it.

The following patch diagnoses that.

2022-12-19  Jakub Jelinek  <jakub@redhat.com>

	PR c/108043
	* c-parser.cc (c_parser_postfix_expression_after_paren_type): Diagnose
	compound literals with function type.

	* gcc.dg/pr108043.c: New test.
	* gcc.dg/c99-complit-2.c (foo): Adjust expected diagnostics for
	complit with function type.
2022-12-19 20:55:56 +01:00
Marek Polacek
68e51bd0a8 c-family: Fix ICE with -Wsuggest-attribute [PR98487]
Here we crash because check_function_format was using TREE_PURPOSE
directly rather than using get_attribute_name.

	PR c/98487

gcc/c-family/ChangeLog:

	* c-format.cc (check_function_format): Use get_attribute_name.

gcc/testsuite/ChangeLog:

	* c-c++-common/Wsuggest-attribute-1.c: New test.
2022-12-19 11:16:42 -05:00
Jason Merrill
263c22a95b build: add -Wconditionally-supported to strict_warn [PR64867]
The PR (which isn't resolved by this commit) pointed out to me that GCC
should build with -Wconditionally-supported to support bootstrapping with a
C++11 compiler that makes different choices.

	PR c++/64867

gcc/ChangeLog:

	* configure.ac (strict_warn): Add -Wconditionally-supported.
	* configure: Regenerate.
2022-12-19 10:56:33 -05:00
Richard Biener
ec459469f8 tree-optimization/108164 - undefined overflow with IV vectorization
vect_update_ivs_after_vectorizer can end up emitting a signed
IV update when the loop body performed an unsigned computation.
The following makes sure to perform that update in the type
of the loop update type to avoid undefined behavior on overflow.

	PR tree-optimization/108164
	* tree-vect-loop-manip.cc (vect_update_ivs_after_vectorizer):
	Perform vect_step_op_add update in the appropriate type.

	* gcc.dg/pr108164.c: New testcase.
2022-12-19 16:36:21 +01:00
Richard Earnshaw
aa510619f8 arm: correctly define __ARM_FEATURE_CLZ
The ACLE requires that __ARM_FEATURE_CLZ be defined if the hardware
supports it; it's also clear that this doesn't mean the current ISA,
so we must define this even when compiling for Thumb1 if the target
supports CLZ in A32.

This brings GCC into alignment with Clang.

gcc/ChangeLog:

	* config/arm/arm-c.cc (__ARM_FEATURE_CLZ): Fix definition of
	preprocessor macro when target has CLZ in another ISA.
2022-12-19 15:03:30 +00:00
Ju-Zhe Zhong
8577356f4b RISC-V: Remove unit-stride store from ta attribute
Since store instructions doesn't care about tail policy, we remove
vste from "ta" attribute. Hence, we could have more fusion chances
and better optimization.

gcc/ChangeLog:

	* config/riscv/vector.md: Remove vste.
2022-12-19 22:23:32 +08:00
Ju-Zhe Zhong
6c098f7d23 RISC-V: Add testcases for VSETVL PASS 5
gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-1.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-10.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-11.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-12.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-13.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-14.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-15.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-16.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-17.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-18.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-19.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-2.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-20.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-21.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-22.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-23.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-24.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-25.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-26.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-27.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-28.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-29.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-3.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-30.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-31.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-32.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-33.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-34.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-35.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-36.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-37.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-38.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-39.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-4.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-40.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-41.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-42.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-43.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-44.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-45.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-46.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-5.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-6.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-7.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-8.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-9.c: New test.
2022-12-19 22:23:29 +08:00
Ju-Zhe Zhong
5a1b66b77c RISC-V: Add testcases for VSETVL PASS 4
gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-1.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-10.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-11.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-12.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-13.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-14.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-15.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-16.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-17.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-18.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-19.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-2.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-20.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-21.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-22.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-23.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-24.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-25.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-26.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-27.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-28.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-3.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-4.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-5.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-6.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-7.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-8.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-9.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_call-1.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_call-2.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_call-3.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_call-4.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_complex_loop-1.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_complex_loop-2.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_conflict-1.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_conflict-10.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_conflict-11.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_conflict-12.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_conflict-2.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_conflict-3.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_conflict-4.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_conflict-5.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_conflict-6.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_conflict-7.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_conflict-8.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_conflict-9.c: New test.
2022-12-19 22:23:26 +08:00
Ju-Zhe Zhong
76023293e6 RISC-V: Add testcases for VSETVL PASS 3
gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-1.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-10.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-11.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-12.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-13.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-14.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-15.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-16.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-17.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-18.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-19.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-2.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-20.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-21.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-22.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-23.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-24.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-25.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-26.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-27.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-28.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-3.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-4.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-5.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-6.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-7.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-8.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_miss_default-9.c: New test.
2022-12-19 22:23:22 +08:00
Ju-Zhe Zhong
6f18836ca0 RISC-V: Add testcases for VSETVL PASS 2
gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-1.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-10.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-11.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-12.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-13.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-14.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-15.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-16.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-17.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-18.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-19.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-2.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-20.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-21.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-22.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-23.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-24.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-25.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-26.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-27.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-28.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-3.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-4.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-5.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-6.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-7.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-8.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_phi-9.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-1.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-10.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-11.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-12.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-13.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-14.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-15.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-16.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-2.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-3.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-4.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-5.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-6.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-7.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-8.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-9.c: New test.
2022-12-19 22:23:18 +08:00
Ju-Zhe Zhong
e4433e075f RISC-V: Add testcases for VSETVL PASS
gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/rvv.exp: Adjust to enable tests for VSETVL PASS.
	* gcc.target/riscv/rvv/vsetvl/dump-1.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_block-1.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_block-10.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_block-11.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_block-12.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_block-13.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_block-14.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_block-15.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_block-16.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_block-17.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_block-18.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_block-19.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_block-2.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_block-3.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_block-4.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_block-5.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_block-6.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_block-7.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_block-8.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_block-9.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_vtype-1.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_vtype-2.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_vtype-3.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_vtype-4.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_vtype-5.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_vtype-6.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_vtype-7.c: New test.
	* gcc.target/riscv/rvv/vsetvl/vlmax_single_vtype-8.c: New test.
2022-12-19 22:23:11 +08:00
Kito Cheng
c2c29fbebb RISC-V: Simplify ASM checks in gcc.target/riscv/rvv/base/.
gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/base/mov-1.c: Simplify operand check.
	* gcc.target/riscv/rvv/base/mov-10.c: Ditto.
	* gcc.target/riscv/rvv/base/mov-11.c: Ditto.
	* gcc.target/riscv/rvv/base/mov-12.c: Ditto.
	* gcc.target/riscv/rvv/base/mov-2.c: Ditto.
	* gcc.target/riscv/rvv/base/mov-3.c: Ditto.
	* gcc.target/riscv/rvv/base/mov-4.c: Ditto.
	* gcc.target/riscv/rvv/base/mov-5.c: Ditto.
	* gcc.target/riscv/rvv/base/mov-6.c: Ditto.
	* gcc.target/riscv/rvv/base/mov-8.c: Ditto.
	* gcc.target/riscv/rvv/base/mov-9.c: Ditto.
	* gcc.target/riscv/rvv/base/vread_csr.c: Ditto.
	* gcc.target/riscv/rvv/base/vsetvl-1.c: Ditto.
	* gcc.target/riscv/rvv/base/vwrite_csr.c: Ditto.
2022-12-19 22:22:30 +08:00
Ju-Zhe Zhong
9243c3d1b6 RISC-V: Support VSETVL PASS for RVV support
This patch is to support VSETVL PASS for RVV support.
1.The optimization and performance is guaranteed LCM (Lazy code motion).
2.Base on RTL_SSA framework to gain better optimization chances.
3.Also we do VL/VTYPE, demand information backward propagation across
  blocks by RTL_SSA reverse order in CFG.
4.It has been well and fully tested by about 200+ testcases for VLMAX
  AVL situation (Only for VLMAX since we don't have an intrinsics to
  test non-VLMAX).
5.Will support AVL model in the next patch.

gcc/ChangeLog:

	* config.gcc: Add riscv-vsetvl.o.
	* config/riscv/riscv-passes.def (INSERT_PASS_BEFORE): Add VSETVL PASS
	location.
	* config/riscv/riscv-protos.h (make_pass_vsetvl): New function.
	(enum avl_type): New enum.
	(get_ta): New function.
	(get_ma): Ditto.
	(get_avl_type): Ditto.
	(calculate_ratio): Ditto.
	(enum tail_policy): New enum.
	(enum mask_policy): Ditto.
	* config/riscv/riscv-v.cc (calculate_ratio): New function.
	(emit_pred_op): change the VLMAX mov codgen.
	(get_ta): New function.
	(get_ma): Ditto.
	(enum tail_policy): Change enum.
	(get_prefer_tail_policy): New function.
	(enum mask_policy): Change enum.
	(get_prefer_mask_policy): New function.
	* config/riscv/t-riscv: Add riscv-vsetvl.o
	* config/riscv/vector.md: Adjust attribute and pattern for VSETVL
	PASS.
	(@vlmax_avl<mode>): Ditto.
	(@vsetvl<mode>_no_side_effects): Delete.
	(vsetvl_vtype_change_only): New MD pattern.
	(@vsetvl_discard_result<mode>): Ditto.
	* config/riscv/riscv-vsetvl.cc: New file.
	* config/riscv/riscv-vsetvl.h: New file.
2022-12-19 22:21:37 +08:00
Ju-Zhe Zhong
22dc669e10 RISC-V: Fix RVV machine mode attribute configuration
The attribute configuration of each machine mode are support in the previous patch.
I noticed some of them are not correct during VSETVL PASS testsing.
Correct them in the single patch now.

gcc/ChangeLog:

	* config/riscv/riscv-vector-switch.def (ENTRY): Correct attributes.
2022-12-19 22:09:35 +08:00
Jakub Jelinek
6e85f89a7d testsuite: Fix up pr64536.c for LLP64 targets [PR108151]
Apparently llp64 had 2 further warnings, fixed thusly.

2022-12-19  Jakub Jelinek  <jakub@redhat.com>

	PR testsuite/108151
	* gcc.dg/pr64536.c (bar): Cast long to __INTPTR_TYPE__
	before casting to long *.
2022-12-19 15:05:16 +01:00
Jakub Jelinek
de2b8c41b8 modula2: Don't treat % in Modula 2 messages specially
On top of the just posted patch, this patch makes sure that
any % chars in message strings aren't treated as format chars.
None of these functions take variable number of arguments, so for
most of format specifiers there is nowhere to take arguments from,
it is true that a couple of format specifiers don't take any
arguments - %%, %m, %<, %>, %' - so it is actually possible
to use them, but one needs to verify that no other are emitted and
that what should be printed as % is really emitted as %%.
If the FE does that, then please ignore this patch, otherwise I think
it is safer to do this.

2022-12-19  Jakub Jelinek  <jakub@redhat.com>

	* gm2-gcc/m2linemap.cc (m2linemap_ErrorAt, m2linemap_ErrorAtf,
	m2linemap_WarningAtf, m2linemap_NoteAtf, m2linemap_internal_error):
	Call functions with "%s", message rather than just message, so that
	% chars in message aren't treated as format specifiers.
2022-12-19 15:00:47 +01:00
Jakub Jelinek
158b18ffa5 modula2: Fix up bootstrap on powerpc64le-linux [PR108147]
As mentioned in the PR, bootstrap with m2 enabled currently fails
on powerpc64le-linux, we get weird ICE after printing some diagnostics.
The problem is that mc creates from *.def prototypes like
extern void m2linemap_WarningAtf (m2linemap_location_t location, void * message);
but the actual function definitions use
void m2linemap_WarningAtf (m2linemap_location_t location, void * message,
...) { code }
and on powerpc64le-linux such lying about the prototype results in
wrong-code, on the caller side we assume the function isn't varargs
and so don't reserve 64 bytes in the frame for it, while the callee
relies on the area being reserved and stores into it.

Fixed by adding non-stdarg wrappers around stdarg functions (because
we want va_list and pass it to diagnostics functions).

2022-12-19  Jakub Jelinek  <jakub@redhat.com>

	PR modula2/108147
	* gm2-gcc/m2linemap.def (ErrorAtf, WarningAtf, NoteAtf):
	Comment out prototypes with varargs.
	* gm2-gcc/m2linemap.h (m2linemap_ErrorAtf, m2linemap_WarningAtf,
	m2linemap_NoteAtf): No longer varargs.
	* gm2-gcc/m2linemap.cc (m2linemap_ErrorAtf): Turned into a
	non-varargs wrapper around ...
	(m2linemap_ErrorAtf_1): ... this.  New static function.
	(m2linemap_WarningAtf): Turned into a non-varargs wrapper around ...
	(m2linemap_WarningAtf_1): ... this.  New static function.
	(m2linemap_NoteAtf): Turned into a non-varargs wrapper around ...
	(m2linemap_NoteAtf_1): ... this.  New static function.
2022-12-19 15:00:08 +01:00
Martin Liska
a9f6a2b7f5 gcc-changelog: support digits in PR's component in subject
contrib/ChangeLog:

	* gcc-changelog/git_commit.py: Support digits in PR's
	component in subject.
2022-12-19 14:55:39 +01:00
Martin Liska
7e9ec734f9 gcc-changelog: allow digit in component name
contrib/ChangeLog:

	* gcc-changelog/git_commit.py: Allow digit in component name.

contrib/ChangeLog:

	* gcc-changelog/test_email.py: Add new test.
	* gcc-changelog/test_patches.txt: Add new patch.
2022-12-19 14:39:25 +01:00
Jakub Jelinek
ea37e96a37 testsuite: Fix up pr64536.c for LLP64 targets [PR108151]
The test casts a pointer to long, which is ok for ilp32 and lp64
targets but not for llp64 targets.  Nothing reads the values later,
it is a link test, so all we care about is that it is the same
cast on s390x-linux where it used to fail before the PR64536 fix,
and that we don't warn about it.

2022-12-19  Jakub Jelinek  <jakub@redhat.com>

	PR testsuite/108151
	* gcc.dg/pr64536.c (bar): Use casts to __INTPTR_TYPE__ rather than
	long when casting pointer to integral type.
2022-12-19 13:49:52 +01:00
Kyrylo Tkachov
98756bcbe2 aarch64: PR target/108140 Handle NULL target in data intrinsic expansion
In this PR we ICE when expanding the __rbit builtin with a NULL target rtx.
I *think* that only happens when the result is unused and hence maybe we shouldn't be expanding
any RTL at all, but the ICE here is easily fixed by deriving the mode from the type of the expression
rather than the target.

This patch does that.
Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/ChangeLog:

	PR target/108140
	* config/aarch64/aarch64-builtins.cc
	(aarch64_expand_builtin_data_intrinsic): Handle NULL target.

gcc/testsuite/ChangeLog:

	PR target/108140
	* gcc.target/aarch64/acle/pr108140.c: New test.
2022-12-19 11:16:47 +00:00
Tobias Burnus
2b2cec58ff gcc-changelog: Add warning for auto-added files
git_email.py prints now a warning for files added automatically.
git_check_commit.py does likewise but only with --verbose.
It prints one line per ChangeLog file, either stating the file
or if more than one the number of files.

contrib/ChangeLog:

	* gcc-changelog/git_check_commit.py (__main__): With -v print a
	warning for the auto-added files.
	* gcc-changelog/git_commit.py (GitCommit.__init__): Add self.warnings.
	(GitCommit.check_mentioned_files): Add warning for auto-added files.
	(GitCommit.print_warnings): New function.
	* gcc-changelog/git_email.py (__main__): Remove bogus argument to
	GitEmail constructor; print auto-added-files warning.
	* gcc-changelog/test_email.py (test_auto_add_file_1,
	test_auto_add_file_2): New tests.
	* gcc-changelog/test_patches.txt: Add two test cases.
2022-12-19 12:12:16 +01:00
Jakub Jelinek
03fb35f875 testsuite: Fix up pr107397.f90 test [PR107397]
The pr107397.f90 test FAILs for me, one problem was that the
added diagnostics has an indefinite article before BOZ, but
the test dg-error didn't.  The other problem was that on the
other dg-error there was no space between the string and closing
}, so it was completely ignored and the error was an excess
error.

2022-12-19  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/107397
	* gfortran.dg/pr107397.f90: Adjust expected diagnostic wording and
	add space between dg-error string and closing }.
2022-12-19 11:24:55 +01:00
Jakub Jelinek
f39b7a4d37 hwasan: Add libhwasan_preinit.o
I've noticed an inconsistency with the other sanitizers.
For -fsanitize={address,thread,leak} we link into binaries
lib*san_preinit.o such that the -lasan, -ltsan or -llsan libraries
are initialized as early as possible through .preinit_array.
The hwasan library has the same thing, but we strangely compiled
it into the library (where it apparently didn't do anything,
.preinit_array doesn't seem to be created for shared libraries),
rather than installing it like in the other 3 cases.

The following patch handles it for hwasan similarly to asan, tsan and lsan.

I don't have any hw with hwasan support, so I've just checked it
builds and installs as expected and that
gcc -fsanitize=hwaddress -o a a.c -mlam=u57
on trivial main results in .preinit_array section in the binary.

2022-12-19  Jakub Jelinek  <jakub@redhat.com>

	* config/gnu-user.h (LIBHWASAN_EARLY_SPEC): Add libhwasan_preinit.o
	to link spec if not -shared.

	* hwasan/Makefile.am (nodist_toolexeclib_HEADERS): Set to
	libhwasan_preinit.o.
	(hwasan_files): Remove hwasan_preinit.cpp.
	(libhwasan_preinit.o): Copy from hwasan_preinit.o.
	* hwasan/Makefile.in: Regenerated.
2022-12-19 11:14:55 +01:00
Ju-Zhe Zhong
61f9fe4049 RISC-V: Change vlmul printing rule
This patch is preparing patch for the following patch (VSETVL PASS)
support since the current vlmul printing rule is not appropriate
information for VSETVL PASS. I split this fix in a single patch.

gcc/ChangeLog:

	* config/riscv/riscv-v.cc (emit_vlmax_vsetvl): Pass through VLMUL enum
	instead of machine mode.
	* config/riscv/riscv-vector-builtins-bases.cc: Ditto.
	* config/riscv/riscv.cc (riscv_print_operand): Print LMUL by enum vlmul
	instead of machine mode.
2022-12-19 17:40:07 +08:00
Kito Cheng
b346e77f4d RISC-V: Fix vwrite_csr.c and vread_csr.c
gcc/testsuite:

	* gcc.target/riscv/rvv/base/vread_csr.c: Use specific option
	instead.
	* gcc.target/riscv/rvv/base/vwrite_csr.c: Ditto.
2022-12-19 17:39:33 +08:00
Jiufu Guo
97a8e88cd7 rs6000: use li;x?oris to build constant
For constant C:
If '(c & 0xFFFFFFFF00008000ULL) == 0xFFFFFFFF00008000ULL' or say:
32(1) || 16(x) || 1(1) || 15(x), using "li; xoris" would be ok.

If '(c & 0xFFFFFFFF80008000ULL) == 0x80000000ULL' or say:
32(0) || 1(1) || 15(x) || 1(0) || 15(x), we could use "li; oris" to
build constant 'C'.

Here N(M) means N continuous bit M, x for M means it is ok for either
1 or 0; '||' means concatenation.

This patch update rs6000_emit_set_long_const to support those constants.

	PR target/106708

gcc/ChangeLog:

	* config/rs6000/rs6000.cc (rs6000_emit_set_long_const): Add using
	"li; x?oris" to build constant.

gcc/testsuite/ChangeLog:

	* gcc.target/powerpc/pr106708.c: New test.
2022-12-19 17:11:36 +08:00
Martin Liska
17b41a2839 gcc-changelog: stop using --flake8
The flake8 pytest plug-in is broken and we should not use it.

contrib/ChangeLog:

	* gcc-changelog/setup.cfg: Do not use flake8 pytest plug-in.
2022-12-19 10:02:38 +01:00
liuhongt
88b531d032 x86: Don't add crtfastmath.o for -shared
Don't add crtfastmath.o for -shared to avoid changing the MXCSR register
when loading a shared library.  crtfastmath.o will be used only when
building executables.

	PR target/55522
	* config/i386/gnu-user-common.h (GNU_USER_TARGET_MATHFILE_SPEC):
	Don't add crtfastmath.o for -shared.
	* doc/invoke.texi (-shared): Add related documentation.
2022-12-19 16:47:21 +08:00
Kito Cheng
e433739862 RISC-V: Fix RVV related testsuite
Use wrapper of riscv_vector.h for RVV related testcases,
more detail see https://gcc.gnu.org/pipermail/gcc-patches/2022-October/603140.html

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/base/mov-1.c: Use double quotes to
	include riscv_vector.h rather than angle brackets.
	* gcc.target/riscv/rvv/base/mov-10.c: Ditto.
	* gcc.target/riscv/rvv/base/mov-11.c: Ditto.
	* gcc.target/riscv/rvv/base/mov-12.c: Ditto.
	* gcc.target/riscv/rvv/base/mov-13.c: Ditto.
	* gcc.target/riscv/rvv/base/mov-2.c: Ditto.
	* gcc.target/riscv/rvv/base/mov-3.c: Ditto.
	* gcc.target/riscv/rvv/base/mov-4.c: Ditto.
	* gcc.target/riscv/rvv/base/mov-5.c: Ditto.
	* gcc.target/riscv/rvv/base/mov-6.c: Ditto.
	* gcc.target/riscv/rvv/base/mov-7.c: Ditto.
	* gcc.target/riscv/rvv/base/mov-8.c: Ditto.
	* gcc.target/riscv/rvv/base/mov-9.c: Ditto.
	* gcc.target/riscv/rvv/base/vread_csr.c: Ditto.
	* gcc.target/riscv/rvv/base/vsetvl-1.c: Ditto.
	* gcc.target/riscv/rvv/base/vwrite_csr.c: Ditto.
2022-12-19 15:57:48 +08:00
GCC Administrator
e2e154fe5b Daily bump. 2022-12-19 00:16:53 +00:00
Rainer Orth
fd69977feb build: doc: Obsolete Solaris 11.3 support
This patch implements the Solaris 11.[0-3] obsoletion just announced in

	https://gcc.gnu.org/pipermail/gcc/2022-December/240322.html

Bootstrapped without regressions on Solaris 11.3 (i386-pc-solaris2.11,
sparc-sun-solaris2.11 without and with --enable-obsolete) and 11.4.

2022-12-09  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	gcc:
	* config.gcc: Determine Solaris minor version.
	Obsolete *-*-solaris2.11.[0-3]*.
	* doc/install.texi (Specific, *-*-solaris2*): Document it.
2022-12-18 20:39:14 +01:00
Gaius Mulley
0b2428ee83 PR-108122 Reduce sleep times in gm2/pimcoroutines/run/pass/testtime.mod
Change time unit to 1 jiffy (with respect to TimerHandler.def) rather
than a second.

gcc/testsuite/ChangeLog:

	* gm2/pimcoroutines/run/pass/testtime.mod: Reduce sleep times in
	the test by a factor of 25.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-18 10:04:02 +00:00
Steve Kargl
09710f9934 Add a check for invalid use of BOZ with a derived type.
PR fortran/107397

gcc/fortran/ChangeLog:

	* decl.cc (add_init_expr_to_sym): Add check with new error message.

gcc/testsuite/ChangeLog:

	* gfortran.dg/pr107397.f90: New test.
2022-12-17 19:36:59 -08:00
GCC Administrator
92bc361757 Daily bump. 2022-12-18 00:16:57 +00:00
Segher Boessenkool
f80f540e39 rs6000: Add Rust support to traceback table
Use 0 for the "lang" identifier for Rust, just like we do for all other
source languages without assigned language code (0 means "C").

Tested on powerpc64-linux.  Without this patch there are ICEs galore in
the gm2 testsuite for 64-bit Linux targets, and with the ptch there are
just a few FAILs.

2022-12-17  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/rs6000-logue.cc (rs6000_output_function_epilogue):
	Handle GNU Rust for the tbtab lang field.
2022-12-17 20:56:13 +00:00
Patrick Palka
982629bea4 c++: constantness of non-dependent NTTP argument [PR107437]
Here we're rejecting the use of the lambda capture of 't' (of empty
type) as a template argument ultimately because convert_nontype_argument
checks constantness using is_constant_expression, which returns false
for lambda captures since want_rval=false.  But in this case I believe
an lvalue-to-rvalue conversion of the argument is implied, so we should
be using is_rvalue_constant_expression instead (which would return true
here).

However, it doesn't seem necessary to consider constantness at all
when deciding whether to instantiate a non-dependent argument in
convert_nontype_argument.  So this patch gets rid of the problematic
constantness test altogether, which incidentally also fixes the similar
dg-ice'd testcase from PR87765.  This is in line with a similar
change we made to finish_decltype_type in r12-7564-gec0f53a3a542e7.

	PR c++/107437
	PR c++/87765

gcc/cp/ChangeLog:

	* pt.cc (convert_nontype_argument): Relax is_nondep_const_expr
	test to !inst_dep_expr_p.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp1y/lambda-generic-107437.C: New test.
	* g++.dg/cpp1z/constexpr-lambda26.C: Remove dg-ice.
2022-12-17 11:24:44 -05:00
Ian Lance Taylor
b1f91819e3 libbacktrace: unpack literals into output buffer
* elf.c (elf_fetch_backward_init): New static function.
	(ZSTD_TABLE_SIZE): Use huffman scratch space size rather than
	literal size.
	(ZSTD_TABLE_WORK_LIT_SIZE): Don't define.
	(elf_zstd_read_huff): Use elf_fetch_backward_init.
	(elf_zstd_read_literals): New static function.
	(ZSTD_LIT_RAW, ZSTD_LIT_RLE, ZSTD_LIT_HUFF): Don't define.
	(struct elf_zstd_literals): Don't define.
	(elf_zstd_literal_output): Remove static function.
	(elf_zstd_decompress): Use elf_fetch_backward_init and
	elf_zstd_read_literals.  Rewrite literal copying.<
2022-12-16 18:48:04 -08:00