189063 Commits

Author SHA1 Message Date
Kito Cheng
04a9b554ba RISC-V: Cost model for zba extension.
gcc/ChangeLog:

	* config/riscv/riscv.c (riscv_extend_cost): Handle cost model
	for zba extension.
	(riscv_rtx_costs): Ditto.
2021-10-25 17:06:18 +08:00
Jim Wilson
283b1707f2 RISC-V: Implement instruction patterns for ZBA extension.
2021-10-25  Jim Wilson  <jimw@sifive.com>
	    Kito Cheng  <kito.cheng@sifive.com>
	    Jia-Wei Chen  <jiawei@iscas.ac.cn>

gcc/ChangeLog:

	* config/riscv/bitmanip.md (*zero_extendsidi2_bitmanip): New.
	(*shNadd): Ditto.
	(*shNadduw): Ditto.
	(*add.uw): Ditto.
	(*slliuw): Ditto.
	(riscv_rtx_costs): Ditto.
	* config/riscv/riscv.md: Include bitmanip.md
	(type): Add bitmanip bype.
	(zero_extendsidi2): Change to define_expand pattern.
	(*zero_extendsidi2_internal): New.
	(zero_extendsidi2_shifted): Disable for ZBA.

2021-10-25  Kito Cheng  <kito.cheng@sifive.com>
	    Jia-Wei Chen  <jiawei@iscas.ac.cn>

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/zba-adduw.c: New.
	* gcc.target/riscv/zba-shNadd-01.c: Ditto.
	* gcc.target/riscv/zba-shNadd-02.c: Ditto.
	* gcc.target/riscv/zba-shNadd-03.c: Ditto.
	* gcc.target/riscv/zba-slliuw.c: Ditto.
	* gcc.target/riscv/zba-zextw.c: Ditto.

Co-authored-by: Kito Cheng <kito.cheng@sifive.com>
Co-authored-by: Jia-Wei Chen <jiawei@iscas.ac.cn>
2021-10-25 17:06:13 +08:00
Kito Cheng
149e217033 RISC-V: Minimal support of bitmanip extension
2021-10-25  Kito Cheng  <kito.cheng@sifive.com>

gcc/ChangeLog:

	* common/config/riscv/riscv-common.c (riscv_ext_version_table):
	Add zba, zbb, zbc and zbs.
	(riscv_ext_flag_table): Ditto.
	* config/riscv/riscv-opts.h (MASK_ZBA): New.
	(MASK_ZBB): Ditto.
	(MASK_ZBC): Ditto.
	(MASK_ZBS): Ditto.
	(TARGET_ZBA): Ditto.
	(TARGET_ZBB): Ditto.
	(TARGET_ZBC): Ditto.
	(TARGET_ZBS): Ditto.
	* config/riscv/riscv.opt (riscv_zb_subext): New.
2021-10-25 17:04:17 +08:00
liuhongt
1a07bc9cda Simplify (_Float16) sqrtf((float) a) to .SQRT(a) when a is a _Float16 value.
Similar for sqrt/sqrtl.

gcc/ChangeLog:

	PR target/102464
	* match.pd: Simplify (_Float16) sqrtf((float) a) to .SQRT(a)
	when direct_internal_fn_supported_p, similar for sqrt/sqrtl.

gcc/testsuite/ChangeLog:

	PR target/102464
	* gcc.target/i386/pr102464-sqrtph.c: New test.
	* gcc.target/i386/pr102464-sqrtsh.c: New test.
2021-10-25 16:53:55 +08:00
Richard Biener
aa15952d64 tree-optimization/102920 - fix PHI VN with undefined args
This fixes a latent issue exposed by now allowing VN_TOP in PHI
arguments.  We may only use optimistic equality when merging values on
different edges, not when merging values on the same edge - in particular
we may not choose the undef value on any edge when there's a not undef
value as well.

2021-10-25  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/102920
	* tree-ssa-sccvn.h (expressions_equal_p): Add argument
	controlling VN_TOP matching behavior.
	* tree-ssa-sccvn.c (expressions_equal_p): Likewise.
	(vn_phi_eq): Do not optimistically match VN_TOP.

	* gcc.dg/torture/pr102920.c: New testcase.
2021-10-25 10:28:00 +02:00
konglin1
7c20a9b738 Combine the FADD(A, FMA(B, C, 0)) to FMA(B, C, A) and combine FADD(A, FMUL(B, C)) to FMA(B, C, A).
This patch is to support transform in fast-math something like
_mm512_add_ph(x1, _mm512_fmadd_pch(a, b, _mm512_setzero_ph())) to
 _mm512_fmadd_pch(a, b, x1).

And support transform _mm512_add_ph(x1, _mm512_fmul_pch(a, b))
to _mm512_fmadd_pch(a, b, x1).

gcc/ChangeLog:

	* config/i386/sse.md (fma_<mode>_fadd_fmul): Add new
	define_insn_and_split.
	(fma_<mode>_fadd_fcmul):Likewise
	(fma_<complexopname>_<mode>_fma_zero):Likewise

gcc/testsuite/ChangeLog:

	* gcc.target/i386/avx512fp16-complex-fma.c: New test.
2021-10-25 16:01:14 +08:00
GCC Administrator
37935c0184 Daily bump. 2021-10-25 00:16:18 +00:00
John David Anglin
3f861a5c8f Revise -mdisable-fpregs option and add new -msoft-mult option
The behavior of the -mdisable-fpregs is confusing in that it doesn't
disable the use of the floating-point registers in all situations.
The -msoft-float disables the use of the floating-point registers in
all situations.  The Linux kernel only needs to disable use of the
xmpyu instruction to avoid using the floating-point registers.

This change revises the -mdisable-fpregs option to disable the use of
the floating-point registers in all situations.  It is now equivalent
to the -msoft-float option.  A new -msoft-mult option is added to
disable use of the xmpyu instruction.  The libgcc library can be
compiled with the -msoft-mult option to avoid using hardware integer
multiplication.

2021-10-24  John David Anglin  <danglin@gcc.gnu.org>

gcc/ChangeLog:

	* config/pa/pa-d.c (pa_d_handle_target_float_abi): Don't check
	TARGET_DISABLE_FPREGS.
	* config/pa/pa.c (fix_range): Use MASK_SOFT_FLOAT instead of
	MASK_DISABLE_FPREGS.
	(hppa_rtx_costs): Don't check TARGET_DISABLE_FPREGS.  Adjust
	cost of hardware integer multiplication.
	(pa_conditional_register_usage): Don't check TARGET_DISABLE_FPREGS.
	* config/pa/pa.h (INT14_OK_STRICT): Likewise.
	* config/pa/pa.md: Don't check TARGET_DISABLE_FPREGS. Check
	TARGET_SOFT_FLOAT in patterns that use xmpyu instruction.
	* config/pa/pa.opt (mdisable-fpregs): Change target mask to
	SOFT_FLOAT.  Revise comment.
	(msoft-float): New option.
2021-10-24 17:52:02 +00:00
John David Anglin
c448579312 Don't use 'G' constraint in integer move patterns
The 'G' constraint only matches a float zero.

2021-10-24  John David Anglin  <danglin@gcc.gnu.org>

gcc/ChangeLog:

	* config/pa/pa.md: Don't use 'G' constraint in integer move patterns.
2021-10-24 16:38:58 +00:00
Roger Sayle
9d1727a30e [Committed] Correct testcase gcc.target/bfin/20090914-3.c
This patch cures the testsuite failure of bfin/20090914-3.c, which
currently FAILs on bfin-elf with "(test for excess errors)" due to:
20090914-3.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int]
which is obviously not what this code was intended to test.  Fixed by
turning the code into a function returning the final "fract32" result,
as simply specifying an "int" return type for main, results in the
entire function being optimized away, as the result is unused.

2021-10-24  Roger Sayle  <roger@nextmovesoftware.com>

gcc/testsuite/ChangeLog
	* gcc.target/bfin/20090914-3.c: Tweak test case.
2021-10-24 14:30:10 +01:00
Gerald Pfeifer
dfe1ac896a doc: Remove details around Itanium on GNU/Linux and Windows
gcc:
	* doc/install.texi (Specific): Remove obsolete details
	around GNU/Linux on Itanium.
	(Specific): Remove reference to Windows for Itanium.
2021-10-24 11:22:45 +02:00
GCC Administrator
a350f56f06 Daily bump. 2021-10-24 00:16:25 +00:00
Bernhard Reutner-Fischer
710d9ad5a2 config/i386: Commentary typo fix
gcc/ChangeLog:

	* config/i386/x86-tune-sched-bd.c (dispatch_group): Commentary
	typo fix.
2021-10-23 20:51:00 +02:00
Jan Hubicka
e3725624ec cleanup compute_points_to_sets
gcc/ChangeLog:

	* tree-ssa-structalias.c (compute_points_to_sets): Cleanup.
2021-10-23 17:44:32 +02:00
H.J. Lu
d891ab1bc8 Move bind-c-intent-out-2.f90 to gfortran.dg/ubsan
Move bind-c-intent-out-2.f90 to gfortran.dg/ubsan for -fsanitize=undefined.

	PR fortran/9262
	* gfortran.dg/bind-c-intent-out-2.f90: Moved to ...
	* gfortran.dg/ubsan/bind-c-intent-out-2.f90
2021-10-23 05:40:09 -07:00
Roger Sayle
3605187516 x86_64: Add insn patterns for V1TI mode logic operations.
On x86_64, V1TI mode holds a 128-bit integer value in a (vector) SSE
register (where regular TI mode uses a pair of 64-bit general purpose
scalar registers).  This patch improves the implementation of AND, IOR,
XOR and NOT on these values.

The benefit is demonstrated by the following simple test program:

typedef unsigned __int128 v1ti __attribute__ ((__vector_size__ (16)));
v1ti and(v1ti x, v1ti y) { return x & y; }
v1ti ior(v1ti x, v1ti y) { return x | y; }
v1ti xor(v1ti x, v1ti y) { return x ^ y; }
v1ti not(v1ti x) { return ~x; }

For which GCC currently generates the rather large:

and:    movdqa  %xmm0, %xmm2
        movq    %xmm1, %rdx
        movq    %xmm0, %rax
        andq    %rdx, %rax
        movhlps %xmm2, %xmm3
        movhlps %xmm1, %xmm4
        movq    %rax, %xmm0
        movq    %xmm4, %rdx
        movq    %xmm3, %rax
        andq    %rdx, %rax
        movq    %rax, %xmm5
        punpcklqdq      %xmm5, %xmm0
        ret

ior:	movdqa  %xmm0, %xmm2
        movq    %xmm1, %rdx
        movq    %xmm0, %rax
        orq     %rdx, %rax
        movhlps %xmm2, %xmm3
        movhlps %xmm1, %xmm4
        movq    %rax, %xmm0
        movq    %xmm4, %rdx
        movq    %xmm3, %rax
        orq     %rdx, %rax
        movq    %rax, %xmm5
        punpcklqdq      %xmm5, %xmm0
        ret

xor:	movdqa  %xmm0, %xmm2
        movq    %xmm1, %rdx
        movq    %xmm0, %rax
        xorq    %rdx, %rax
        movhlps %xmm2, %xmm3
        movhlps %xmm1, %xmm4
        movq    %rax, %xmm0
        movq    %xmm4, %rdx
        movq    %xmm3, %rax
        xorq    %rdx, %rax
        movq    %rax, %xmm5
        punpcklqdq      %xmm5, %xmm0
        ret

not:	movdqa  %xmm0, %xmm1
        movq    %xmm0, %rax
        notq    %rax
        movhlps %xmm1, %xmm2
        movq    %rax, %xmm0
        movq    %xmm2, %rax
        notq    %rax
        movq    %rax, %xmm3
        punpcklqdq      %xmm3, %xmm0
        ret

with this patch we now generate the much more efficient:

and:	pand    %xmm1, %xmm0
        ret

ior:	por     %xmm1, %xmm0
        ret

xor:	pxor    %xmm1, %xmm0
        ret

not:	pcmpeqd %xmm1, %xmm1
        pxor    %xmm1, %xmm0
        ret

For my first few attempts at this patch I tried adding V1TI to the
existing VI and VI12_AVX_512F mode iterators, but these then have
dependencies on other iterators (and attributes), and so on until
everything ties itself into a knot, as V1TI mode isn't really a
first-class vector mode on x86_64.  Hence I ultimately opted to use
simple stand-alone patterns (as used by the existing TF mode support).

2021-10-23  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
	* config/i386/sse.md (<any_logic>v1ti3): New define_insn to
	implement V1TImode AND, IOR and XOR on TARGET_SSE2 (and above).
	(one_cmplv1ti2): New define expand.

gcc/testsuite/ChangeLog
	* gcc.target/i386/sse2-v1ti-logic.c: New test case.
	* gcc.target/i386/sse2-v1ti-logic-2.c: New test case.
2021-10-23 10:06:06 +01:00
Sandra Loosemore
693abdb66a Add testcase for PR fortran/95196
2021-10-22  José Rui Faustino de Sousa  <jrfsousa@gmail.com>
	    Sandra Loosemore  <sandra@codesourcery.com>

	gcc/testsuite/

	PR fortran/95196
	* gfortran.dg/PR95196.f90: New.
2021-10-22 17:25:08 -07:00
GCC Administrator
c2bd5d8a30 Daily bump. 2021-10-23 00:16:26 +00:00
Eric Gallager
c3e80a16af Add install-dvi Makefile targets.
Closes #102663

ChangeLog:

	PR other/102663
	* Makefile.def: Handle install-dvi target.
	* Makefile.tpl: Likewise.
	* Makefile.in: Regenerate.

c++tools/ChangeLog:

	PR other/102663
	* Makefile.in: Add dummy install-dvi target.

gcc/ChangeLog:

	PR other/102663
	* Makefile.in: Handle dvidir and install-dvi target.
	* configure: Regenerate.
	* configure.ac: Add install-dvi to target_list.

gcc/ada/ChangeLog:

	PR other/102663
	* gcc-interface/Make-lang.in: Allow dvi-formatted
	documentation to be installed.

gcc/c/ChangeLog:

	PR other/102663
	* Make-lang.in: Add dummy c.install-dvi target.

gcc/cp/ChangeLog:

	PR other/102663
	* Make-lang.in: Add dummy c++.install-dvi target.

gcc/d/ChangeLog:

	PR other/102663
	* Make-lang.in: Allow dvi-formatted documentation
	to be installed.

gcc/fortran/ChangeLog:

	PR other/102663
	* Make-lang.in: Allow dvi-formatted documentation
	to be installed.

gcc/lto/ChangeLog:

	PR other/102663
	* Make-lang.in: Add dummy lto.install-dvi target.

gcc/objc/ChangeLog:

	PR other/102663
	* Make-lang.in: Add dummy objc.install-dvi target.

gcc/objcp/ChangeLog:

	PR other/102663
	* Make-lang.in: Add dummy objc++.install-dvi target.

gnattools/ChangeLog:

	PR other/102663
	* Makefile.in: Add dummy install-dvi target.

libada/ChangeLog:

	PR other/102663
	* Makefile.in: Add dummy install-dvi target.

libcpp/ChangeLog:

	PR other/102663
	* Makefile.in: Add dummy install-dvi target.

libdecnumber/ChangeLog:

	PR other/102663
	* Makefile.in: Add dummy install-dvi target.

libiberty/ChangeLog:

	PR other/102663
	* Makefile.in: Allow dvi-formatted documentation
	to be installed.
2021-10-22 15:43:50 -07:00
Gerald Pfeifer
47d4899183 doc: Convert mingw-w64.org links to https
gcc:
	* doc/install.texi (Binaries): Convert mingw-w64.org to https.
	(Specific): Ditto.
2021-10-23 00:21:40 +02:00
Jonathan Wakely
0c1f737a48 libstdc++: Constrain std::make_any [PR102894]
std::make_any should be constrained so it can only be called if the
construction of the return value would be valid.

libstdc++-v3/ChangeLog:

	PR libstdc++/102894
	* include/std/any (make_any): Add SFINAE constraint.
	* testsuite/20_util/any/102894.cc: New test.
2021-10-22 23:09:54 +01:00
Tobias Burnus
030875c197 Fortran: Change XFAIL to PASS
Replace dg-excess-errors by dg-error/warning and dg-prune-output for
more fine-grained output handling and to avoid XPASS.

gcc/testsuite/ChangeLog:

	* gfortran.dg/associate_3.f03: Replace dg-excess-errors by
	other dg-* to change XFAIL to PASS.
	* gfortran.dg/binding_label_tests_4.f03: Likewise.
	* gfortran.dg/block_4.f08: Likewise.
	* gfortran.dg/charlen_04.f90: Likewise.
	* gfortran.dg/charlen_05.f90: Likewise.
	* gfortran.dg/charlen_06.f90: Likewise.
	* gfortran.dg/charlen_13.f90: Likewise.
	* gfortran.dg/coarray_9.f90: Likewise.
	* gfortran.dg/coarray_collectives_3.f90: Likewise.
	* gfortran.dg/data_invalid.f90: Likewise.
	* gfortran.dg/do_4.f: Likewise.
	* gfortran.dg/dollar_sym_1.f90: Likewise.
	* gfortran.dg/dollar_sym_3.f: Likewise.
	* gfortran.dg/fmt_tab_1.f90: Likewise.
	* gfortran.dg/fmt_tab_2.f90: Likewise.
	* gfortran.dg/forall_16.f90: Likewise.
	* gfortran.dg/g77/970125-0.f: Likewise.
	* gfortran.dg/gomp/unexpected-end.f90: Likewise.
	* gfortran.dg/interface_operator_1.f90: Likewise.
	* gfortran.dg/interface_operator_2.f90: Likewise.
	* gfortran.dg/line_length_4.f90: Likewise.
	* gfortran.dg/line_length_5.f90: Likewise.
	* gfortran.dg/line_length_6.f90: Likewise.
	* gfortran.dg/line_length_8.f90: Likewise.
	* gfortran.dg/line_length_9.f90: Likewise.
	* gfortran.dg/pr65045.f90: Likewise.
	* gfortran.dg/pr69497.f90: Likewise.
	* gfortran.dg/submodule_21.f08: Likewise.
	* gfortran.dg/tab_continuation.f: Likewise.
	* gfortran.dg/typebound_proc_2.f90: Likewise.
	* gfortran.dg/warnings_are_errors_1.f90: Likewise.
2021-10-23 00:04:43 +02:00
Tobias Burnus
24e99e6ec1 Fortran: Avoid running into assert with -fcheck= + UBSAN
PR fortran/92621
gcc/fortran/
	* trans-expr.c (gfc_trans_assignment_1): Add STRIP_NOPS.

gcc/testsuite/
	* gfortran.dg/bind-c-intent-out-2.f90: New test.
2021-10-22 23:48:57 +02:00
Stafford Horne
aa41680e48 or1k: Update FPU to specify detect tininess before rounding
This was not defined in the spec and not consistent in the
implementation causing incosistent behavior.  After review we have
updated the CPU implementations and proposed the spec be updated to
specific that FPU tininess checks check for tininess before roudning.

Architecture change draft:

	https://openrisc.io/proposals/p18-fpu-tininess

libgcc/ChangeLog:

	* config/or1k/sfp-machine.h (_FP_TININESS_AFTER_ROUNDING):
	Change to 0.
2021-10-23 05:57:16 +09:00
Martin Liska
690180eb4b Handle jobserver file descriptors in btest.
PR testsuite/102742

libbacktrace/ChangeLog:

	* btest.c (MIN_DESCRIPTOR): New.
	(MAX_DESCRIPTOR): Likewise.
	(check_available_files): Likewise.
	(check_open_files): Check only file descriptors that
	were not available at the entry.
	(main): Call check_available_files.
2021-10-22 21:11:51 +02:00
Sandra Loosemore
c31d2d14f7 Add testcase for PR fortran/94289
2021-10-22  José Rui Faustino de Sousa  <jrfsousa@gmail.com>
	    Sandra Loosemore  <sandra@codesourcery.com>

	gcc/testsuite/

	PR fortran/94289
	* gfortran.dg/PR94289.f90: New.
2021-10-22 11:13:19 -07:00
Sandra Loosemore
b7cb6d66bd Add testcase for PR fortran/100906
2021-10-21  José Rui Faustino de Sousa  <jrfsousa@gmail.com>
	    Sandra Loosemore  <sandra@codesourcery.com>

	gcc/testsuite/

	PR fortran/100906
	* gfortran.dg/PR100906.f90: New.
	* gfortran.dg/PR100906.c: New.
2021-10-22 08:28:42 -07:00
Richard Biener
c2a9a98a36 tree-optimization/102893 - properly DCE empty loops inside infinite loops
The following fixes the test for an exit edge I put in place for
the fix for PR45178 where I somehow misunderstood how the cyclic
list works.

2021-10-22  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/102893
	* tree-ssa-dce.c (find_obviously_necessary_stmts): Fix the
	test for an exit edge.

	* gcc.dg/tree-ssa/ssa-dce-9.c: New testcase.
2021-10-22 13:42:57 +02:00
Aldy Hernandez
8a0faddadd Disregard incoming equivalences to a path when defining a new one.
The equivalence oracle creates a new equiv set at each def point,
killing any incoming equivalences, however in the path sensitive
oracle we create brand new equivalences at each PHI:

   BB4:

   BB8:
      x_5 = PHI <y_8(4)>

Here we note that x_5 == y_8 at the end of the path.

The current code is intersecting this new equivalence with previously
known equivalences coming into the path.  This is incorrect, as this
is a new definition.  This patch kills any known equivalence before we
register a new one.

This hasn't caused problems so far, but upcoming changes to the
pipeline has us threading more aggressively and triggering corner
cases where this causes incorrect code.

I have tested this patch with the usual regstrap cycle.  I have also
hacked a compiler comparing the old and new behavior to see if we were
previously threading paths where the decision was made due to invalid
equivalences.  Luckily, there were no such paths, but there were 22
paths in a set of .ii files where disregarding incoming relations
allowed us to thread the path.  This is a miniscule improvement,
but we moved a handful of thredable paths earlier in the pipeline,
which is always good.

Tested on x86-64 Linux.

Co-authored-by: Andrew MacLeod <amacleod@redhat.com>

gcc/ChangeLog:

	* gimple-range-path.cc (path_range_query::compute_phi_relations):
	Kill any global relations we may know before registering a new
	one.
	* value-relation.cc (path_oracle::killing_def): New.
	* value-relation.h (path_oracle::killing_def): New.
2021-10-22 12:48:45 +02:00
Richard Biener
fe8475c500 bootstrap/102681 - properly CSE PHIs with default def args
The PR shows that we fail to CSE PHIs containing (different)
default definitions due to the fact on how we now handle
on-demand build of VN_INFO.  The following fixes this in the
same way the PHI visitation code does.

On gcc.dg/ubsan/pr81981.c this causes one expected warning to be
elided since the uninit pass sees the change

   <bb 4> [local count: 1073741824]:
   # u$0_2 = PHI <u$0_5(D)(3), i_3(D)(5)>
-  # cstore_11 = PHI <t$0_6(D)(3), i_3(D)(5)>
   v = u$0_2;
-  return cstore_11;
+  return u$0_2;

and thus only one of the conditionally uninitialized uses (the
other became dead).  I have XFAILed the missing diagnostic,
I don't see a way to preserve that.

2021-10-22  Richard Biener  <rguenther@suse.de>

	PR bootstrap/102681
	* tree-ssa-sccvn.c (vn_phi_insert): For undefined SSA args
	record VN_TOP.
	(vn_phi_lookup): Likewise.

	* gcc.dg/tree-ssa/ssa-fre-97.c: New testcase.
	* gcc.dg/ubsan/pr81981.c: XFAIL one case.
2021-10-22 11:37:35 +02:00
GCC Administrator
ae5c540662 Daily bump. 2021-10-22 00:16:31 +00:00
Jonathan Wakely
394f60e6ed libstdc++: Improve generated man pages for libstdc++
The man pages generated by Doxygen show internal header files, not the
standard headers that users actually care about. The run_doxygen script
uses the doc/doxygen/stdheader.cc program to address that, but it
doesn't work. It only tries to fix headers with underscores in the
names, which doesn't work for <bits/align.h> or <bits/fsteam.tcc>.  It
isn't prepared for the strings like "bits/stl_set\&.h" that are produced
by Doxygen. It doesn't know about many headers that have been added
since it was written. And the run_doxygen script fails to use its output
correctly to modify the man pages. Additionally, run_doxygen doesn't
know about new nested namespaces like std::filesystem and std::ranges.

This change rewrites the stdheader.cc program to do a better job of
finding the right header. The run_doxygen script now uses the just-built
compiler to build stdheader.cc and actually uses its output. And the
script now knows about other nested namespaces.

The stdheader.cc program might be unnecessary if we consistently used
@headername tags in the Doxygen comments, but we don't (and probably
never will).

A problem that remains after this change is that all the free function
defined in namespace std get dumped into a single man page for std(3),
without detailed descriptions. We don't even install that std(3) page,
but remove it before installation. That means only classes are
documented in man pages (including many internal ones that should not be
publicly documented such as _Deque_base and _Tuple_impl).

libstdc++-v3/ChangeLog:

	* doc/doxygen/stdheader.cc: Refactor. Use C++23. Add new
	headers.
	* scripts/run_doxygen: Fix post-processing of #include
	directives in man pages. Use new xg++ to compile helper program.
2021-10-21 22:24:57 +01:00
Jonathan Wakely
5a5d7c2c80 libstdc++: Add Doxygen comments to contents of <functional>
libstdc++-v3/ChangeLog:

	* include/bits/mofunc_impl.h: Add doxygen comments.
	* include/std/functional: Likewise.
2021-10-21 22:24:53 +01:00
Jonathan Wakely
6667d5feb9 libstdc++: Suppress Doxygen docs for more implementation details
libstdc++-v3/ChangeLog:

	* include/bits/alloc_traits.h: Suppress doxygen documentation.
	* include/bits/allocated_ptr.h: Likewise.
	* include/bits/enable_special_members.h: Likewise.
	* include/bits/hashtable.h: Likewise.
	* include/bits/hashtable_policy.h: Likewise.
	* include/bits/uses_allocator.h: Likewise.
	* include/bits/node_handle.h: Document node handles and suppress
	documentation for protected members.
	* include/std/any: Suppress documentation for implementation
	details.
2021-10-21 22:23:00 +01:00
Jonathan Wakely
e6d1003543 libcody: Avoid double-free
If the listen call fails then 'goto fail' will jump to that label and
use freeaddrinfo again. Set the pointer to null to prevent that.

libcody/ChangeLog:

	* netserver.cc (ListenInet6): Set pointer to null after
	deallocation.
2021-10-21 22:23:00 +01:00
H.J. Lu
1373066a46 x86: Document -fcf-protection requires i686 or newer
PR target/98667
	* doc/invoke.texi: Document -fcf-protection requires i686 or
	new.
2021-10-21 12:09:25 -07:00
Uros Bizjak
6aceeb3fb6 testsuite: Adjust pr22076.c to avoid compile-time optimization [PR102840]
2021-10-21  Uroš Bizjak  <ubizjak@gmail.com>

	PR testsuite/102840

gcc/testsuite/ChangeLog:

	* gcc.target/i386/pr22076.c: Adjust to avoid compile time optimization.
2021-10-21 20:57:38 +02:00
Patrick Palka
5f7976f65b libstdc++: missing constexpr for __[nm]iter_base [PR102358]
PR libstdc++/102358

libstdc++-v3/ChangeLog:

	* include/bits/stl_iterator.h (__niter_base): Make constexpr
	for C++20.
	(__miter_base): Likewise.
	* testsuite/25_algorithms/move/constexpr.cc: New test.
2021-10-21 12:13:35 -04:00
Eric Botcazou
9262ae450d Fix again PR middle-end/102764
gcc/
	PR middle-end/102764
	* cfgexpand.c (expand_gimple_basic_block): Robustify latest change.
2021-10-21 17:59:04 +02:00
Patrick Palka
48154969d4 libstdc++: Implement P2432R1 changes for views::istream
libstdc++-v3/ChangeLog:

	* include/std/ranges (istream_view): Replace this function
	template with an alias template as per P2432R1.
	(wistream_view): Define as per P2432R1.
	(views::_Istream, views::istream): Likewise.
	* testsuite/std/ranges/istream_view.cc (test07): New test.
2021-10-21 11:55:19 -04:00
Patrick Palka
9626e44713 libstdc++: Implement P1739R4 changes to views::take/drop/counted
This implements P1739R4 along with the resolution for LWG 3407 which
corrects the paper's wording.

libstdc++-v3/ChangeLog:

	* include/bits/ranges_util.h (views::_Drop): Forward declare.
	(subrange): Befriend views::_Drop.
	(subrange::_S_store_size): Declare constexpr instead of just
	const, remove obsolete comment.
	* include/std/ranges (views::__detail::__is_empty_view): Define.
	(views::__detail::__is_basic_string_view): Likewise.
	(views::__detail::__is_subrange): Likewise.
	(views::__detail::__is_iota_view): Likewise.
	(views::__detail::__can_take_view): Rename template parm _Tp to _Dp.
	(views::_Take): Rename template parm _Tp to _Dp, make it non-deducible
	and fix it to range_difference_t<_Range>.  Implement P1739R4 and
	LWG 3407 changes.
	(views::__detail::__can_drop_view): Rename template parm _Tp to _Dp.
	(views::_Drop): As with views::_Take.
	(views::_Counted): Implement P1739R4 changes.
	* include/std/span (__detail::__is_std_span): Rename to ...
	(__detail::__is_span): ... this and turn it into a variable
	template.
	(__detail::__is_std_array): Turn it into a variable template.
	(span::span): Adjust uses of __is_std_span and __is_std_array
	accordingly.
	* testsuite/std/ranges/adaptors/p1739.cc: New test.
2021-10-21 11:55:16 -04:00
Jonathan Wright
bdc42283bc aarch64: Remove redundant struct type definitions in arm_neon.h
These vector type definitions are an artifact from the initial commit
that added the AArch64 port.

gcc/ChangeLog:

2021-10-15  Jonathan Wright  <jonathan.wright@arm.com>

	* config/aarch64/arm_neon.h (__STRUCTN): Delete function
	macro and all invocations.
2021-10-21 16:53:50 +01:00
Hongyu Wang
2606dfea12 Adjust testcase for 128/256 bit HF vector load/store
The HF vector move have been updated to align with HI vector,
adjust according testcase for _Float16 vector load and store.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/avx512fp16-13.c: Adjust scan-assembler for
	xmm/ymm load/store.
2021-10-21 21:45:43 +08:00
Andrew MacLeod
9cb114fd55 Split --param=evrp-mode into evrp-mode and ranger-debug.
With Ranger being used in more than EVRP, the debug output should no longer
be tied up with the EVRP mode flag.

	* doc/invoke.texi (ranger-debug): Document.
	* flag-types.h (enum ranger_debug): New.
	(enum evrp_mode): Remove debug values.
	* gimple-range-cache.cc (DEBUG_RANGE_CACHE): Use new debug flag.
	* gimple-range-gori.cc (gori_compute::gori_compute): Ditto.
	* gimple-range.cc (gimple_ranger::gimple_ranger): Ditto.
	* gimple-ssa-evrp.c (hybrid_folder::choose_value): Ditto.
	(execute_early_vrp): Use evrp-mode directly.
	* params.opt (enum evrp_mode): Remove debug values.
	(ranger-debug): New.
	(ranger-logical-depth): Relocate to be in alphabetical order.
2021-10-21 09:28:23 -04:00
Andrew MacLeod
bd400db6d3 Add --param=vrp1-mode and --param=vrp2-mode.
Add 2 new params to select between VRP and RANGER to be used for each pass.

	* doc/invoke.texi: (vrp1-mode, vrp2-mode): Document.
	* flag-types.h: (enum vrp_mode): New.
	* params.opt: (vrp1-mode, vrp2-mode): New.
	* tree-vrp.c (vrp_pass_num): New.
	(pass_vrp::pass_vrp): Set pass number.
	(pass_vrp::execute): Choose which VRP mode to execute.
2021-10-21 09:28:23 -04:00
Andrew MacLeod
434ebc1e08 Move ranger only VRP folder to tree-vrp.
Consolidate the RVRP folder into a single "execute_vrp" routine that mimics
the format used by the vrp1 and vrp2 passes.  Relocate into the tree-vrp file.

	* gimple-ssa-evrp.c (class rvrp_folder): Move to tree-vrp.c.
	(execute_early_vrp): For ranger only mode, invoke ranger_vrp.
	* tree-vrp.c (class rvrp_folder): Relocate here.
	(execute_ranger_vrp): New.
	* tree-vrp.h (execute_ranger_vrp): Export.
2021-10-21 09:28:22 -04:00
Martin Liska
b470227661 options: Fix variable tracking option processing.
PR debug/102585
	PR bootstrap/102766

gcc/ChangeLog:

	* opts.c (finish_options): Process flag_var_tracking* options
	here as they can be adjusted by optimize attribute.
	Process also flag_syntax_only and flag_gtoggle.
	* toplev.c (process_options): Remove it here.
	* common.opt: Make debug_nonbind_markers_p as PerFunction
	attribute as it depends on optimization level.

gcc/testsuite/ChangeLog:

	* gcc.dg/pr102585.c: New test.
2021-10-21 15:20:09 +02:00
Martin Jambor
701ee06780
sra: Fix corner case of total scalarization with virtual inheritance (PR 102505)
PR 102505 is a situation where of SRA takes its initial top-level
access size from a get_ref_base_and_extent called on a COMPONENT_REF,
and thus derived frm the FIELD_DECL, which however does not include a
virtual base.  Total scalarization then goes on traversing the type,
which however has virtual base past the non-virtual bits, tricking SRA
to create sub-accesses outside of the supposedly encompassing
accesses, which in turn triggers the verifier within the pass.

The patch below fixes that by failing total scalarization when this
situation is detected.

gcc/ChangeLog:

2021-10-20  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/102505
	* tree-sra.c (totally_scalarize_subtree): Check that the
	encountered field fits within the acces we would like to put it
	in.

gcc/testsuite/ChangeLog:

2021-10-20  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/102505
	* g++.dg/torture/pr102505.C: New test.
2021-10-21 14:55:14 +02:00
Aldy Hernandez
d6a3c0cfb8 Revert the avoid threading circular paths commit.
I've tested this patch on the wrong tree, and picked up the test changes
in a pending patch, without which this patch is no longer obvious.
Plus, it causes a regression in an invalid test I've recommended we remove.

I'm reverting this patch until the dependencies are reviewed.

Sorry for the noise.

gcc/ChangeLog:

	* tree-ssa-threadbackward.c
	(back_threader::maybe_register_path): Remove circular paths check.
2021-10-21 13:18:49 +02:00
Richard Biener
d97fa0d44c Move the initial debug_hooks setting
I just realized that when I moved the langhook call I failed to
move the initial debug_hooks setting whose comment mentions the
langhook as reason.

2021-10-21  Richard Biener  <rguenther@suse.de>

	* toplev.c (process_options): Move the initial debug_hooks
	setting ...
	(toplev::main): ... before the call of the post_options
	langhook.
2021-10-21 12:12:49 +02:00