Commit graph

209779 commits

Author SHA1 Message Date
Jakub Jelinek
94792057ad Fix up duplicated words mostly in comments, part 1
Like in r12-7519-g027e30414492d50feb2854aff38227b14300dc4b, I've done
git grep -v 'long long\|optab optab\|template template\|double double' | grep ' \([a-zA-Z]\+\) \1 '

This is just part of the changes, mostly for non-gcc directories.
I'll try to get to the rest soon.  Obviously, the above command also
finds cases which are correct as is and shouldn't be changed, so one
needs to manually inspect everything.

I'd hope most of it is pretty obvious, but the config/ and libstdc++-v3/
hunks include a tweak in a license wording, though other copies of the
similar license have the wording right.

2024-04-02  Jakub Jelinek  <jakub@redhat.com>

	* Makefile.tpl: Fix duplicated words; returns returns ->
	returns.
config/
	* lcmessage.m4: Fix duplicated words; can can -> can,
	package package -> package.
libdecnumber/
	* decCommon.c (decFinalize): Fix duplicated words in
	comment; the the -> the.
libgcc/
	* unwind-dw2-fde.c (struct fde_accumulator): Fix duplicated
	words in comment; is is -> is.
libgfortran/
	* configure.host: Fix duplicated words; the the -> the.
libgm2/
	* configure.host: Fix duplicated words; the the -> the.
libgomp/
	* libgomp.texi (OpenMP 5.2): Fix duplicated words; with with ->
	with.
	(omp_target_associate_ptr): Fix duplicated words; either either ->
	either.
	(omp_init_allocator): Fix duplicated words; be be -> be.
	(omp_realloc): Fix duplicated words; is is -> is.
	(OMP_ALLOCATOR): Fix duplicated words; other other -> other.
	* priority_queue.h (priority_queue_multi_p): Fix duplicated words;
	to to -> to.
libiberty/
	* regex.c (byte_re_match_2_internal): Fix duplicated words in comment;
	next next -> next.
	* dyn-string.c (dyn_string_init): Fix duplicated words in comment;
	of of -> of.
libitm/
	* beginend.cc (GTM::gtm_thread::begin_transaction): Fix duplicated
	words in comment; not not -> not to.
libobjc/
	* init.c (duplicate_classes): Fix duplicated words in comment; in in
	-> in.
	* sendmsg.c (__objc_prepare_dtable_for_class): Fix duplicated words
	in comment; the the -> the.
	* encoding.c (objc_layout_structure): Likewise.
libstdc++-v3/
	* acinclude.m4: Fix duplicated words; file file -> file can.
	* configure.host: Fix duplicated words; the the -> the.
libvtv/
	* vtv_rts.cc (vtv_fail): Fix duplicated words; to to -> to.
	* vtv_fail.cc (vtv_fail): Likewise.
2024-04-02 13:39:11 +02:00
Iain Sandoe
b120e355e5 jit, Darwin: Implement library exports list.
Currently, we have no exports list for libgccjit, which means that
all symbols are exported, including those from libstdc++ which is
linked statically into the lib.  This causes failures when the
shared libstdc++ is used but some c++ symbols are satisfied from
libgccjit.

This implements an export file for Darwin (which is currently
manually created by cross-checking libgccjit.map).  Ideally we'd
script this, at some point.  Update libtool current and age to
reflect the current ABI version (we are not bumping the SO name
at this stage).

This fixes a number of new failures in jit testing.

gcc/jit/ChangeLog:

	* Make-lang.in: Implement exports list, and use a shared
	libgcc.
	* libgccjit.exports: New file.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
2024-04-02 12:33:56 +01:00
Iain Sandoe
799a056cf8 testsuite: Remove duplicate -lgcov [PR114034]
Duplicate library entries now cause linker warnings with newer linker
versions on Darwin which leads to these tests regressing.  The library
is already added by the test flags so there is no need to put an extra
one in the options.

	PR testsuite/114034

gcc/testsuite/ChangeLog:

	* g++.dg/gcov/gcov-dump-1.C: Remove extra -lgcov.
	* g++.dg/gcov/gcov-dump-2.C: Likewise.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
2024-04-02 12:30:17 +01:00
Iain Sandoe
ad8e34eaa8 testsuite, Darwin: Allow for an undefined symbol [PR114036].
Darwin's linker defaults to requiring all symbols to be defined at
static link time (unless specifically noted or dynamic lookuo is
enabled).

For this test, we just need to note that the symbol is expected to
be undefined.

	PR testsuite/114036

gcc/testsuite/ChangeLog:

	* gcc.misc-tests/gcov-14.c: Allow for 'Foo' to be undefined
	on Darwin link lines.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
2024-04-02 12:26:47 +01:00
Iain Sandoe
451bb0b926 Darwin: Correct a version check.
When the version for dsymutil comes from a clang build, it is
of the form NNmm.pp.qq where NN and mm are the major and minor
LLVM version components.  We need to check for a major version
greater than or equal to 7 - so use 700 in the check.

gcc/ChangeLog:

	* config/darwin.cc (darwin_override_options): Update the
	clang major version value in the dsymutil check.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
2024-04-02 12:24:31 +01:00
Iain Sandoe
3c499f8f6f Darwin: Do not emit .macinfo when dsymutil cannot consume it.
Some verions of dsymutil do not ignore .macinfo sections, but instead
ignore the entire debug in the file.

To avoid this total loss of debug, when we detect that the debug level
is g3 and the dsymutil version cannot support it, we reduce the level
to g2 and issue a note.

This behaviour can be overidden by -gstrict-dwarf (although the objects
will contain macinfo; dsymutil will not produce a .dSYM with it).

gcc/ChangeLog:

	* config/darwin.cc (darwin_override_options): Reduce the debug
	level to 2 if dsymutil cannot handle .macinfo sections.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
2024-04-02 12:18:39 +01:00
Iain Sandoe
c85c2e26b8 testsuite, Darwin: Update bad-mapper-1 after libiberty changes.
A recent change to libiberty has improved the process spawning on
older Darwin platforms.  This patch updates the expected test output
after the changes.

gcc/testsuite/ChangeLog:

	* g++.dg/modules/bad-mapper-1.C: Update expected test output
	for earlier Darwin.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
2024-04-02 12:09:44 +01:00
Yang Yujie
078f4a958c LoongArch: Fix missing plugin header
gcc/ChangeLog:

	* config/loongarch/t-loongarch: Add loongarch-def-arrays.h
	to OPTION_H_EXTRA.
2024-04-02 15:44:40 +08:00
mengqinggang
b253b4695d LoongArch: Add support for TLS descriptors.
Add support for TLS descriptors on normal code model and extreme
code model.

Normal code model instruction sequence:
  -mno-explicit-relocs:
    la.tls.desc	$r4, s
    add.d	$r12, $r4, $r2
  -mexplicit-relocs:
    pcalau12i	$r4,%desc_pc_hi20(s)
    addi.d	$r4,$r4,%desc_pc_lo12(s)
    ld.d	$r1,$r4,%desc_ld(s)
    jirl	$r1,$r1,%desc_call(s)
    add.d	$r12, $r4, $r2

Extreme code model instruction sequence:
  -mno-explicit-relocs:
    la.tls.desc	$r4, $r12, s
    add.d	$r12, $r4, $r2
  -mexplicit-relocs:
    pcalau12i	$r4,%desc_pc_hi20(s)
    addi.d	$r12,$r0,%desc_pc_lo12(s)
    lu32i.d	$r12,%desc64_pc_lo20(s)
    lu52i.d	$r12,$r12,%desc64_pc_hi12(s)
    add.d	$r4,$r4,$r12
    ld.d	$r1,$r4,%desc_ld(s)
    jirl	$r1,$r1,%desc_call(s)
    add.d	$r12, $r4, $r2

The default is still traditional TLS model, but can be configured with
--with-tls={trad,desc}. The default can change to TLS descriptors once
libc and LLVM support this.

gcc/ChangeLog:

	* config.gcc: Add --with-tls option to change TLS flavor.
	* config/loongarch/genopts/loongarch.opt.in: Add -mtls-dialect to
	configure TLS flavor.
	* config/loongarch/loongarch-def.h (struct loongarch_target): Add
	tls_dialect.
	* config/loongarch/loongarch-driver.cc (la_driver_init): Add tls
	flavor.
	* config/loongarch/loongarch-opts.cc (loongarch_init_target): Add
	tls_dialect.
	(loongarch_config_target): Ditto.
	(loongarch_update_gcc_opt_status): Ditto.
	* config/loongarch/loongarch-opts.h (loongarch_init_target): Ditto.
	(TARGET_TLS_DESC): New define.
	* config/loongarch/loongarch.cc (loongarch_symbol_insns): Add TLS
	DESC instructions sequence length.
	(loongarch_legitimize_tls_address): New TLS DESC instruction sequence.
	(loongarch_option_override_internal): Add la_opt_tls_dialect.
	(loongarch_option_restore): Add la_target.tls_dialect.
	* config/loongarch/loongarch.md (@got_load_tls_desc<mode>): Normal
	code model for TLS DESC.
	(got_load_tls_desc_off64): Extreme cmode model for TLS DESC.
	* config/loongarch/loongarch.opt: Regenerate.
	* config/loongarch/loongarch.opt.urls: Ditto.
	* doc/invoke.texi: Add a description of the compilation option
	'-mtls-dialect={trad,desc}'.

gcc/testsuite/ChangeLog:

	* gcc.target/loongarch/cmodel-extreme-1.c: Add -mtls-dialect=trad.
	* gcc.target/loongarch/cmodel-extreme-2.c: Ditto.
	* gcc.target/loongarch/explicit-relocs-auto-tls-ld-gd.c: Ditto.
	* gcc.target/loongarch/explicit-relocs-medium-call36-auto-tls-ld-gd.c:
	Ditto.
	* gcc.target/loongarch/func-call-medium-1.c: Ditto.
	* gcc.target/loongarch/func-call-medium-2.c: Ditto.
	* gcc.target/loongarch/func-call-medium-3.c: Ditto.
	* gcc.target/loongarch/func-call-medium-4.c: Ditto.
	* gcc.target/loongarch/tls-extreme-macro.c: Ditto.
	* gcc.target/loongarch/tls-gd-noplt.c: Ditto.
	* gcc.target/loongarch/explicit-relocs-auto-extreme-tls-desc.c: New test.
	* gcc.target/loongarch/explicit-relocs-auto-tls-desc.c: New test.
	* gcc.target/loongarch/explicit-relocs-extreme-tls-desc.c: New test.
	* gcc.target/loongarch/explicit-relocs-tls-desc.c: New test.

Co-authored-by: Lulu Cheng <chenglulu@loongson.cn>
Co-authored-by: Xi Ruoyao <xry111@xry111.site>
2024-04-02 13:59:12 +08:00
Lulu Cheng
6f9ba3ea55 LoongArch: Regenerate loongarch.opt.urls.
Fixes: d28ea8e5a7 ("LoongArch: Split loongarch_option_override_internal
		      into smaller procedures")

gcc/ChangeLog:

	* config/loongarch/loongarch.opt.urls: Regenerate.
2024-04-02 09:21:29 +08:00
GCC Administrator
0454eec362 Daily bump. 2024-04-02 00:17:27 +00:00
Gaius Mulley
4bd2f59af4 PR modula2/114548 gm2 fails to identify variable in a const expression
This patch introduces stricter checking within standard procedure
functions which detect whether paramaters are variable when used
in a const expression.

gcc/m2/ChangeLog:

	PR modula2/114548
	* gm2-compiler/M2Quads.mod (ConvertToAddress): Pass
	procedure, false parameters to BuildConvertFunction.
	(PushOne): Pass procedure, true parameters to
	BuildConvertFunction.
	Remove usused parameter internal.
	(BuildPseudoBy): Remove parameter to PushOne.
	(BuildIncProcedure): Ditto.
	(BuildDecProcedure): Ditto.
	(BuildFunctionCall): Add ConstExpr parameter to
	BuildPseudoFunctionCall.
	(BuildConstFunctionCall): Add procedure and true to
	BuildConvertFunction.
	(BuildPseudoFunctionCall): Add ConstExpr parameter.
	Pass ProcSym and ConstExpr to BuildLengthFunction,
	BuildConvertFunction, BuildOddFunction, BuildAbsFunction,
	BuildCapFunction, BuildValFunction, BuildChrFunction,
	BuildOrdFunction, BuildIntFunction, BuildTruncFunction,
	BuildFloatFunction, BuildAddAdrFunction, BuildSubAdrFunction,
	BuildDifAdrFunction, BuildCastFunction, BuildReFunction,
	BuildImFunction and BuildCmplxFunction.
	(BuildAddAdrFunction): Add ProcSym, ConstExpr parameters and
	check for constant parameters.
	(BuildSubAdrFunction): Ditto.
	(BuildDifAdrFunction): Ditto.
	(ConstExprError): Ditto.
	(BuildLengthFunction): Ditto.
	(BuildOddFunction): Ditto.
	(BuildAbsFunction): Ditto.
	(BuildCapFunction): Ditto.
	(BuildChrFunction): Ditto.
	(BuildOrdFunction): Ditto.
	(BuildIntFunction): Ditto.
	(BuildValFunction): Ditto.
	(BuildCastFunction): Ditto.
	(BuildConvertFunction): Ditto.
	(BuildTruncFunction): Ditto.
	(BuildFloatFunction): Ditto.
	(BuildReFunction): Ditto.
	(BuildImFunction): Ditto.
	(BuildCmplxFunction): Ditto.

gcc/testsuite/ChangeLog:

	PR modula2/114548
	* gm2/iso/const/fail/expression.mod: New test.
	* gm2/iso/const/fail/iso-const-fail.exp: New test.
	* gm2/iso/const/fail/testabs.mod: New test.
	* gm2/iso/const/fail/testaddadr.mod: New test.
	* gm2/iso/const/fail/testcap.mod: New test.
	* gm2/iso/const/fail/testcap2.mod: New test.
	* gm2/iso/const/fail/testchr.mod: New test.
	* gm2/iso/const/fail/testchr2.mod: New test.
	* gm2/iso/const/fail/testcmplx.mod: New test.
	* gm2/iso/const/fail/testfloat.mod: New test.
	* gm2/iso/const/fail/testim.mod: New test.
	* gm2/iso/const/fail/testint.mod: New test.
	* gm2/iso/const/fail/testlength.mod: New test.
	* gm2/iso/const/fail/testodd.mod: New test.
	* gm2/iso/const/fail/testord.mod: New test.
	* gm2/iso/const/fail/testre.mod: New test.
	* gm2/iso/const/fail/testtrunc.mod: New test.
	* gm2/iso/const/fail/testval.mod: New test.
	* gm2/iso/const/pass/constbool.mod: New test.
	* gm2/iso/const/pass/constbool2.mod: New test.
	* gm2/iso/const/pass/constbool3.mod: New test.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2024-04-01 19:18:36 +01:00
Jason Merrill
bba118db3f c++: C++26 returning reference to temporary
P2748R5 makes it ill-formed to return a reference to temporary in C++26;
implementing this is a simple matter of changing the existing warning to a
permerror.

For most of the tests I just changed dg-warning to dg-message to accept
both; I test the specific diagnostic type in Wreturn-local-addr-5.C.

gcc/cp/ChangeLog:

	* typeck.cc (maybe_warn_about_returning_address_of_local):
	Permerror in C++26.

gcc/testsuite/ChangeLog:

	* g++.dg/conversion/pr16333.C: Change dg-warning to dg-message.
	* g++.dg/cpp0x/constexpr-48324.C
	* g++.dg/other/pr94326.C
	* g++.dg/warn/Wreturn-local-addr-2.C
	* g++.old-deja/g++.jason/warning8.C: Likewise.
	* g++.dg/cpp1y/auto-fn6.C: Check that others don't complain.
	* g++.dg/warn/Wreturn-local-addr-5.C: Expect error in C++26.
2024-04-01 12:02:50 -04:00
Yang Yujie
d28ea8e5a7 LoongArch: Split loongarch_option_override_internal into smaller procedures
gcc/ChangeLog:

	* config/loongarch/genopts/loongarch.opt.in: Mark -m[no-]recip as
	aliases to -mrecip={all,none}, respectively.
	* config/loongarch/loongarch.opt: Regenerate.
	* config/loongarch/loongarch-def.h (ABI_FPU_64): Rename to...
	(ABI_FPU64_P): ...this.
	(ABI_FPU_32): Rename to...
	(ABI_FPU32_P): ...this.
	(ABI_FPU_NONE): Rename to...
	(ABI_NOFPU_P): ...this.
	(ABI_LP64_P): Define.
	* config/loongarch/loongarch.cc (loongarch_init_print_operand_punct):
	Merged into loongarch_global_init.
	(loongarch_cpu_option_override): Renamed to
	loongarch_target_option_override.
	(loongarch_option_override_internal): Move the work after
	loongarch_config_target into loongarch_target_option_override.
	(loongarch_global_init): Define.
	(INIT_TARGET_FLAG): Move to loongarch-opts.cc.
	(loongarch_option_override): Call loongarch_global_init
	separately.
	* config/loongarch/loongarch-opts.cc (loongarch_parse_mrecip_scheme):
	Split the parsing of -mrecip=<string> from
	loongarch_option_override_internal.
	(loongarch_generate_mrecip_scheme): Define. Split from
	loongarch_option_override_internal.
	(loongarch_target_option_override): Define. Renamed from
	loongarch_cpu_option_override.
	(loongarch_init_misc_options): Define. Split from
	loongarch_option_override_internal.
	(INIT_TARGET_FLAG): Move from loongarch.cc.
	* config/loongarch/loongarch-opts.h (loongarch_target_option_override):
	New prototype.
	(loongarch_parse_mrecip_scheme): New prototype.
	(loongarch_init_misc_options): New prototype.
	(TARGET_ABI_LP64): Simplify with ABI_LP64_P.
	* config/loongarch/loongarch.h (TARGET_RECIP_DIV): Simplify.
	Do not reference specific CPU architecture (LA664).
	(TARGET_RECIP_SQRT): Same.
	(TARGET_RECIP_RSQRT): Same.
	(TARGET_RECIP_VEC_DIV): Same.
	(TARGET_RECIP_VEC_SQRT): Same.
	(TARGET_RECIP_VEC_RSQRT): Same.
2024-04-01 09:06:46 +08:00
Lulu Cheng
7f424c3167 LoongArch: Add descriptions of the compilation options.
Add descriptions for the compilation options '-mfrecipe' '-mdiv32'
'-mlam-bh' '-mlamcas' and '-mld-seq-sa'.

gcc/ChangeLog:

	* doc/invoke.texi: Add descriptions for the compilation
	options.
2024-04-01 09:03:32 +08:00
GCC Administrator
1831a5e13b Daily bump. 2024-04-01 00:16:45 +00:00
Christophe Lyon
14d0c863aa modula2: Fix m2.install-info in gcc/m2/Make-lang.in
Fix a few typos: the generated filename is m2.info (not gm2.info, and
gm2$(exeext) is a file not a directory (so test -d would always fail).

2024-03-29  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/m2/
	* Make-lang.in (m2.install-info): Fix rule.
2024-03-31 16:54:33 +00:00
Christophe Lyon
ec2c15f14f modula2: Add m2.install-html rule to gcc/m2/Make-lang.in
This rule was missing, and 'make install-html' was failing.
It is copied from the corresponding one in fortran.

2024-03-29  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/m2/
	* Make-lang.in (install-html): New rule.
2024-03-31 16:54:33 +00:00
Jeff Law
08eaafadd5 [committed] RISC-V: Add missing insn types to XiangShan Nanhu scheduler model
The test for the recently added XiangShan Nanhu microarchitecture is failing
because the scheduler description does not have entries for certain insn types.

I'm adding  branch, jalr, ret and sfb_alu to the scheduler description, that's
enough to get the trivial test to pass.  However, I strongly suspect running
any significant code through the compiler when scheduling for this
microarchitecture will trigger faults.

Basically we have checking now that will fault if we have an insn in the IL
without an associated type or if we have an insn in the IL that does not map to
an insn reservation in the scheduler model.  We were tripping the latter
assertion for one of those branch types.  My suspicion is many insn types
aren't handled by that DFA.

The branch insns were pretty obvious and easy to fix.  But someone with more
experience with the uarch needs to do an audit to ensure that all insn types
map to an insn reservation.

gcc/
	* config/riscv/xiangshan.md (xiangshan_jump): Add branch, jalr, ret
	and sfb_alu.
2024-03-31 10:51:17 -06:00
Pan Li
b313baba57 RISC-V: Fix misspelled term builtin in error message
This patch would like to fix below misspelled term in error message.

../../gcc/config/riscv/riscv-vector-builtins.cc:4592:16: error:
misspelled term 'builtin function' in format; use 'built-in function' instead [-Werror=format-diag]
 4592 |               "builtin function %qE requires the V ISA extension", exp);

The below tests are passed for this patch.
* The riscv regression test on rvv.exp and riscv.exp.

gcc/ChangeLog:

	* config/riscv/riscv-vector-builtins.cc (expand_builtin): Take
	the term built-in over builtin.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-7.c:
	Adjust test dg-error.
	* gcc.target/riscv/rvv/base/target_attribute_v_with_intrinsic-8.c:
	Ditto.

Signed-off-by: Pan Li <pan2.li@intel.com>
2024-03-31 18:37:50 +08:00
Pan Li
46eb34a75a RISC-V: Fix one unused varable in riscv_subset_list::parse
This patch would like to fix one unused variable as below:

../../gcc/common/config/riscv/riscv-common.cc: In static member function
'static riscv_subset_list* riscv_subset_list::parse(const char*, location_t)':
../../gcc/common/config/riscv/riscv-common.cc:1501:19: error: unused variable 'itr'
  [-Werror=unused-variable]
 1501 |   riscv_subset_t *itr;

The variable consume code was removed but missed the var itself in
previous.  Thus, we have unused variable here.

gcc/ChangeLog:

	* common/config/riscv/riscv-common.cc (riscv_subset_list::parse):
	Remove unused var decl.

Signed-off-by: Pan Li <pan2.li@intel.com>
2024-03-31 18:36:58 +08:00
GCC Administrator
86d83ff4e4 Daily bump. 2024-03-31 00:16:32 +00:00
Xi Ruoyao
6fc84f680d
mips: Fix C23 (...) functions returning large aggregates [PR114175]
We were assuming TYPE_NO_NAMED_ARGS_STDARG_P don't have any named
arguments and there is nothing to advance, but that is not the case
for (...) functions returning by hidden reference which have one such
artificial argument.  This is causing gcc.dg/c23-stdarg-{6,8,9}.c to
fail.

Fix the issue by checking if arg.type is NULL, as r14-9503 explains.

gcc/ChangeLog:

	PR target/114175
	* config/mips/mips.cc (mips_setup_incoming_varargs): Only skip
	mips_function_arg_advance for TYPE_NO_NAMED_ARGS_STDARG_P
	functions if arg.type is NULL.
2024-03-30 10:14:02 +08:00
GCC Administrator
4921bd8cf2 Daily bump. 2024-03-30 00:16:42 +00:00
Guillaume Gomez
4c18ace1cb [PATCH] Allow gcc_jit_type_get_size to work with pointers
gcc/jit/ChangeLog:

	* libgccjit.cc (gcc_jit_type_get_size): Add pointer support
2024-03-29 19:05:48 +01:00
Christophe Lyon
28dca4be50 Fix lrcpc3 testcase
There was a typo in the testcase, with GCC_CPUINFO pointing to the
wrong file.

2024-03-29  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/testsuite/
	* gcc.target/aarch64/cpunative/native_cpu_24.c: Fix GCC_CPUINFO.
2024-03-29 14:29:43 +00:00
Arsen Arsenović
f15cea16cc
libstdc++-v3: drop GCC Runtime Library Exception from gen tests
It was mistakenly added to these files.

libstdc++-v3/ChangeLog:

	* testsuite/24_iterators/range_generators/01.cc: Drop GCC
	Runtime Library Exception.
	* testsuite/24_iterators/range_generators/02.cc: Drop GCC
	Runtime Library Exception.
	* testsuite/24_iterators/range_generators/copy.cc: Drop GCC
	Runtime Library Exception.
	* testsuite/24_iterators/range_generators/except.cc: Drop GCC
	Runtime Library Exception.
	* testsuite/24_iterators/range_generators/subrange.cc: Drop GCC
	Runtime Library Exception.
	* testsuite/24_iterators/range_generators/synopsis.cc: Drop GCC
	Runtime Library Exception.
	* testsuite/24_iterators/range_generators/iter_deref_return.cc:
	Drop GCC Runtime Library Exception from the "You should have
	received a copy" paragraph.
2024-03-29 12:50:06 +01:00
Thomas Schwinge
e162228e0b GCN: Enable effective-target 'vect_long_mult'
... as made apparent by commit bfd6b36f08
"testsuite/vect: Fix pr25413a.c expectations [PR109705]" causing:

     PASS: gcc.dg/vect/pr25413a.c (test for excess errors)
     PASS: gcc.dg/vect/pr25413a.c execution test
    -PASS: gcc.dg/vect/pr25413a.c scan-tree-dump-times vect "vectorized 2 loops" 1
    +FAIL: gcc.dg/vect/pr25413a.c scan-tree-dump-times vect "vectorized 1 loops" 1

..., which this commit resolves.

	gcc/testsuite/
	* lib/target-supports.exp (check_effective_target_vect_long_mult):
	Enable for GCN.
2024-03-29 11:16:59 +01:00
Thomas Schwinge
7cc68c4863 GCN: Enable effective-target 'vect_hw_misalign'
... as made apparent by commit 4e1fcf44bd
"testsuite: vect: Require vect_hw_misalign in gcc.dg/vect/vect-cost-model-1.c etc. [PR98238]"
causing:

     PASS: gcc.dg/vect/vect-cost-model-1.c (test for excess errors)
    -PASS: gcc.dg/vect/vect-cost-model-1.c scan-tree-dump vect "LOOP VECTORIZED"

     PASS: gcc.dg/vect/vect-cost-model-3.c (test for excess errors)
    -PASS: gcc.dg/vect/vect-cost-model-3.c scan-tree-dump vect "LOOP VECTORIZED"

     PASS: gcc.dg/vect/vect-cost-model-5.c (test for excess errors)
    -PASS: gcc.dg/vect/vect-cost-model-5.c scan-tree-dump vect "LOOP VECTORIZED"

..., and similarly commit ffd47fb63d
"testsuite: Fix pr113431.c FAIL on sparc* [PR113431]" causing:

     PASS: gcc.dg/vect/pr113431.c (test for excess errors)
     PASS: gcc.dg/vect/pr113431.c execution test
    -PASS: gcc.dg/vect/pr113431.c scan-tree-dump-times slp1 "optimized: basic block part vectorized" 2

..., which this commit all restores, and also enables a good number of further
FAIL -> PASS, UNSUPPORTED -> PASS, etc. progressions.  There are also a small
number of regressions, mostly in the SLP area apparently:

     PASS: gcc.dg/vect/bb-slp-layout-12.c (test for excess errors)
    +XPASS: gcc.dg/vect/bb-slp-layout-12.c scan-tree-dump-not slp1 "duplicating permutation node"
    +XFAIL: gcc.dg/vect/bb-slp-layout-12.c scan-tree-dump-times slp1 "add new stmt: [^\\n\\r]* = VEC_PERM_EXPR" 3

     PASS: gcc.dg/vect/bb-slp-layout-6.c (test for excess errors)
    +FAIL: gcc.dg/vect/bb-slp-layout-6.c scan-tree-dump slp2 "absorbing input layouts"

     PASS: gcc.dg/vect/pr97428.c (test for excess errors)
     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving load of size 8"
     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving store of size 16"
     PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not vect "gap of 6 elements"
    -XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect "vectorizing stmts using SLP" 2
    +FAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect "vectorizing stmts using SLP" 2

     PASS: gcc.dg/vect/vect-33.c (test for excess errors)
    +FAIL: gcc.dg/vect/vect-33.c scan-tree-dump vect "Vectorizing an unaligned access"
     PASS: gcc.dg/vect/vect-33.c scan-tree-dump-not optimized "Invalid sum"
     PASS: gcc.dg/vect/vect-33.c scan-tree-dump-times vect "vectorized 1 loops" 1

..., so some further conditionalizing etc. seems necessary.  These seem to
mostly appear next to pre-existing similar FAILs in related test cases.
(Overall, way more PASS than FAIL.)

	gcc/testsuite/
	* lib/target-supports.exp
	(check_effective_target_vect_hw_misalign): Enable for GCN.
	(check_effective_target_vect_element_align): Adjust.
2024-03-29 11:16:59 +01:00
Thomas Schwinge
ec8e3dbdc3 GCN: Enable effective-target 'vect_early_break', 'vect_early_break_hw'
Via XPASSing test cases after commit a657c7e351
"testsuite: un-xfail TSVC loops that check for exit control flow vectorization":

    PASS: gcc.dg/vect/tsvc/vect-tsvc-s332.c (test for excess errors)
    PASS: gcc.dg/vect/tsvc/vect-tsvc-s332.c execution test
    [-XFAIL:-]{+XPASS:+} gcc.dg/vect/tsvc/vect-tsvc-s332.c scan-tree-dump vect "vectorized 1 loops"

    PASS: gcc.dg/vect/tsvc/vect-tsvc-s481.c (test for excess errors)
    PASS: gcc.dg/vect/tsvc/vect-tsvc-s481.c execution test
    [-XFAIL:-]{+XPASS:+} gcc.dg/vect/tsvc/vect-tsvc-s481.c scan-tree-dump vect "vectorized 1 loops"

    PASS: gcc.dg/vect/tsvc/vect-tsvc-s482.c (test for excess errors)
    PASS: gcc.dg/vect/tsvc/vect-tsvc-s482.c execution test
    [-XFAIL:-]{+XPASS:+} gcc.dg/vect/tsvc/vect-tsvc-s482.c scan-tree-dump vect "vectorized 1 loops"

..., it became apparent that GCN, too, does support vectorization of loops with
early breaks.  The relevant test cases are all-PASS with just the following
exceptions, to be looked into individually, later on:

    PASS: gcc.dg/vect/vect-early-break_25.c (test for excess errors)
    PASS: gcc.dg/vect/vect-early-break_25.c scan-tree-dump-times vect "vectorized 1 loops" 1
    FAIL: gcc.dg/vect/vect-early-break_25.c scan-tree-dump-times vect "Alignment of access forced using peeling" 1

    PASS: gcc.dg/vect/vect-early-break_56.c (test for excess errors)
    PASS: gcc.dg/vect/vect-early-break_56.c execution test
    XPASS: gcc.dg/vect/vect-early-break_56.c scan-tree-dump-times vect "vectorized 2 loops" 2

	gcc/testsuite/
	* lib/target-supports.exp
	(check_effective_target_vect_early_break)
	(check_effective_target_vect_early_break_hw): Enable for GCN.
2024-03-29 11:16:59 +01:00
Harald Anlauf
6fb253a25d Fortran: fix NULL pointer dereference on overlapping initialization [PR50410]
gcc/fortran/ChangeLog:

	PR fortran/50410
	* trans-expr.cc (gfc_conv_structure): Check for NULL pointer.

gcc/testsuite/ChangeLog:

	PR fortran/50410
	* gfortran.dg/data_initialized_4.f90: New test.
2024-03-29 10:31:38 +01:00
Paul Thomas
3c793f0361 Fortran: Fix a gimplifier ICE/wrong result with finalization [PR36337]
2024-03-29  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
	PR fortran/36337
	PR fortran/110987
	PR fortran/113885
	* trans-expr.cc (gfc_trans_assignment_1): Place finalization
	block before rhs post block for elemental rhs.
	* trans.cc (gfc_finalize_tree_expr): Check directly if a type
	has no components, rather than the zero components attribute.
	Treat elemental zero component expressions in the same way as
	scalars.

gcc/testsuite/
	PR fortran/113885
	* gfortran.dg/finalize_54.f90: New test.
	* gfortran.dg/finalize_55.f90: New test.

gcc/testsuite/
	PR fortran/110987
	* gfortran.dg/finalize_56.f90: New test.
2024-03-29 07:23:19 +00:00
Andrew Pinski
22f48d78f0 Use fatal_error instead of internal_error for when ZSTD is not enabled
This changes an internal error to be a fatal error for when the ZSTD
is not enabled but the section was compressed as ZSTD.

Committed as approved after bootstrap/test on x86_64-linux-gnu.

gcc/ChangeLog:

	* lto-compress.cc (lto_end_uncompression): Use
	fatal_error instead of internal_error when ZSTD
	is not enabled.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
2024-03-28 21:06:43 -07:00
Xi Ruoyao
26a723625b
testsuite: Add a test case for negating FP vectors containing zeros
Recently I've fixed two wrong FP vector negate implementation which
caused wrong sign bits in zeros in targets (r14-8786 and r14-8801).  To
prevent a similar issue from happening again, add a test case.

Tested on x86_64 (with SSE2, AVX, AVX2, and AVX512F), AArch64, MIPS
(with MSA), LoongArch (with LSX and LASX).

gcc/testsuite:

	* gcc.dg/vect/vect-neg-zero.c: New test.
2024-03-29 09:02:39 +08:00
GCC Administrator
63e6ec5333 Daily bump. 2024-03-29 00:17:27 +00:00
Jeff Law
c1e66532cb [committed] Provide suitable output template for zero_extendqihi2 on H8
Segher's recent combine change, quite unexpectedly, triggered a regression on
the H8 port.  It failed to build newlib.

The zero_extendqihi2 pattern provided two alternatives.  One where the source
and destination matched.  That turns into a suitable instruction trivially.
The second alternative was actually meant to capture cases where the value is
coming from memory.

What was missing here was the reg->reg case where the source and destination do
not match.  That fell into the second case which was requested to be split by
the pattern's output template.

The splitter had a suitable condition to make sure it only triggered in the
right cases.  Unfortunately with the pattern requiring a split in a case where
the splitter was going to fail led to the fault.

So regardless of what's going on in the combiner, this code was just wrong.
Fixed thusly by providing a suitable output template for the reg->reg case.

Regression tested on h8300-elf.  Pushing to the trunk.

gcc/

	* config/h8300/extensions.md (zero_extendqihi*): Add output
	template for reg->reg case where the regs don't match.
2024-03-28 16:56:53 -06:00
John David Anglin
86b0b1bec6 Fix failure of c-c++-common/analyzer/stdarg-pr111289-int.c on hpux
2024-03-28  John David Anglin  <danglin@gcc.gnu.org>

gcc/testsuite/ChangeLog:

	PR analyzer/111289
	* c-c++-common/analyzer/stdarg-pr111289-int.c: Don't include
	<limits.h>.
2024-03-28 18:32:12 +00:00
Jason Merrill
8bb3ef3f6e c++: __is_constructible ref binding [PR100667]
The requirement that a type argument be complete is excessive in the case of
direct reference binding to the same type, which does not rely on any
properties of the type.  This is LWG 2939.

	PR c++/100667

gcc/cp/ChangeLog:

	* semantics.cc (same_type_ref_bind_p): New.
	(finish_trait_expr): Use it.

gcc/testsuite/ChangeLog:

	* g++.dg/ext/is_constructible8.C: New test.
2024-03-28 14:18:35 -04:00
Harald Anlauf
bbb7c513dd Fortran: fix DATA and derived types with pointer components [PR114474]
When matching actual arguments in match_actual_arg, these are initially
treated as a possible dummy procedure, assuming that the correct type is
determined later.  This resolution could fail when the procedure is a
derived type constructor with a pointer component and appears in a DATA
statement, where the pointer shall be associated with an initial data
target.  Check for those cases where the type obviously has not been
resolved yet, and which were missed because there was no component
reference.

gcc/fortran/ChangeLog:

	PR fortran/114474
	* primary.cc (gfc_variable_attr): Catch variables used in structure
	constructors within DATA statements that are still tagged with a
	temporary type BT_PROCEDURE from match_actual_arg and which have the
	target attribute, and fix their typespec.

gcc/testsuite/ChangeLog:

	PR fortran/114474
	* gfortran.dg/data_pointer_3.f90: New test.
2024-03-28 18:43:47 +01:00
Vineet Gupta
c1424628dc RISC-V: testsuite: ensure vtype is call clobbered
Per classic Vector calling convention ABI, vtype is call clobbered,
so ensure gcc regenerates a VSETVLI in following cases:
 - after a function call.
 - after an inline asm fragment which clobbers vtype.

ATM gcc seems to be doing the right thing, but a test can never hurt.

gcc/testsuite/ChangeLog:
	* gcc.target/riscv/rvv/vtype-call-clobbered.c: New Test.

Signed-off-by: Vineet Gupta <vineetg@rivosinc.com>
2024-03-28 10:25:39 -07:00
Gaius Mulley
aeee63ffbf PR modula2/114520 Incorrect ordering of import/export statements cause confusion
The error recovery causes misleading error messages to appear if an
EXPORT and IMPORT statement are in the wrong order.  This patch
detects the incorrect order and issues an error message and prevents
error recovery.  The fix should be improved and made more general if
another similar case is required.

gcc/m2/ChangeLog:

	PR modula2/114520
	* gm2-compiler/P0SyntaxCheck.bnf (DetectImport): New
	procedure.
	(EnableImportCheck): New boolean.
	(Expect): Call DetectImport.
	(Export): Set EnableImportCheck TRUE before ';' and FALSE
	afterwards.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2024-03-28 16:49:44 +00:00
Gaius Mulley
04799f03e8 PR modula2/114517 gm2 does not allow comparison operator hash in column one
This patch allows -fno-cpp to be supplied to gm2.  Without this patch
it causes an ICE.  The patch allows -fno-cpp to turn off cpp flags.
These are tested in m2.flex to decide whether a change of state is
allowed (enabling handling of #line directives).

gcc/ChangeLog:

	PR modula2/114517
	* doc/gm2.texi: Mention gm2 treats a # in the first column
	as a preprocessor directive unless -fno-cpp is supplied.

gcc/m2/ChangeLog:

	PR modula2/114517
	* gm2-compiler/M2Options.def (SetCpp): Add comment.
	(GetCpp): Move after SetCpp.
	(GetLineDirectives): New procedure function.
	* gm2-compiler/M2Options.mod (GetLineDirectives): New
	procedure function.
	* gm2-gcc/m2options.h (M2Options_GetLineDirectives): New
	prototype.
	* gm2-lang.cc (gm2_langhook_init_options): OPT_fcpp only
	assert if !value.
	* m2.flex: Test GetLineDirectives before changing to LINE0
	state.

gcc/testsuite/ChangeLog:

	PR modula2/114517
	* gm2/cpp/fail/hashfirstcolumn2.mod: New test.
	* gm2/imports/fail/imports-fail.exp: New test.
	* gm2/imports/fail/localmodule2.mod: New test.
	* gm2/imports/run/pass/localmodule.mod: New test.

Signed-off-by: Gaius Mulley <(no_default)>
2024-03-28 14:57:49 +00:00
Jakub Jelinek
44ab31419c predict: Fix comment typo
I've noticed a typo in a comment.

2024-03-28  Jakub Jelinek  <jakub@redhat.com>

	* predict.cc (estimate_bb_frequencies): Fix comment typo,
	scalling -> scaling.
2024-03-28 15:12:08 +01:00
Jakub Jelinek
d5a3b4afcd profile-count: Avoid overflows into uninitialized [PR112303]
The testcase in the patch ICEs with
--- gcc/tree-scalar-evolution.cc
+++ gcc/tree-scalar-evolution.cc
@@ -3881,7 +3881,7 @@ final_value_replacement_loop (class loop *loop)

       /* Propagate constants immediately, but leave an unused initialization
         around to avoid invalidating the SCEV cache.  */
-      if (CONSTANT_CLASS_P (def) && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rslt))
+      if (0 && CONSTANT_CLASS_P (def) && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rslt))
        replace_uses_by (rslt, def);

       /* Create the replacement statements.  */
(the addition of the above made the ICE latent), because profile_count
addition doesn't check for overflows and if unlucky, we can even overflow
into the uninitialized value.
Getting really huge profile counts is very easy even when not using
recursive inlining in loops, e.g.
__attribute__((noipa)) void
bar (void)
{
  __builtin_exit (0);
}

__attribute__((noipa)) void
foo (void)
{
  for (int i = 0; i < 1000; ++i)
  for (int j = 0; j < 1000; ++j)
  for (int k = 0; k < 1000; ++k)
  for (int l = 0; l < 1000; ++l)
  for (int m = 0; m < 1000; ++m)
  for (int n = 0; n < 1000; ++n)
  for (int o = 0; o < 1000; ++o)
  for (int p = 0; p < 1000; ++p)
  for (int q = 0; q < 1000; ++q)
  for (int r = 0; r < 1000; ++r)
  for (int s = 0; s < 1000; ++s)
  for (int t = 0; t < 1000; ++t)
  for (int u = 0; u < 1000; ++u)
  for (int v = 0; v < 1000; ++v)
  for (int w = 0; w < 1000; ++w)
  for (int x = 0; x < 1000; ++x)
  for (int y = 0; y < 1000; ++y)
  for (int z = 0; z < 1000; ++z)
  for (int a = 0; a < 1000; ++a)
  for (int b = 0; b < 1000; ++b)
    bar ();
}

int
main ()
{
  foo ();
}
reaches the maximum count already on the 11th loop.

Some other methods of profile_count like apply_scale already
do use MIN (val, max_count) before assignment to m_val, this patch
just extends that to operator{+,+=} methods.
Furthermore, one overload of apply_probability wasn't using
safe_scale_64bit and so could very easily overflow as well
- prob is required to be [0, 10000] and if m_val is near the max_count,
it can overflow even with multiplications by 8.

2024-03-28  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/112303
	* profile-count.h (profile_count::operator+): Perform
	addition in uint64_t variable and set m_val to MIN of that
	val and max_count.
	(profile_count::operator+=): Likewise.
	(profile_count::operator-=): Formatting fix.
	(profile_count::apply_probability): Use safe_scale_64bit
	even in the int overload.

	* gcc.c-torture/compile/pr112303.c: New test.
2024-03-28 15:00:44 +01:00
Maxim Kuvyrkov
b8e7aaaf35 [testsuite] Fixup dg-options in {gcc,g++,gfortran}.dg/vect.exp tests
Testsuites driven by vect.exp rely on check_vect_support_and_set_flags
to set appropriate DEFAULT_VECTFLAGS for a given target (e.g., add
-mfpu=neon for arm-linux-gnueabi).  Unfortunately, these flags are
overwritten by dg-options directive, which can cause tests to fail.

Behavior of dg-options is documented in vect.exp files, but not
all developers look at the .exp file when adding a new testcase.
This caused a few dg-options directives to be used instead of
the more appropriate dg-additional-options.

This patch changes target-independent dg-options into
dg-additional-options.  This patch does not touch target-specific
dg-options and target-specific tests to avoid disturbing the gentle
balance of target-specific vectorization.

This patch also removes a couple of unneeded "dg-do run" directives
to avoid failures on compile-only targets.  Default action is, again,
set by check_vect_support_and_set_flags.

Lastly, I avoided renaming tests that use -O<n> options to O<n>-*
filename format because this support is not consistent between
gcc.dg/vect/, g++.dg/vect/, and gfortran.dg/vect/ testsuites.
It seems dg-additional-options is cleaner.

This patch does the following,
1. do not change target-specific tests, e.g., gcc.dg/vect/costmodel/riscv/*;
2. do not change { dg-options FOO { target { target-*-pattern } } };
3. do not remove { dg-do run { target { target-*-pattern } } };
4. change { dg-options FOO } to { dg-additional-options FOO };
5. remove { dg-do run } in several tests, where it is clearly not needed.

gcc/testsuite/ChangeLog:

	PR testsuite/114307
	* gcc.dg/vect/vect-cond-reduc-in-order-2-signed-zero.c: Remove dg-run.
	* gcc.dg/vect/complex/complex-operations-run.c: Likewise.
	* gcc.dg/vect/pr113576.c: Remove dg-run.  Use dg-additional-options for
	test-specific flags.
	* gcc.dg/vect/gimplefe-40.c: Use dg-additional-options for
	test-specific flags.
	* gcc.dg/vect/gimplefe-41.c: Likewise.
	* gcc.dg/vect/pr101145inf.c: Likewise.
	* gcc.dg/vect/pr101145inf_1.c: Likewise.
	* gcc.dg/vect/pr108316.c: Likewise.
	* gcc.dg/vect/pr109011-1.c: Likewise.
	* gcc.dg/vect/pr109011-2.c: Likewise.
	* gcc.dg/vect/pr109011-3.c: Likewise.
	* gcc.dg/vect/pr109011-4.c: Likewise.
	* gcc.dg/vect/pr109011-5.c: Likewise.
	* gcc.dg/vect/pr111846.c: Likewise.
	* gcc.dg/vect/pr111860-2.c: Likewise.
	* gcc.dg/vect/pr111860-3.c: Likewise.
	* gcc.dg/vect/pr113002.c: Likewise.
	* gcc.dg/vect/pr84711.c: Likewise.
	* gcc.dg/vect/pr85597.c: Likewise.
	* gcc.dg/vect/pr88497-1.c: Likewise.
	* gcc.dg/vect/pr88497-2.c: Likewise.
	* gcc.dg/vect/pr88497-3.c: Likewise.
	* gcc.dg/vect/pr88497-4.c: Likewise.
	* gcc.dg/vect/pr88497-5.c: Likewise.
	* gcc.dg/vect/pr88497-7.c: Likewise.
	* gcc.dg/vect/pr92347.c: Likewise.
	* gcc.dg/vect/pr93069.c: Likewise.
	* gcc.dg/vect/pr97241.c: Likewise.
	* gcc.dg/vect/pr99102.c: Likewise.
	* gcc.dg/vect/vect-early-break_65.c: Likewise.
	* gcc.dg/vect/vect-fold-1.c: Likewise.
	* gcc.dg/vect/vect-ifcvt-19.c: Likewise.
	* gcc.dg/vect/vect-ifcvt-20.c: Likewise.
	* gcc.dg/vect/vect-reduc-epilogue-gaps.c: Likewise.
	* gcc.dg/vect/vect-singleton_1.c: Likewise.
	* g++.dg/vect/pr84556.cc: Likewise.
	* gfortran.dg/vect/fast-math-mgrid-resid.f: Likewise.
	* gfortran.dg/vect/pr77848.f: Likewise.
	* gfortran.dg/vect/pr90913.f90: Likewise.
2024-03-28 13:38:59 +00:00
Jan Hubicka
0923fe2d48 Hash operands of PHI in ipa-icf
This patch fixes cache colision on function whose body differs only by constants
at PHI operands.  As for

if (test)
  a = cst1;
else
  a = cst2;

gcc/ChangeLog:

	PR middle-end/113907
	* ipa-icf.cc (sem_function::init): Hash PHI operands
	(sem_function::compare_phi_node): Add argument about preserving order
2024-03-28 13:24:54 +01:00
Jakub Jelinek
7942558f27 testsuite: Add testcase for already fixed PR [PR109925]
This testcase was made latent by r14-4089 and got fixed both
on the trunk and 13 branch with PR113372 fix.

Adding testcase to the testsuite and will close the PR as a dup.

2024-03-28  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/109925
	* gcc.c-torture/execute/pr109925.c: New test.
2024-03-28 11:58:26 +01:00
Mikael Morin
7f233feafd fortran: Fix specification expression check in submodules [PR114475]
The patch fixing PR111781 made the check of specification expressions more
restrictive, disallowing local variables in specification expressions of
dummy arguments.  PR114475 showed an example where that change regressed,
disallowing in submodules expressions that had been allowed in the parent
module.  In submodules indeed, the hierarchy of namespaces inherited from
the parent module is not reproduced so the host-association of symbols
can't be recognized by checking the nesting of namespaces.

This change fixes the problem by allowing in specification expressions
all the symbols in a submodule that are inherited from the parent module.

	PR fortran/111781
	PR fortran/114475

gcc/fortran/ChangeLog:

	* expr.cc (check_restricted): In submodules, allow variables host-
	associated from the parent module.

gcc/testsuite/ChangeLog:

	* gfortran.dg/spec_expr_10.f90: New test.

Co-authored-by: Harald Anlauf <anlauf@gmx.de>
2024-03-28 09:57:06 +01:00
Gaius Mulley
7907ff2bcb modula2: Rebuild documentation sections for target independent libs
This patch rebuilds the documentation for the target independent
library sections.

gcc/m2/ChangeLog:

	* target-independent/m2/Builtins.texi: Rebuilt.
	* target-independent/m2/gm2-libs.texi: Rebuilt.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2024-03-28 08:31:06 +00:00
Richard Biener
0bad303944 middle-end/114480 - IDF compute is slow
The testcase in this PR shows very slow IDF compute:

  tree SSA rewrite                   :  76.99 ( 31%)
  24.78%        243663  cc1plus  cc1plus             [.] compute_idf

which can be mitigated to some extent by refactoring the bitmap
operations to simpler variants.  With the patch below this becomes

  tree SSA rewrite                   :  15.23 (  8%)

when not optimizing and in addition to that

  tree SSA incremental               : 181.52 ( 30%)

to

  tree SSA incremental               :  24.09 (  6%)

when optimizing.

	PR middle-end/114480
	* cfganal.cc (compute_idf): Use simpler bitmap iteration,
	touch work_set only when phi_insertion_points changed.
2024-03-28 09:16:34 +01:00