]> gcc.gnu.org Git - gcc.git/log
gcc.git
3 years agoreorg.c (fill_slots_from_thread): Reinstate code typoed out in "Remove CC0".
Hans-Peter Nilsson [Fri, 14 May 2021 23:26:17 +0000 (01:26 +0200)]
reorg.c (fill_slots_from_thread): Reinstate code typoed out in "Remove CC0".

The typo here, is obviously mistaken removal of lines next
to a line that was validly removed.  Targets affected are
those with a delay-slot *and* defining TARGET_FLAGS_REGNUM.
In-tree, a git-grep says the only ones matching are CRIS,
h8300 and visium.  The code removal has the effect of
wrong-code, not reverting the effect of r11-2814.

I'm "guessing" it was the effect of an incorrect conflict
resolution in preparatory work for the r12-440 /
bd1cd0d0e0fe / "Remove CC0" commit, when rebasing a related
branch, and not testing any of the affected targets.  Either
way, the effect was a btest-gcc.sh state of "regress-1152"
for cris-elf.  FWIW, I wrote the removed code (sans the
validly removed cc0 line), a part of what was committed at
2020-08-24 as 0e6c51de8ec47 / r11-2814.

This commit gets cris-elf test-results back to a sane state
(tested at 0ffdbc85d9a6 / r12-761).

gcc:
* reorg.c (fill_slots_from_thread): Reinstate code typoed out in
"Remove CC0".

3 years agoRevert "tree-sra: Avoid refreshing into const base decls (PR 100453)"
Martin Jambor [Sat, 15 May 2021 08:11:12 +0000 (10:11 +0200)]
Revert "tree-sra: Avoid refreshing into const base decls (PR 100453)"

This reverts commit ca9bb74a5f856ccdceb4797f18b0a4ac8f49d069.
...because of Ada issues I did not catch with original testing.

gcc/ChangeLog:

2021-05-12  Martin Jambor  <mjambor@suse.cz>

Revert:
        PR tree-optimization/100453
* tree-sra.c (sra_modify_assign): All const base accesses do not
need refreshing, not just those from decl_pool.
(sra_modify_assign): Do not refresh into a const base decl.

gcc/testsuite/ChangeLog:

2021-05-12  Martin Jambor  <mjambor@suse.cz>

Revert:
        PR tree-optimization/100453
* gcc.dg/tree-ssa/pr100453.c: New test.

3 years agoregcprop: Fix another cprop_hardreg bug [PR100342]
Jakub Jelinek [Sat, 15 May 2021 08:12:11 +0000 (10:12 +0200)]
regcprop: Fix another cprop_hardreg bug [PR100342]

On Tue, Jan 19, 2021 at 04:10:33PM +0000, Richard Sandiford via Gcc-patches wrote:
> Ah, ok, thanks for the extra context.
>
> So AIUI the problem when recording xmm2<-di isn't just:
>
>  [A] partial_subreg_p (vd->e[sr].mode, GET_MODE (src))
>
> but also that:
>
>  [B] partial_subreg_p (vd->e[sr].mode, vd->e[vd->e[sr].oldest_regno].mode)
>
> For example, all registers in this sequence can be part of the same chain:
>
>     (set (reg:HI R1) (reg:HI R0))
>     (set (reg:SI R2) (reg:SI R1)) // [A]
>     (set (reg:DI R3) (reg:DI R2)) // [A]
>     (set (reg:SI R4) (reg:SI R[0-3]))
>     (set (reg:HI R5) (reg:HI R[0-4]))
>
> But:
>
>     (set (reg:SI R1) (reg:SI R0))
>     (set (reg:HI R2) (reg:HI R1))
>     (set (reg:SI R3) (reg:SI R2)) // [A] && [B]
>
> is problematic because it dips below the precision of the oldest regno
> and then increases again.
>
> When this happens, I guess we have two choices:
>
> (1) what the patch does: treat R3 as the start of a new chain.
> (2) pretend that the copy occured in vd->e[sr].mode instead
>     (i.e. copy vd->e[sr].mode to vd->e[dr].mode)
>
> I guess (2) would need to be subject to REG_CAN_CHANGE_MODE_P.
> Maybe the optimisation provided by (2) compared to (1) isn't common
> enough to be worth the complication.
>
> I think we should test [B] as well as [A] though.  The pass is set
> up to do some quite elaborate mode changes and I think rejecting
> [A] on its own would make some of the other code redundant.
> It also feels like it should be a seperate “if” or “else if”,
> with its own comment.

Unfortunately, we now have a testcase that shows that testing also [B]
is a problem (unfortunately now latent on the trunk, only reproduces
on 10 and 11 branches).

The comment in the patch tries to list just the interesting instructions,
we have a 64-bit value, copy low 8 bit of those to another register,
copy full 64 bits to another register and then clobber the original register.
Before that (set (reg:DI r14) (const_int ...)) we have a chain
DI r14, QI si, DI bp , that instruction drops the DI r14 from that chain, so
we have QI si, DI bp , si being the oldest_regno.
Next DI si is copied into DI dx.  Only the low 8 bits of that are defined,
the rest is unspecified, but we would add DI dx into that same chain at the
end, so QI si, DI bp, DI dx [*].  Next si is overwritten, so the chain is
DI bp, DI dx.  And then we see (set (reg:DI dx) (reg:DI bp)) and remove it
as redundant, because we think bp and dx are already equivalent, when in
reality that is true only for the lowpart 8 bits.
I believe the [*] marked step above is where the bug is.

The committed regcprop.c (copy_value) change (but only committed to
trunk/11, not to 10) added
  else if (partial_subreg_p (vd->e[sr].mode, GET_MODE (src))
           && partial_subreg_p (vd->e[sr].mode,
                                vd->e[vd->e[sr].oldest_regno].mode))
    return;
and while the first partial_subreg_p call returns true, the second one
doesn't; before the (set (reg:DI r14) (const_int ...)) insn it would be
true and we'd return, but as that reg got clobbered, si became the oldest
regno in the chain and so vd->e[vd->e[sr].oldest_regno].mode is QImode
and vd->e[sr].mode is QImode too, so the second partial_subreg_p is false.
But as the testcase shows, what is the oldest_regno in the chain is
something that changes over time, so relying on it for anything is
problematic, something could have a different oldest_regno and later
on get a different oldest_regno (perhaps with different mode) because
the oldest_regno got overwritten and it can change both ways.

The following patch effectively implements your (2) above.

2021-05-15  Jakub Jelinek  <jakub@redhat.com>

PR rtl-optimization/100342
* regcprop.c (copy_value): When copying a source reg in a wider
mode than it has recorded for the value, adjust recorded destination
mode too or punt if !REG_CAN_CHANGE_MODE_P.

* gcc.target/i386/pr100342.c: New test.

3 years agoDaily bump.
GCC Administrator [Sat, 15 May 2021 00:16:27 +0000 (00:16 +0000)]
Daily bump.

3 years agoFortran/OpenMP: Support 'omp parallel master'
Tobias Burnus [Fri, 14 May 2021 17:21:47 +0000 (19:21 +0200)]
Fortran/OpenMP: Support 'omp parallel master'

gcc/fortran/ChangeLog:

* dump-parse-tree.c (show_omp_node, show_code_node): Handle
EXEC_OMP_PARALLEL_MASTER.
* frontend-passes.c (gfc_code_walker): Likewise.
* gfortran.h (enum gfc_statement): Add ST_OMP_PARALLEL_MASTER and
ST_OMP_END_PARALLEL_MASTER.
(enum gfc_exec_op): Add EXEC_OMP_PARALLEL_MASTER..
* match.h (gfc_match_omp_parallel_master): Handle it.
* openmp.c (gfc_match_omp_parallel_master, resolve_omp_clauses,
omp_code_to_statement, gfc_resolve_omp_directive): Likewise.
* parse.c (decode_omp_directive, case_exec_markers,
gfc_ascii_statement, parse_omp_structured_block,
parse_executable): Likewise.
* resolve.c (gfc_resolve_blocks, gfc_resolve_code): Likewise.
* st.c (gfc_free_statement): Likewise.
* trans-openmp.c (gfc_trans_omp_parallel_master,
gfc_trans_omp_workshare, gfc_trans_omp_directive): Likewise.
* trans.c (trans_code): Likewise.

libgomp/ChangeLog:

* testsuite/libgomp.fortran/parallel-master.f90: New test.

gcc/testsuite/ChangeLog:

* gfortran.dg/gomp/parallel-master-1.f90: New test.
* gfortran.dg/gomp/parallel-master-2.f90: New test.

3 years agoFortran/OpenMP: Handle implicit SAVE for variables in main
Tobias Burnus [Fri, 14 May 2021 17:19:26 +0000 (19:19 +0200)]
Fortran/OpenMP: Handle implicit SAVE for variables in main

gcc/fortran/ChangeLog:

* resolve.c (resolve_symbol): Handle implicit SAVE of main-program
for vars in 'omp threadprivate' and 'omp declare target'.

gcc/testsuite/ChangeLog:

* gfortran.dg/gomp/implicit-save.f90: New test.

3 years agoc++: simplify enclosing_instantiation_of [PR95870]
Jason Merrill [Mon, 5 Apr 2021 15:47:50 +0000 (11:47 -0400)]
c++: simplify enclosing_instantiation_of [PR95870]

Comparing DECL_SOURCE_LOCATION like the GCC 11 patch for PR 95870 will also
work for user-defined functions, if we update their location when
instantiating.  Another option would be to use LAMBDA_EXPR_REGEN_INFO for
lambdas, but this way is even simpler.

gcc/cp/ChangeLog:

PR c++/95870
* pt.c (enclosing_instantiation_of): Just compare
DECL_SOURCE_LOCATION.
(regenerate_decl_from_template): Copy DECL_SOURCE_LOCATION.

3 years agointl: add comments to _, N_, and G_
Jason Merrill [Fri, 14 May 2021 00:53:50 +0000 (20:53 -0400)]
intl: add comments to _, N_, and G_

gcc/ChangeLog:

* intl.h: Add comments.

3 years agoaarch64: Make sqdmlal2 patterns match canonical RTL
Kyrylo Tkachov [Fri, 14 May 2021 09:05:42 +0000 (10:05 +0100)]
aarch64: Make sqdmlal2 patterns match canonical RTL

The sqdmlal2 patterns are hidden beneath the SBINQOPS iterator and unfortunately they don't match
canonical RTL because the simple accumulate operand comes in the first arm of the SS_PLUS.
This patch splits the SS_PLUS and SS_MINUS forms with the SS_PLUS operands set up to match
the canonical form, where the complex operand comes first.

gcc/ChangeLog:

* config/aarch64/aarch64-simd.md
(aarch64_sqdml<SBINQOPS:as>l2_lane<mode>_internal): Split into...
(aarch64_sqdmlsl2_lane<mode>_internal): ... This...
(aarch64_sqdmlal2_lane<mode>_internal): ... And this.
(aarch64_sqdml<SBINQOPS:as>l2_laneq<mode>_internal): Split into ...
(aarch64_sqdmlsl2_laneq<mode>_internal): ... This...
(aarch64_sqdmlal2_laneq<mode>_internal): ... And this.
(aarch64_sqdml<SBINQOPS:as>l2_n<mode>_internal): Split into...
(aarch64_sqdmlsl2_n<mode>_internal): ... This...
(aarch64_sqdmlal2_n<mode>_internal): ... And this.

3 years agotestsuite: Add testcase for already fixed PR [PR95226]
Jakub Jelinek [Fri, 14 May 2021 14:29:49 +0000 (16:29 +0200)]
testsuite: Add testcase for already fixed PR [PR95226]

2021-05-14  Jakub Jelinek  <jakub@redhat.com>

PR c++/95226
* g++.dg/cpp1y/pr95226.C: New test.

3 years agotestsuite: Add testcase for already fixed PR [PR94616]
Jakub Jelinek [Fri, 14 May 2021 13:34:12 +0000 (15:34 +0200)]
testsuite: Add testcase for already fixed PR [PR94616]

2021-05-14  Jakub Jelinek  <jakub@redhat.com>

PR c++/94616
* g++.dg/cpp0x/pr94616.C: New test.

3 years agotestsuite: Add testcase for already fixed PR [PR90019]
Jakub Jelinek [Fri, 14 May 2021 12:56:28 +0000 (14:56 +0200)]
testsuite: Add testcase for already fixed PR [PR90019]

2021-05-14  Jakub Jelinek  <jakub@redhat.com>

PR c++/90019
* g++.dg/cpp0x/sfinae68.C: New test.

3 years agoCleanup temp files in libphobos unittest at src/std/process.d
Bernd Edlinger [Fri, 14 May 2021 05:10:59 +0000 (07:10 +0200)]
Cleanup temp files in libphobos unittest at src/std/process.d

2021-05-14  Bernd Edlinger  <bernd.edlinger@hotmail.de>

* src/std/process.d (unittest): Remove tmpname on exit.
* src/MERGE: Merge upstream phobos 63f4caa90.

3 years agotestsuite: Add testcase for already fixed PR [PR88872]
Jakub Jelinek [Fri, 14 May 2021 11:24:12 +0000 (13:24 +0200)]
testsuite: Add testcase for already fixed PR [PR88872]

2021-05-14  Jakub Jelinek  <jakub@redhat.com>

* g++.dg/cpp1y/pr88872.C: New test.

3 years agoarm/PR66791: Replace calls to vtst builtin with it's boolean logic equivalent.
prathamesh.kulkarni [Fri, 14 May 2021 10:33:43 +0000 (16:03 +0530)]
arm/PR66791: Replace calls to vtst builtin with it's boolean logic equivalent.

gcc/ChangeLog:

2021-05-14  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

PR target/66791
* config/arm/arm_neon.h (vtst_s8): Replace call to vtst builtin with it's
boolean logic equivalent.
(vtst_s16): Likewise.
(vtst_s32): Likewise.
(vtst_u8): Likewise.
(vtst_u16): Likewise.
(vtst_u32): Likewise.
(vtst_p8): Likewise.
(vtst_p16): Likewise.
(vtstq_s8): Likewise.
(vtstq_s16): Likewise.
(vtstq_s32): Likewise.
(vtstq_u8): Likewise.
(vtstq_u16): Likewise.
(vtstq_u32): Likewise.
(vtstq_p8): Likewise.
(vtstq_p16): Likewise.

* config/arm/arm_neon_builtins.def: Remove entry for vtst.
* config/arm/neon.md (neon_vtst<mode>): Remove pattern.

3 years agoFix my name in ChangeLog files.
Martin Liska [Fri, 14 May 2021 10:14:22 +0000 (12:14 +0200)]
Fix my name in ChangeLog files.

3 years agoTSAN: add new test
Michael de Lang [Fri, 14 May 2021 10:09:45 +0000 (12:09 +0200)]
TSAN: add new test

gcc/testsuite/ChangeLog:

* g++.dg/tsan/pthread_cond_clockwait.C: New test.

3 years agodownload_prerequisites: update MPFR version to recommended
Martin Liska [Fri, 14 May 2021 10:00:19 +0000 (12:00 +0200)]
download_prerequisites: update MPFR version to recommended

contrib/ChangeLog:

* download_prerequisites: Use version 4.1.0.

3 years agoopts: add Warning keyword for 2 options
Martin Liska [Fri, 14 May 2021 09:40:58 +0000 (11:40 +0200)]
opts: add Warning keyword for 2 options

gcc/c-family/ChangeLog:

* c.opt: Add Warning keyword for 2 options.

3 years agoClosing of 8 branch.
Jakub Jelinek [Fri, 14 May 2021 09:24:08 +0000 (11:24 +0200)]
Closing of 8 branch.

2021-05-14  Jakub Jelinek  <jakub@redhat.com>

contrib/
* gcc-changelog/git_update_version.py: Remove releases/gcc-8 from
active_refs.
maintainer-scripts/
* crontab: Stop doing gcc-8 snapshots.

3 years agoaarch64: Merge sqdmlal2 and sqdmlsl2 expanders
Kyrylo Tkachov [Wed, 12 May 2021 09:52:51 +0000 (10:52 +0100)]
aarch64: Merge sqdmlal2 and sqdmlsl2 expanders

The various sqdmlal2 and sqdmlsl2 expanders perform almost identical functions and can be
merged using code iterators and attributes to reduce the code in the MD file.
No behavioural change is expected.

gcc/ChangeLog:

* config/aarch64/aarch64-simd.md (aarch64_sqdmlal2<mode>): Merge into...
(aarch64_sqdml<SBINQOPS:as>l2<mode>): ... This.
(aarch64_sqdmlsl2<mode>): Delete.
(aarch64_sqdmlal2_lane<mode>): Merge this...
(aarch64_sqdmlsl2_lane<mode>): ... And this...
(aarch64_sqdml<SBINQOPS:as>l2_lane<mode>): ... Into this.
(aarch64_sqdmlal2_laneq<mode>): Merge this...
(aarch64_sqdmlsl2_laneq<mode>): ... And this...
(aarch64_sqdml<SBINQOPS:as>l2_laneq<mode>): ... Into this.
(aarch64_sqdmlal2_n<mode>): Merge this...
(aarch64_sqdmlsl2_n<mode>): ... And this...
(aarch64_sqdml<SBINQOPS:as>l2_n<mode>): ... Into this.

3 years agoPort gnat-style to Sphinx.
Martin Liska [Mon, 10 May 2021 13:51:12 +0000 (15:51 +0200)]
Port gnat-style to Sphinx.

gcc/ada/ChangeLog:

* doc/Makefile: Add gnat-style target.
* doc/share/conf.py: Likewise.
* doc/gnat-style.rst: New file.

3 years agogcc-changelog: detect Co-Authored-By before ChangeLog entries
Martin Liska [Fri, 14 May 2021 08:44:33 +0000 (10:44 +0200)]
gcc-changelog: detect Co-Authored-By before ChangeLog entries

contrib/ChangeLog:

* gcc-changelog/git_commit.py: Support Co-Authored-By before
a first ChangeLog entry.

3 years agolibsanitizer: cherry-pick from upstream
H.J. Lu [Fri, 14 May 2021 01:23:55 +0000 (18:23 -0700)]
libsanitizer: cherry-pick from upstream

cherry-pick:

72797dedb720 [sanitizer] Use size_t on g_tls_size to fix build on x32

3 years agoc++: Check attributes on friend declarations [PR99032]
Marek Polacek [Fri, 30 Apr 2021 01:38:14 +0000 (21:38 -0400)]
c++: Check attributes on friend declarations [PR99032]

This patch implements [dcl.attr.grammar]/5: "If an attribute-specifier-seq
appertains to a friend declaration ([class.friend]), that declaration shall
be a definition."

This restriction applies to C++11-style attributes as well as GNU
attributes with the exception that we allow GNU attributes that require
a type, such as vector_size to continue accepting code as in attrib63.C.
There are various forms of friend declarations, we have friend
templates, C++11 extended friend declarations, and so on.  In some cases
we already ignore the attribute and warn that it was ignored.  But
certain cases weren't diagnosed, and with this patch we'll give a hard
error.  I tried hard not to emit both a warning and error and I think it
worked out.

Jason provided the cp_parser_decl_specifier_seq hunk to detect using
standard attributes in the middle of decl-specifiers, which is invalid.

Co-authored-by: Jason Merrill <jason@redhat.com>
gcc/cp/ChangeLog:

PR c++/99032
* cp-tree.h (any_non_type_attribute_p): Declare.
* decl.c (grokdeclarator): Diagnose when an attribute appertains to
a friend declaration that is not a definition.
* decl2.c (any_non_type_attribute_p): New.
* parser.c (cp_parser_decl_specifier_seq): Diagnose standard attributes
in the middle of decl-specifiers.
(cp_parser_elaborated_type_specifier): Diagnose when an attribute
appertains to a friend declaration that is not a definition.
(cp_parser_member_declaration): Likewise.

gcc/testsuite/ChangeLog:

PR c++/99032
* g++.dg/cpp0x/friend7.C: New test.
* g++.dg/cpp0x/gen-attrs-4.C: Add dg-error.
* g++.dg/cpp0x/gen-attrs-39-1.C: Likewise.
* g++.dg/cpp0x/gen-attrs-74.C: New test.
* g++.dg/ext/attrib63.C: New test.

3 years agoDaily bump.
GCC Administrator [Fri, 14 May 2021 00:16:30 +0000 (00:16 +0000)]
Daily bump.

3 years agoPR middle-end/100574 - ICE in size_remaining, at builtins.c
Martin Sebor [Thu, 13 May 2021 22:20:45 +0000 (16:20 -0600)]
PR middle-end/100574 - ICE in size_remaining, at builtins.c

gcc/ChangeLog:

PR middle-end/100574
* builtins.c (access_ref::get_ref): Improve detection of PHIs with
all null arguments.

3 years agoAvoid -Wuninitialized false negatives with sanitization and VLAs.
Martin Sebor [Thu, 13 May 2021 22:05:50 +0000 (16:05 -0600)]
Avoid -Wuninitialized false negatives with sanitization and VLAs.

Resolves:
PR tree-optimization/93100 - gcc -fsanitize=address inhibits -Wuninitialized
PR middle-end/98583 - missing -Wuninitialized reading from a second VLA in its own block

gcc/ChangeLog:

PR tree-optimization/93100
PR middle-end/98583
* tree-ssa-uninit.c (check_defs): Exclude intrinsic functions that
don't modify referenced objects.

gcc/testsuite/ChangeLog:

PR tree-optimization/93100
PR middle-end/98583
* g++.dg/warn/uninit-pr93100.C: New test.
* gcc.dg/uninit-pr93100.c: New test.
* gcc.dg/uninit-pr98583.c: New test.

3 years agotree-sra: Avoid refreshing into const base decls (PR 100453)
Martin Jambor [Thu, 13 May 2021 21:26:32 +0000 (23:26 +0200)]
tree-sra: Avoid refreshing into const base decls (PR 100453)

When SRA transforms an assignment where the RHS is an aggregate decl
that it creates replacements for, the (least efficient) fallback
method of dealing with them is to store all the replacements back into
the original decl and then let the original assignment takes itc
sourse.

That of course should not need to be done for TREE_READONLY bases
which cannot change contents.  The SRA code handled this situation in
one of two necessary places but only for DECL_IN_CONSTANT_POOL const
decls, this patch modifies both to check TREE_READONLY.

gcc/ChangeLog:

2021-05-12  Martin Jambor  <mjambor@suse.cz>

PR tree-optimization/100453
* tree-sra.c (sra_modify_assign): All const base accesses do not
need refreshing, not just those from decl_pool.
(sra_modify_assign): Do not refresh into a const base decl.

gcc/testsuite/ChangeLog:

2021-05-12  Martin Jambor  <mjambor@suse.cz>

PR tree-optimization/100453
* gcc.dg/tree-ssa/pr100453.c: New test.

3 years agolibsanitizer : Update LOCAL_PATCHES.
Iain Sandoe [Thu, 13 May 2021 20:19:19 +0000 (21:19 +0100)]
libsanitizer : Update LOCAL_PATCHES.

This adds the local patch to handle missing __builtin_os_log_format
on Darwin.

libsanitizer/ChangeLog:

* LOCAL_PATCHES: Add Darwin patch for __builtin_os_log_format.

3 years agolibsanitizer, Darwin : Handle missing __builtin_os_log_format.
Iain Sandoe [Thu, 13 May 2021 18:43:09 +0000 (19:43 +0100)]
libsanitizer, Darwin : Handle missing __builtin_os_log_format.

GCC does not, currently, define __builtin_os_log_format, which
is needed by os/log.h.  Do not include that header unless the
builtin is defined (since the header errors out on the same
condition).  Provide a work-around solution to the missing API
provided via the header.

libsanitizer/ChangeLog:

* sanitizer_common/sanitizer_mac.cpp : Check for the
availability of __builtin_os_log_format before trying to
include a header depending on it.
(OS_LOG_DEFAULT): New.
(os_log_error): Define to a fall-back using an older API.

3 years agolibgcc: pru: Place mpyll into its own section
Dimitar Dimitrov [Sun, 21 Mar 2021 14:38:51 +0000 (16:38 +0200)]
libgcc: pru: Place mpyll into its own section

This should help LD's --gc-sections feature to reduce final ELF size.

libgcc/ChangeLog:

* config/pru/mpyll.S (__pruabi_mpyll): Place into own section.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
3 years agoFix compilation error in ILP32.
Martin Sebor [Thu, 13 May 2021 17:32:33 +0000 (11:32 -0600)]
Fix compilation error in ILP32.

gcc/testsuite/ChangeLog:
* g++.dg/pr100574.C: Use size_t as operator new argument type.

3 years agoattributes: target_clone expects a string argument
Martin Liska [Thu, 13 May 2021 11:59:59 +0000 (13:59 +0200)]
attributes: target_clone expects a string argument

PR middle-end/100504

gcc/c-family/ChangeLog:

* c-attribs.c (handle_target_clones_attribute): Expect a string
argument to target_clone argument.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr100504.c: New test.

3 years agolibphobos: Fix static asserts on NetBSD, FreeBSD, DragonFlyBSD
Iain Buclaw [Thu, 13 May 2021 17:09:48 +0000 (19:09 +0200)]
libphobos: Fix static asserts on NetBSD, FreeBSD, DragonFlyBSD

The function declarations were updated to use `const scope', but the
static asserts were not.

Reviewed-on: https://github.com/dlang/druntime/pull/3470

libphobos/ChangeLog:

* libdruntime/MERGE: Merge upstream druntime 98c6ff0c.

3 years agoRemove unused variable.
Martin Liska [Thu, 13 May 2021 09:05:15 +0000 (11:05 +0200)]
Remove unused variable.

Addresses the following clang warning:
gcc/tree-ssa-dom.c:652:33: warning: private field 'm_simplifier' is not used [-Wunused-private-field]

gcc/ChangeLog:

* tree-ssa-dom.c: Remove m_simplifier.

3 years agoPR c/100550 - ICE: in fold_convert_loc with function call VLA argument
Martin Sebor [Thu, 13 May 2021 16:38:09 +0000 (10:38 -0600)]
PR c/100550 - ICE: in fold_convert_loc with function call VLA argument

gcc/c/ChangeLog:

PR c/100550
* c-decl.c (get_parm_array_spec): Avoid erroneous VLA bounds.

gcc/testsuite/ChangeLog:

PR c/100550
* gcc.dg/Wvla-parameter-9.c: New test.

3 years agoopenmp: Add testcases to verify OpenMP 5.0 2.14 and OpenMP 5.1 2.17 rules [PR99928]
Jakub Jelinek [Thu, 13 May 2021 14:53:48 +0000 (16:53 +0200)]
openmp: Add testcases to verify OpenMP 5.0 2.14 and OpenMP 5.1 2.17 rules [PR99928]

In preparation of PR99928 patch review, I've prepared testcases with clauses
that need more interesting handling on combined/composite constructs,
in particular firstprivate, lastprivate, firstprivate+lastprivate, linear
(explicit on non-iv, explicit on simd iv, implicit on simd iv, implicit on
simd iv declared in the construct), reduction (scalars, array sections of
array variables, array sections with pointer bases) and in_reduction.

OpenMP 5.0 had the wording broken for reduction, the intended rule to use
map(tofrom:) on target when combined with it was bound only on inscan modifier
presence which makes no sense, as then inscan may not be used, this has
been fixed in 5.1 and I'm just assuming 5.1 wording for that.

There are various cases where e.g. from historical or optimization reasons
GCC slightly deviates from the rules, but in most cases it is something
that shouldn't be really observable, e.g. whether
  #pragma omp parallel for firstprivate(x)
is handled as
  #pragma omp parallel shared(x)
  #pragma omp for firstprivate(x)
or
  #pragma omp parallel firstprivate(x)
  #pragma omp for
shouldn't be possible to distinguish in user code.  I've added FIXMEs
in the testcases about that, but maybe we just should keep it as is
(alternative would be to do it in standard compliant way and transform
into whatever we like after gimplification (e.g. early during omplower)).
Some cases we for historical reasons implement even with clauses on
constructs which in the standard don't accept them that way and then
handling those magically in omp lowering/expansion, in particular e.g.
  #pragma omp parallel for firstprivate(x) lastprivate(x)
we treat as
  #pragma omp parallel firstprivate(x) lastprivate(x)
  #pragma omp for
even when lastprivate is not valid on parallel.  Maybe one day we
could change that if we make sure we don't regress generated code quality.

I've also found a bug in OpenMP 5.0/5.1,
  #pragma omp parallel sections firstprivate(x) lastprivate(x)
incorrectly says that it should be handled as
  #pragma omp parallel firstprivate(x)
  #pragma omp sections lastprivate(x)
which when written that way results in error; filed as
https://github.com/OpenMP/spec/issues/2758
to be fixed in OpenMP 5.2.  GCC handles it the way it used to do
and users expect, so nothing to fix on the GCC side.

Also, we don't support yet in_reduction clause on target construct,
which means the -11.c testcase can't include any tests about in_reduction
handling on all the composite constructs that include target.

The work found two kinds of bugs on the GCC side, one is the known thing
that we implement still the 4.5 behavior and don't mark for
lastprivate/linear/reduction the list item as map(tofrom:) as mentioned
in PR99928.  These cases are xfailed in the tests.

And another one is with r21 and r28 in -{8,9,10}.c tests - we don't add
reduction clause on teams for
  #pragma omp {target ,}teams distribute simd reduction(+:r)
even when the spec says that teams shouldn't receive reduction only
when combined with loop construct.

In
make check-gcc check-g++ RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} gomp.exp=pr99928*'
testing this shows:

  # of expected passes 5648
  # of expected failures 872

and with Tobias' patch applied:

  # of expected passes 5648
  # of unexpected successes 384
  # of expected failures 488

2021-05-13  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/99928
* c-c++-common/gomp/pr99928-1.c: New test.
* c-c++-common/gomp/pr99928-2.c: New test.
* c-c++-common/gomp/pr99928-3.c: New test.
* c-c++-common/gomp/pr99928-4.c: New test.
* c-c++-common/gomp/pr99928-5.c: New test.
* c-c++-common/gomp/pr99928-6.c: New test.
* c-c++-common/gomp/pr99928-7.c: New test.
* c-c++-common/gomp/pr99928-8.c: New test.
* c-c++-common/gomp/pr99928-9.c: New test.
* c-c++-common/gomp/pr99928-10.c: New test.
* c-c++-common/gomp/pr99928-11.c: New test.

3 years agotestsuite: suppress cast warnings in pr100563.c [PR100563]
Richard Earnshaw [Thu, 13 May 2021 13:52:05 +0000 (14:52 +0100)]
testsuite: suppress cast warnings in pr100563.c [PR100563]

Fix a warning when building on machines that don't have 32-bit pointers

gcc/testsuite:

PR target/100563
* gcc.dg/pr100563.c (dg-options): Add -wno-pointer-to-int-cast.

3 years agomklog: Put detected PR entries before ChangeLogs
Martin Liska [Thu, 13 May 2021 13:12:36 +0000 (15:12 +0200)]
mklog: Put detected PR entries before ChangeLogs

contrib/ChangeLog:

* mklog.py: Put PR entries before all ChangeLog entries
(will be added to all ChangeLog locations by Daily bump script).
* test_mklog.py: Test the new behavior.

3 years agoarm: correctly handle inequality comparisons against max constants [PR100563]
Richard Earnshaw [Thu, 13 May 2021 10:42:58 +0000 (11:42 +0100)]
arm: correctly handle inequality comparisons against max constants [PR100563]

Normally we expect the gimple optimizers to fold away comparisons that
are always true, but at some lower optimization levels this is not
always the case, so the back-end has to be able to generate correct
code in these cases.

In this example, we have a comparison of the form

  (unsigned long long) op <= ~0ULL

which, of course is always true.

Normally, in the arm back-end we handle these expansions where the
immediate cannot be handled directly by adding 1 to the constant and
then adjusting the comparison operator:

  (unsigned long long) op < CONST + 1

but we cannot do that when the constant is already the largest value.

Fortunately, we observe that the comparisons we need to handle this
way are either always true or always false, so instead of forming a
comparison against the maximum value, we can replace it with a
comparison against the minimum value (which just happens to also be a
constant we can handle.  So

  op1 <= ~0ULL -> op1 >= 0U
  op1 > ~0ULL -> op1 < 0U

  op1 <= LONG_LONG_INT_MAX -> op1 >= (-LONG_LONG_INT_MAX - 1)
  op1 > LONG_LONG_INT_MAX -> op1 < (-LONG_LONG_INT_MAX - 1)

gcc:
PR target/100563
* config/arm/arm.c (arm_canonicalize_comparison): Correctly
canonicalize DImode inequality comparisons against the
maximum integral value.

gcc/testsuite:
* gcc.dg/pr100563.c: New test.

3 years agoix86: Support V{2, 4}DImode arithmetic right shifts for SSE2+ [PR98856]
Jakub Jelinek [Thu, 13 May 2021 10:14:14 +0000 (12:14 +0200)]
ix86: Support V{2, 4}DImode arithmetic right shifts for SSE2+ [PR98856]

As mentioned in the PR, we don't support arithmetic right V2DImode or
V4DImode on x86 without -mavx512vl or -mxop.  The ISAs indeed don't have
{,v}psraq instructions until AVX512VL, but we actually can emulate it quite
easily.
One case is arithmetic >> 63, we can just emit {,v}pxor; {,v}pcmpgt for
that for SSE4.2+, or for SSE2 psrad $31; pshufd $0xf5.
Then arithmetic >> by constant > 32, that can be done with {,v}psrad $31
and {,v}psrad $(cst-32) and two operand permutation,
arithmetic >> 32 can be done as {,v}psrad $31 and permutation of that
and the original operand.  Arithmetic >> by constant < 32 can be done
as {,v}psrad $cst and {,v}psrlq $cst and two operand permutation.
And arithmetic >> by variable scalar amount can be done as
arithmetic >> 63, logical >> by the amount, << by (64 - amount of the
>> 63 result; note that the vector << 64 result in 0) and oring together.

I had to improve the permutation generation so that it actually handles
the needed permutations (or handles them better).

2021-05-13  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/98856
* config/i386/i386.c (ix86_shift_rotate_cost): Add CODE argument.
Expect V2DI and V4DI arithmetic right shifts to be emulated.
(ix86_rtx_costs, ix86_add_stmt_cost): Adjust ix86_shift_rotate_cost
caller.
* config/i386/i386-expand.c (expand_vec_perm_2perm_interleave,
expand_vec_perm_2perm_pblendv): New functions.
(ix86_expand_vec_perm_const_1): Use them.
* config/i386/sse.md (ashr<mode>3<mask_name>): Rename to ...
(<mask_codefor>ashr<mode>3<mask_name>): ... this.
(ashr<mode>3): New define_expand with VI248_AVX512BW iterator.
(ashrv4di3): New define_expand.
(ashrv2di3): Change condition to TARGET_SSE2, handle !TARGET_XOP
and !TARGET_AVX512VL expansion.

* gcc.target/i386/sse2-psraq-1.c: New test.
* gcc.target/i386/sse4_2-psraq-1.c: New test.
* gcc.target/i386/avx-psraq-1.c: New test.
* gcc.target/i386/avx2-psraq-1.c: New test.
* gcc.target/i386/avx-pr82370.c: Adjust expected number of vpsrad
instructions.
* gcc.target/i386/avx2-pr82370.c: Likewise.
* gcc.target/i386/avx512f-pr82370.c: Likewise.
* gcc.target/i386/avx512bw-pr82370.c: Likewise.
* gcc.dg/torture/vshuf-4.inc: Add two further permutations.
* gcc.dg/torture/vshuf-8.inc: Likewise.

3 years agoi386: Fix up V2SFmode vcond* with -mxop [PR100581]
Uros Bizjak [Thu, 13 May 2021 09:09:53 +0000 (11:09 +0200)]
i386: Fix up V2SFmode vcond* with -mxop [PR100581]

ix86_expand_sse_movcc has special TARGET_XOP handling and the recent
addition of support of v*cond* patterns for V2SFmode results in
ICEs because the expected pattern doesn't exist.  We can handle it
using 128-bit vpcmov (if we ignore the upper 64 bits like we ignore in
other TARGET_MMX_WITH_SSE support).

2021-05-13  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
PR target/100581
* config/i386/i386-expand.c (ix86_expand_sse_movcc): Force mode
sizes < 16 to a register when constructing vpcmov pattern.
* config/i386/mmx.md (*xop_pcmov_<mode>): Use MMXMODE124 mode.

gcc/testsuite/

PR target/100581
* g++.target/i386/pr100581.C: New test.

3 years agogcov: Use system IO buffering
marxin [Wed, 18 Nov 2020 15:13:23 +0000 (16:13 +0100)]
gcov: Use system IO buffering

gcc/ChangeLog:

* gcov-io.c (gcov_write_block): Remove.
(gcov_write_words): Likewise.
(gcov_read_words): Re-implement using gcov_read_bytes.
(gcov_allocate): Remove.
(GCOV_BLOCK_SIZE): Likewise.
(struct gcov_var): Remove most of the fields.
(gcov_position): Implement with ftell.
(gcov_rewrite): Remove setting of start and offset fields.
(from_file): Re-format.
(gcov_open): Remove setbuf call. It should not be needed.
(gcov_close): Remove internal buffer handling.
(gcov_magic): Use __builtin_bswap32.
(gcov_write_counter): Use directly gcov_write_unsigned.
(gcov_write_string): Use direct fwrite and do not round
to 4 bytes.
(gcov_seek): Use directly fseek.
(gcov_write_tag): Use gcov_write_unsigned directly.
(gcov_write_length): Likewise.
(gcov_write_tag_length): Likewise.
(gcov_read_bytes): Use directly fread.
(gcov_read_unsigned): Use gcov_read_words.
(gcov_read_counter): Likewise.
(gcov_read_string): Use gcov_read_bytes.
* gcov-io.h (GCOV_WORD_SIZE): Adjust to reflect
that size is not in bytes, but words (4B).
(GCOV_TAG_FUNCTION_LENGTH): Likewise.
(GCOV_TAG_ARCS_LENGTH): Likewise.
(GCOV_TAG_ARCS_NUM): Likewise.
(GCOV_TAG_COUNTER_LENGTH): Likewise.
(GCOV_TAG_COUNTER_NUM): Likewise.
(GCOV_TAG_SUMMARY_LENGTH): Likewise.

libgcc/ChangeLog:

* libgcov-driver.c: Fix GNU coding style.

3 years agoPrune another new LTO warning
Eric Botcazou [Thu, 13 May 2021 07:32:50 +0000 (09:32 +0200)]
Prune another new LTO warning

gcc/testsuite/
PR testsuite/100569
* gnat.dg/lto21.adb: Prune new LTO warning.

3 years agolibsanitizer: update LOCAL_PATCHES.
Martin Liska [Thu, 13 May 2021 07:30:05 +0000 (09:30 +0200)]
libsanitizer: update LOCAL_PATCHES.

libsanitizer/ChangeLog:

* LOCAL_PATCHES: Update to the corresponding revision.

3 years agolibsanitizer: Apply local patches.
Martin Liska [Fri, 13 Nov 2020 16:21:45 +0000 (17:21 +0100)]
libsanitizer: Apply local patches.

3 years agolibsanitizer: merge from master
Martin Liska [Wed, 12 May 2021 12:37:22 +0000 (14:37 +0200)]
libsanitizer: merge from master

Merged revision: f58e0513dd95944b81ce7a6e7b49ba656de7d75f

3 years agotestsuite: prune new LTO warning
Martin Liska [Thu, 13 May 2021 07:23:30 +0000 (09:23 +0200)]
testsuite: prune new LTO warning

libgomp/ChangeLog:

PR testsuite/100569
* testsuite/libgomp.c/omp-nested-3.c: Prune new LTO warning.
* testsuite/libgomp.c/pr46032-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/data-clauses-kernels-ipa-pta.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/data-clauses-parallel-ipa-pta.c: Likewise.

gcc/testsuite/ChangeLog:

PR testsuite/100569
* gcc.dg/atomic/c11-atomic-exec-2.c: Prune new LTO warning.
* gcc.dg/torture/pr94947-1.c: Likewise.

3 years agoFix typo in testcase.
liuhongt [Thu, 13 May 2021 05:44:13 +0000 (13:44 +0800)]
Fix typo in testcase.

gcc/testsuite/ChangeLog:

* gcc.target/i386/avx-pr94680.c: Fix typo in testcase.

3 years agoOptimize __builtin_shuffle when it's used to zero the upper bits of the dest. [PR...
liuhongt [Thu, 22 Apr 2021 07:33:16 +0000 (15:33 +0800)]
Optimize __builtin_shuffle when it's used to zero the upper bits of the dest. [PR target/94680]

If the second operand of __builtin_shuffle is const vector 0, and with
specific mask, it can be optimized to movq/vmovps.

.i.e.
foo128:
-       vxorps  %xmm1, %xmm1, %xmm1
-       vmovlhps        %xmm1, %xmm0, %xmm0
+       vmovq   %xmm0, %xmm0

 foo256:
-       vxorps  %xmm1, %xmm1, %xmm1
-       vshuff32x4      $0, %ymm1, %ymm0, %ymm0
+       vmovaps %xmm0, %xmm0

 foo512:
-       vxorps  %xmm1, %xmm1, %xmm1
-       vshuff32x4      $68, %zmm1, %zmm0, %zmm0
+       vmovaps %ymm0, %ymm0

gcc/ChangeLog:

PR target/94680
* config/i386/sse.md (ssedoublevecmode): Add attribute for
V64QI/V32HI/V16SI/V4DI.
(ssehalfvecmode): Add attribute for V2DI/V2DF.
(*vec_concatv4si_0): Extend to VI124_128.
(*vec_concat<mode>_0): New pre-reload splitter.
* config/i386/predicates.md (movq_parallel): New predicate.

gcc/testsuite/ChangeLog:

PR target/94680
* gcc.target/i386/avx-pr94680.c: New test.
* gcc.target/i386/avx512f-pr94680.c: New test.
* gcc.target/i386/sse2-pr94680.c: New test.

3 years agoDaily bump.
GCC Administrator [Thu, 13 May 2021 00:16:29 +0000 (00:16 +0000)]
Daily bump.

3 years agoretry zero-call-used-regs from zeroed regs
Alexandre Oliva [Thu, 13 May 2021 00:05:26 +0000 (21:05 -0300)]
retry zero-call-used-regs from zeroed regs

default_zero_call_used_regs currently requires all potentially zeroed
registers to offer a move opcode that accepts zero as an operand.

This is not the case e.g. for ARM's r12/ip in Thumb mode, and it was
not the case of FP registers on AArch64 as of GCC 10.

This patch introduces a fallback strategy to zero out registers,
copying from registers that have already been zeroed.  Adjacent
sources to make up wider modes are also supported.

This does not guarantee that there will be some zeroed-out register to
use as the source, but it expands the cases in which the default
implementation works out of the box.

for  gcc/ChangeLog

* targhooks.c (default_zero_call_used_regs): Retry using
successfully-zeroed registers as sources.

3 years agoOpenMP: detach - fix firstprivate handling
Tobias Burnus [Wed, 12 May 2021 22:12:31 +0000 (00:12 +0200)]
OpenMP: detach - fix firstprivate handling

gcc/ChangeLog:

* omp-low.c (finish_taskreg_scan): Use the proper detach decl.

libgomp/ChangeLog:

* testsuite/libgomp.c-c++-common/task-detach-12.c: New test.
* testsuite/libgomp.fortran/task-detach-12.f90: New test.

3 years agoAdd test for PR middle-end/100571.
Martin Sebor [Wed, 12 May 2021 21:57:34 +0000 (15:57 -0600)]
Add test for PR middle-end/100571.

gcc/testsuite:
PR middle-end/100571
* gcc.dg/Wstringop-overflow-67.c: New test.

3 years agoSkip out on processing __builtin_clz when varying.
Aldy Hernandez [Wed, 12 May 2021 19:22:15 +0000 (15:22 -0400)]
Skip out on processing __builtin_clz when varying.

The previous changes to irange::constant_p return TRUE for
VARYING, since VARYING has numerical end points like any other
constant range.  The problem is that some users of constant_p
depended on constant_p excluding the full domain.  The
range handler for __builtin_clz, that is shared between ranger
and vr_values, is one such user.

This patch excludes varying_p(), to match the original behavior
for clz.

gcc/ChangeLog:

PR c/100521
* gimple-range.cc (range_of_builtin_call): Skip out on
  processing __builtin_clz when varying.

3 years agoMAINTAINERS: Add myself for write after approval
Marcel Vollweiler [Wed, 12 May 2021 17:14:41 +0000 (10:14 -0700)]
MAINTAINERS: Add myself for write after approval

ChangeLog:

2021-05-12  Marcel Vollweiler  <marcel@codesourcery.com>

* MAINTAINERS (Write After Approval): Add myself.

3 years agoc++: Disable -Wint-in-bool-context in instantiations
Marek Polacek [Wed, 12 May 2021 15:19:13 +0000 (11:19 -0400)]
c++: Disable -Wint-in-bool-context in instantiations

This warning is of questionable value when it's emitted when
instantiating a template, as in the following testcase.  It could be
silenced by writing hb(i) << 1 instead of 2 * hb(i) but that's
unnecessary obfuscation.

gcc/cp/ChangeLog:

* pt.c (tsubst_copy_and_build): Add warn_int_in_bool_context
sentinel.

gcc/testsuite/ChangeLog:

* g++.dg/warn/Wint-in-bool-context-2.C: New test.

3 years agoOpenMP: Add support for 'close' in map clause
Marcel Vollweiler [Wed, 12 May 2021 16:31:58 +0000 (09:31 -0700)]
OpenMP: Add support for 'close' in map clause

gcc/c/ChangeLog:

* c-parser.c (c_parser_omp_clause_map): Support map-type-modifier
'close'.

gcc/cp/ChangeLog:

* parser.c (cp_parser_omp_clause_map): Support map-type-modifier
'close'.

gcc/testsuite/ChangeLog:

* c-c++-common/gomp/map-6.c: New test.
* c-c++-common/gomp/map-7.c: New test.

3 years ago[nvptx] Add -mptx=3.1/6.3
Tom de Vries [Wed, 12 May 2021 10:40:37 +0000 (12:40 +0200)]
[nvptx] Add -mptx=3.1/6.3

Add nvptx option -mptx that sets the ptx ISA version.  This is currently
hardcoded to 3.1.

Tested libgomp on x86_64-linux with nvptx accelerator, both with default set to
3.1 and 6.3.

gcc/ChangeLog:

2021-05-12  Tom de Vries  <tdevries@suse.de>

PR target/96005
* config/nvptx/nvptx-opts.h (enum ptx_version): New enum.
* config/nvptx/nvptx.c (nvptx_file_start): Print .version according
to ptx_version_option.
* config/nvptx/nvptx.h (TARGET_PTX_6_3): Define.
* config/nvptx/nvptx.md (define_insn "nvptx_shuffle<mode>")
(define_insn "nvptx_vote_ballot"): Use sync variant for
TARGET_PTX_6_3.
* config/nvptx/nvptx.opt (ptx_version): Add enum.
(mptx): Add option.
* doc/invoke.texi (Nvidia PTX Options): Add mptx item.

3 years agotree-optimization/100566 - fix another predication issue in VN
Richard Biener [Wed, 12 May 2021 13:39:52 +0000 (15:39 +0200)]
tree-optimization/100566 - fix another predication issue in VN

This amends the fix for PR100053 where I failed to amend all edge
tests in dominated_by_p_w_unex.

2021-05-12  Richard Biener  <rguenther@suse.de>

PR tree-optimization/100566
* tree-ssa-sccvn.c (dominated_by_p_w_unex): Properly handle
allow_back for all edge queries.

* gcc.dg/torture/pr100566.c: New testcase.

3 years agolibstdc++: Fix some problems in PSTL tests
Jonathan Wakely [Wed, 12 May 2021 10:21:51 +0000 (11:21 +0100)]
libstdc++: Fix some problems in PSTL tests

libstdc++-v3/ChangeLog:

* testsuite/25_algorithms/pstl/alg_nonmodifying/find_end.cc:
Increase dg-timeout-factor to 4. Fix -Wunused-parameter
warnings. Replace bitwise AND with logical AND in loop
condition.
* testsuite/25_algorithms/pstl/alg_nonmodifying/search_n.cc:
Replace bitwise AND with logical AND in loop condition.
* testsuite/util/pstl/test_utils.h: Remove unused parameter
names.

3 years agolibcpp: Fix up -fdirectives-only preprocessing of includes not ending with newline...
Jakub Jelinek [Wed, 12 May 2021 13:14:35 +0000 (15:14 +0200)]
libcpp: Fix up -fdirectives-only preprocessing of includes not ending with newline [PR100392]

If a header doesn't end with a new-line, with -fdirectives-only we right now
preprocess it as
int i = 1;# 2 "pr100392.c" 2
i.e. the line directive isn't on the next line, which means we fail to parse
it when compiling.

GCC 10 and earlier libcpp/directives-only.c had for this:
  if (!pfile->state.skipping && cur != base)
    {
      /* If the file was not newline terminated, add rlimit, which is
         guaranteed to point to a newline, to the end of our range.  */
      if (cur[-1] != '\n')
        {
          cur++;
          CPP_INCREMENT_LINE (pfile, 0);
          lines++;
        }

      cb->print_lines (lines, base, cur - base);
    }
and we have the assertion
      /* Files always end in a newline or carriage return.  We rely on this for
         character peeking safety.  */
      gcc_assert (buffer->rlimit[0] == '\n' || buffer->rlimit[0] == '\r');
So, this patch just does readd the more less same thing, so that we emit
a newline after the inline even when it wasn't there before.

2021-05-12  Jakub Jelinek  <jakub@redhat.com>

PR preprocessor/100392
* lex.c (cpp_directive_only_process): If buffer doesn't end with '\n',
add buffer->rlimit[0] character to the printed range and
CPP_INCREMENT_LINE and increment line_count.

* gcc.dg/cpp/pr100392.c: New test.
* gcc.dg/cpp/pr100392.h: New file.

3 years agolto-wrapper: silent warnings in tests
Martin Liska [Wed, 12 May 2021 12:03:36 +0000 (14:03 +0200)]
lto-wrapper: silent warnings in tests

Silents the following warning:
lto-wrapper: warning: using serial compilation of 2 LTRANS jobs

gcc/testsuite/ChangeLog:

* lib/lto.exp: When running tests without jobserver, one can see
the following warning for tests that use 1to1 partitioning.

3 years agoi386: Optimize vpblendvb on inverted mask register to vpblendvb on swapping the order...
liuhongt [Wed, 7 Apr 2021 01:58:54 +0000 (09:58 +0800)]
i386: Optimize vpblendvb on inverted mask register to vpblendvb on swapping the order of operand 1 and operand 2. [PR target/99908]

-       vpcmpeqd        %ymm3, %ymm3, %ymm3
-       vpandn  %ymm3, %ymm2, %ymm2
-       vpblendvb       %ymm2, %ymm1, %ymm0, %ymm0
+       vpblendvb       %ymm2, %ymm0, %ymm1, %ymm0

gcc/ChangeLog:

PR target/99908
* config/i386/sse.md (<sse4_1_avx2>_pblendvb): Add
splitters for pblendvb of NOT mask register.

gcc/testsuite/ChangeLog:

PR target/99908
* gcc.target/i386/avx2-pr99908.c: New test.
* gcc.target/i386/sse4_1-pr99908.c: New test.

3 years agotree-optimization/100519 - avoid reassociating asm goto defs
Richard Biener [Tue, 11 May 2021 12:59:59 +0000 (14:59 +0200)]
tree-optimization/100519 - avoid reassociating asm goto defs

This splits can_associate_p into checks for SSA defs and checks
for the type so it can be called from is_reassociable_op to
catch cases not catched by the earlier fix.

2021-05-11  Richard Biener  <rguenther@suse.de>

PR tree-optimization/100519
* tree-ssa-reassoc.c (can_associate_p): Split into...
(can_associate_op_p): ... this
(can_associate_type_p): ... and this.
(is_reassociable_op): Call can_associate_op_p.
(break_up_subtract_bb): Call the appropriate predicates.
(reassociate_bb): Likewise.

* gcc.dg/torture/pr100519.c: New testcase.

3 years agoFix uninitialized variable in Atree.Size_In_Slots
Bob Duff [Wed, 12 May 2021 09:56:47 +0000 (11:56 +0200)]
Fix uninitialized variable in Atree.Size_In_Slots

Size_In_Slots uses the Nkind to look up the size in a table indexed
by Nkind.  This patch fixes a couple of places where the Nkind is
wrong (uninitialized or zeroed out) so Size_In_Slots cannot be used.

gcc/ada/
PR ada/100564
* atree.adb (Change_Node): Do not call Zero_Slots on a Node_Id
when the Nkind has not yet been set; call the other Zero_Slots
that takes a range of slot offsets.  Call the new Mutate_Kind
that takes an Old_Size, for the same reason -- the size cannot
be computed without the Nkind.
(Mutate_Nkind): New function that allows specifying the Old_Size.
(Size_In_Slots): Assert that the Nkind has proper (nonzero) value.
* atree.ads: Minor reformatting.

3 years agoLTO: merge -flto=arg from object files.
Martin Liska [Wed, 12 May 2021 09:59:17 +0000 (11:59 +0200)]
LTO: merge -flto=arg from object files.

gcc/ChangeLog:

* lto-wrapper.c (merge_and_complain): Merge -flto=arg options.
(run_gcc): Use -flto argument detection for merged
fdecoded_options.

3 years agoPrint warning diagnostics for -flto issues.
Martin Liska [Thu, 22 Apr 2021 14:27:19 +0000 (16:27 +0200)]
Print warning diagnostics for -flto issues.

gcc/ChangeLog:

* lto-wrapper.c (print_lto_docs_link): New function.
(run_gcc): Print warning about missing job server detection
after we know NR of partitions. Do the same for -flto{,=1}.
* opts.c (get_option_html_page): Support -flto option.

3 years agolto-wrapper: Use vec<cl_decoded_option> data type.
Martin Liska [Fri, 12 Mar 2021 10:53:47 +0000 (11:53 +0100)]
lto-wrapper: Use vec<cl_decoded_option> data type.

gcc/ChangeLog:

* lto-wrapper.c (get_options_from_collect_gcc_options): Change
return type.
(append_option): Remove.
(find_option): Rework to use the vector type.
(remove_option): Remove.
(merge_and_complain): Use vectors for cl_decoded_option data
type arguments.
(append_compiler_options): Likewise.
(append_diag_options): Likewise.
(append_linker_options): Likewise.
(append_offload_options): Likewise.
(compile_offload_image): Likewise.
(compile_images_for_offload_targets): Likewise.
(find_and_merge_options): Likewise.
(run_gcc): Likewise.

3 years agoFix ICE in output_rnglists, at dwarf2out.c:12294
Bernd Edlinger [Tue, 11 May 2021 15:55:18 +0000 (17:55 +0200)]
Fix ICE in output_rnglists, at dwarf2out.c:12294

In this testcase the compile unit consists of a single
text section with a single embedded DECL_IGNORED_P function.
So we have a kind of multi-range text section here.
To avoid an ICE in output_rnglists we need to make sure
that have_multiple_function_sections is set to true.
This is a regression from
e69ac020372 ("Add line debug info for virtual thunks")

2021-05-12  Bernd Edlinger  <bernd.edlinger@hotmail.de>

PR debug/100515
* dwarf2out.c (dwarf2out_finish): Set
have_multiple_function_sections with multi-range text_section.

* gcc.dg/debug/dwarf2/pr100515.c: New testcase.

3 years agoRemove version.h from object files
Martin Liska [Wed, 12 May 2021 08:51:21 +0000 (10:51 +0200)]
Remove version.h from object files

gcc/ChangeLog:

PR bootstrap/100560
* Makefile.in: Remove version.h from linker command line.

3 years agoDaily bump.
GCC Administrator [Wed, 12 May 2021 08:51:03 +0000 (08:51 +0000)]
Daily bump.

3 years agomiddle-end/100547 - check rtvec_alloc size
Richard Biener [Wed, 12 May 2021 07:07:42 +0000 (09:07 +0200)]
middle-end/100547 - check rtvec_alloc size

This makes the rtvec_alloc argument size_t catching overflow and
truncated arguments (from "invalid" testcases), verifying the
argument against INT_MAX which is the limit set by the int
typed rtvec_def.num_elem member.

2021-05-12  Richard Biener  <rguenther@suse.de>

PR middle-end/100547
* rtl.h (rtvec_alloc): Make argument size_t.
* rtl.c (rtvec_alloc): Verify the count is less than INT_MAX.

3 years agoexpand: Don't reuse DEBUG_EXPRs with vector type if they have different modes [PR100508]
Jakub Jelinek [Wed, 12 May 2021 08:38:35 +0000 (10:38 +0200)]
expand: Don't reuse DEBUG_EXPRs with vector type if they have different modes [PR100508]

The inliner doesn't remap DEBUG_EXPR_DECLs, so the same decls can appear
in multiple functions.
Furthermore, expansion reuses corresponding DEBUG_EXPRs too, so they again
can be reused in multiple functions.
Neither of that is a major problem, DEBUG_EXPRs are just magic value holders
and what value they stand for is independent in each function and driven by
what debug stmts or DEBUG_INSNs they are bound to.
Except for DEBUG_EXPR*s with vector types, TYPE_MODE can be either BLKmode
or some vector mode depending on whether current function's enabled ISAs
support that vector mode or not.  On the following testcase, we expand it
first in foo function without AVX2 enabled and so the DEBUG_EXPR is
BLKmode, but later the same DEBUG_EXPR_DECL is used in a simd clone with
AVX2 enabled and expansion ICEs because of a mode mismatch.

The following patch fixes that by forcing recreation of a DEBUG_EXPR if
there is a mode mismatch for vector typed DEBUG_EXPR_DECL, DEBUG_EXPRs
will be still reused in between functions otherwise and within the same
function the mode should be always the same.

2021-05-12  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/100508
* cfgexpand.c (expand_debug_expr): For DEBUG_EXPR_DECL with vector
type, don't reuse DECL_RTL if it has different mode, instead force
creation of a new DEBUG_EXPR.

* gcc.dg/gomp/pr100508.c: New test.

3 years agoada: do not use binary mode in conf.py
Martin Liska [Mon, 10 May 2021 13:36:59 +0000 (15:36 +0200)]
ada: do not use binary mode in conf.py

gcc/ada/ChangeLog:

* doc/share/conf.py: Do not use binary mode.
Do not use u' literals as Python3 uses unicode by default.

3 years agogcc-changelog: respect branch in git_update_version.py.
Martin Liska [Wed, 12 May 2021 08:37:12 +0000 (10:37 +0200)]
gcc-changelog: respect branch in git_update_version.py.

contrib/ChangeLog:

* gcc-changelog/git_commit.py: Simplify needle lookup.
* gcc-changelog/git_update_version.py: Pass ref_name to
parse_git_revisions.

3 years agomatch.pd: Optimize (x & y) == x into (x & ~y) == 0 [PR94589]
Jakub Jelinek [Wed, 12 May 2021 07:46:03 +0000 (09:46 +0200)]
match.pd: Optimize (x & y) == x into (x & ~y) == 0 [PR94589]

> Somewhere in RTL (_M_value&1)==_M_value is turned into (_M_value&-2)==0,
> that could be worth doing already in GIMPLE.

Apparently it is
  /* Simplify eq/ne (and/ior x y) x/y) for targets with a BICS instruction or
     constant folding if x/y is a constant.  */
  if ((code == EQ || code == NE)
      && (op0code == AND || op0code == IOR)
      && !side_effects_p (op1)
      && op1 != CONST0_RTX (cmp_mode))
    {
      /* Both (eq/ne (and x y) x) and (eq/ne (ior x y) y) simplify to
         (eq/ne (and (not y) x) 0).  */
...
      /* Both (eq/ne (and x y) y) and (eq/ne (ior x y) x) simplify to
         (eq/ne (and (not x) y) 0).  */
Yes, doing that on GIMPLE for the case where the not argument is constant
would simplify the phiopt follow-up (it would be single imm use then).

On Thu, May 06, 2021 at 09:42:41PM +0200, Marc Glisse wrote:
> We can probably do it in 2 steps, first something like
>
> (for cmp (eq ne)
>  (simplify
>   (cmp (bit_and:c @0 @1) @0)
>   (cmp (@0 (bit_not! @1)) { build_zero_cst (TREE_TYPE (@0)); })))
>
> to get rid of the double use, and then simplify X&C==0 to X<=~C if C is a
> mask 111...000 (I thought we already had a function to detect such masks, or
> the 000...111, but I can't find them anymore).

Ok, here is the first step then.

2021-05-12  Jakub Jelinek  <jakub@redhat.com>
    Marc Glisse  <marc.glisse@inria.fr>

PR tree-optimization/94589
* match.pd ((X & Y) == X -> (X & ~Y) == 0,
(X | Y) == Y -> (X & ~Y) == 0): New GIMPLE simplifications.

* gcc.dg/tree-ssa/pr94589-1.c: New test.

3 years agoMinor fixes
Eric Botcazou [Tue, 11 May 2021 08:59:51 +0000 (10:59 +0200)]
Minor fixes

3 years agoi386: Implement FP vector compares for V2SFmode [PR98218]
Uros Bizjak [Wed, 12 May 2021 06:11:18 +0000 (08:11 +0200)]
i386: Implement FP vector compares for V2SFmode [PR98218]

Implement FP vector compares for V2SFmode for TARGET_MMX_WITH_SSE.

2021-05-12  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
PR target/98218
* config/i386/i386-expand.c (ix86_expand_sse_movcc): Handle V2SF mode.
* config/i386/mmx.md (MMXMODE124): New mode iterator.
(V2FI): Ditto.
(mmxintvecmode): New mode attribute.
(mmxintvecmodelower): Ditto.
(*mmx_maskcmpv2sf3_comm): New insn pattern.
(*mmx_maskcmpv2sf3): Ditto.
(vec_cmpv2sfv2si): New expander.
(vcond<V2FI:mode>v2si): Ditto.
(mmx_vlendvps): New insn pattern.
(vcond<MMXMODE124:mode><MMXMODEI:mode>): Also handle V2SFmode.
(vcondu<MMXMODE124:mode><MMXMODEI:mode>): Ditto.
(vcond_mask_<mode><mmxintvecmodelower>): Ditto.

gcc/testsuite/

PR target/98218
* g++.target/i386/pr98218-1.C: Ditto.
* gcc.target/i386/pr98218-4.c: New test.

* gcc.target/i386/pr98218-1.c: Correct PR number.
* gcc.target/i386/pr98218-1a.c: Ditto.
* gcc.target/i386/pr98218-2.c: Ditto.
* gcc.target/i386/pr98218-2a.c: Ditto.
* gcc.target/i386/pr98218-3.c: Ditto.
* gcc.target/i386/pr98218-3a.c: Ditto.

3 years agopreprocessor: Support C2X #elifdef, #elifndef
Joseph Myers [Tue, 11 May 2021 23:54:01 +0000 (23:54 +0000)]
preprocessor: Support C2X #elifdef, #elifndef

C2X adds #elifdef and #elifndef preprocessor directives; these have
also been proposed for C++.  Implement these directives in libcpp
accordingly.

In this implementation, #elifdef and #elifndef are treated as
non-directives for any language version other than c2x and gnu2x (if
the feature is accepted for C++, it can trivially be enabled for
relevant C++ versions).  In strict conformance modes for prior
language versions, this is required, as illustrated by the
c11-elifdef-1.c test added.

Bootstrapped with no regressions for x86_64-pc-linux-gnu.

libcpp/
* include/cpplib.h (struct cpp_options): Add elifdef.
* init.c (struct lang_flags): Add elifdef.
(lang_defaults): Update to include elifdef initializers.
(cpp_set_lang): Set elifdef for pfile based on language.
* directives.c (STDC2X, ELIFDEF): New macros.
(EXTENSION): Increase value to 3.
(DIRECTIVE_TABLE): Add #elifdef and #elifndef.
(_cpp_handle_directive): Do not treat ELIFDEF directives as
directives for language versions without the #elifdef feature.
(do_elif): Handle #elifdef and #elifndef.
(do_elifdef, do_elifndef): New functions.

gcc/testsuite/
* gcc.dg/cpp/c11-elifdef-1.c, gcc.dg/cpp/c2x-elifdef-1.c,
gcc.dg/cpp/c2x-elifdef-2.c: New tests.

3 years agoUpdate gcc ja.po.
Joseph Myers [Tue, 11 May 2021 21:06:33 +0000 (21:06 +0000)]
Update gcc ja.po.

* ja.po: Update.

3 years agoReplace unreachable code with an assert.
Martin Sebor [Tue, 11 May 2021 19:58:48 +0000 (13:58 -0600)]
Replace unreachable code with an assert.

Resolves:
PR middle-end/21433 - The COMPONENT_REF case of expand_expr_real_1 is probably wrong

gcc/ChangeLog:

PR middle-end/21433
* expr.c (expand_expr_real_1): Replace unreachable code with an assert.

3 years agopreprocessor: Fix cpp_avoid_paste for digit separators
Joseph Myers [Tue, 11 May 2021 18:54:32 +0000 (18:54 +0000)]
preprocessor: Fix cpp_avoid_paste for digit separators

The libcpp function cpp_avoid_paste is used to insert whitespace in
preprocessed output where needed to avoid two consecutive
preprocessing tokens, that logically (e.g. when stringized) do not
have whitespace between them, from being incorrectly lexed as one when
the preprocessed input is reread by a compiler.

This fails to allow for digit separators, so meaning that invalid
code, that has a CPP_NUMBER (from a macro expansion) followed by a
character literal, can result in preprocessed output with a valid use
of digit separators, so that required syntax errors do not occur when
compiling with -save-temps.  Fix this by handling that case in
cpp_avoid_paste (as with other cases in cpp_avoid_paste, this doesn't
try to check whether the language version in use supports digit
separators; it's always OK to have unnecessary whitespace in
preprocessed output).

Note: there are other cases, with various kinds of wide character or
string literal following a CPP_NUMBER, where spurious pasting of
preprocessing tokens can occur but the sequence of tokens remains
invalid both before and after that pasting.  Maybe cpp_avoid_paste
should also handle those cases (and similar cases after a CPP_NAME),
to ensure the sequence of preprocessing tokens in preprocessed output
is exactly right, whether or not it affects whether syntax errors
occur.  This patch only addresses the case with digit separators where
invalid code can fail to be diagnosed without the space inserted.

Bootstrapped with no regressions for x86_64-pc-linux-gnu.

libcpp/
* lex.c (cpp_avoid_paste): Do not allow pasting CPP_NUMBER with
CPP_CHAR.

gcc/testsuite/
* g++.dg/cpp1y/digit-sep-paste.C, gcc.dg/c2x-digit-separators-3.c:
New tests.

3 years agotestsuite: Fix input operands of gcc.dg/guality/pr43077-1.c
Stefan Schulze Frielinghaus [Tue, 11 May 2021 17:33:37 +0000 (19:33 +0200)]
testsuite: Fix input operands of gcc.dg/guality/pr43077-1.c

The type of the output operands *p and *q of the extended asm statement
of function foo is unsigned long whereas the type of the corresponding
input operands is int.  This results, e.g. on IBM Z, in the case that
the immediates 2 and 3 are written into registers in SI mode and read in
DI mode resulting in wrong values.  Fixed by lifting the input operands
to type long.

gcc/testsuite/ChangeLog:

* gcc.dg/guality/pr43077-1.c: Align types of output and input
operands by lifting immediates to type long.

3 years agolibstdc++: Remove extern "C" from Ryu sources
Patrick Palka [Tue, 11 May 2021 17:19:46 +0000 (13:19 -0400)]
libstdc++: Remove extern "C" from Ryu sources

floating_to_chars.cc includes the Ryu sources into an anonymous
namespace as a convenient way to give all its symbols internal linkage.
But an entity declared extern "C" always has external linkage even
from within an anonymous namespace, so this trick doesn't work in the
presence of extern "C", and it causes the Ryu function generic_to_chars
to be visible from libstdc++.a.

This patch removes the only use of extern "C" from our local copy of
Ryu along with some declarations for never-defined functions that GCC
now warns about.

libstdc++-v3/ChangeLog:

* src/c++17/ryu/LOCAL_PATCHES: Update.
* src/c++17/ryu/ryu_generic_128.h: Remove extern "C".
Remove declarations for never-defined functions.
* testsuite/20_util/to_chars/4.cc: New test.

3 years agolibstdc++: Fix tests that fail in C++98 mode
Jonathan Wakely [Tue, 11 May 2021 16:14:26 +0000 (17:14 +0100)]
libstdc++: Fix tests that fail in C++98 mode

The header synopsis test fails to define NOTHROW for C++98.

The shared_ptr test should be skipped for C++98.

The debug mode one should work for C++98 too, it just needs to avoid
C++11 syntax that isn't valid in C++98.

libstdc++-v3/ChangeLog:

* testsuite/20_util/headers/memory/synopsis.cc: Define C++98
alternative for macro.
* testsuite/20_util/shared_ptr/creation/99006.cc: Add effective
target keyword.
* testsuite/25_algorithms/copy/debug/99402.cc: Avoid C++11
syntax.

3 years agolibstdc++: Fix missing members in std::allocator<void>
Jonathan Wakely [Tue, 11 May 2021 14:01:01 +0000 (15:01 +0100)]
libstdc++: Fix missing members in std::allocator<void>

The changes in 75c6a925dab5b7af9ab47c10906cb0e140261cc2 were slightly
incorrect, because the converting constructor should be noexcept, and
the POCMA and is_always_equal traits should still be present in C++20.
This fixes it, and slightly refactors the preprocessor conditions and
order of members. Also add comments explaining things.

The non-standard construct and destroy members added for PR 78052 can be
private if allocator_traits<allocator<void>> is made a friend.

libstdc++-v3/ChangeLog:

* include/bits/allocator.h (allocator<void>) [C++20]: Add
missing noexcept to constructor. Restore missing POCMA and
is_always_equal_traits.
[C++17]: Make construct and destroy members private and
declare allocator_traits as a friend.
* include/bits/memoryfwd.h (allocator_traits): Declare.
* include/ext/malloc_allocator.h (malloc_allocator::allocate):
Add nodiscard attribute. Add static assertion for LWG 3307.
* include/ext/new_allocator.h (new_allocator::allocate): Add
static assertion for LWG 3307.
* testsuite/20_util/allocator/void.cc: Check that converting
constructor is noexcept. Check for propagation traits and
size_type and difference_type. Check that pointer and
const_pointer are gone in C++20.

3 years agopreprocessor: Enable digit separators for C2X
Joseph Myers [Tue, 11 May 2021 14:25:55 +0000 (14:25 +0000)]
preprocessor: Enable digit separators for C2X

C2X adds digit separators, as in C++.  Enable them accordingly in
libcpp and c-lex.c.  Some basic tests are added that digit separators
behave as expected for C2X and are properly disabled for C11; further
test coverage is included in the existing g++.dg/cpp1y/digit-sep*.C
tests.

Bootstrapped with no regressions for x86_64-pc-linux-gnu.

gcc/c-family/
* c-lex.c (interpret_float): Handle digit separators for C2X.

libcpp/
* init.c (lang_defaults): Enable digit separators for GNUC2X and
STDC2X.

gcc/testsuite/
* gcc.dg/c11-digit-separators-1.c,
gcc.dg/c2x-digit-separators-1.c, gcc.dg/c2x-digit-separators-2.c:
New tests.

3 years agoc++: ICE casting class to vector [PR100517]
Jason Merrill [Tue, 11 May 2021 13:53:20 +0000 (09:53 -0400)]
c++: ICE casting class to vector [PR100517]

My recent change to reject calling rvalue() with an argument of class type
crashes on this testcase, where we use rvalue() on what we expect to be an
argument of integer or vector type.  Fixed by checking first.

gcc/cp/ChangeLog:

PR c++/100517
* typeck.c (build_reinterpret_cast_1): Check intype on
cast to vector.

gcc/testsuite/ChangeLog:

PR c++/100517
* g++.dg/ext/vector41.C: New test.

3 years agoMore maybe_fold_reference TLC
Richard Biener [Tue, 11 May 2021 12:49:07 +0000 (14:49 +0200)]
More maybe_fold_reference TLC

This removes stale users of maybe_fold_reference where IL constraints
make it never do anything.

2021-05-11  Richard Biener  <rguenther@suse.de>

* gimple-fold.c (gimple_fold_call): Do not call
maybe_fold_reference on call arguments or the static chain.
(fold_stmt_1): Do not call maybe_fold_reference on GIMPLE_ASM
inputs.

3 years agoRemove dead components from MAINTAINERS.
Martin Liska [Fri, 12 Mar 2021 07:48:43 +0000 (08:48 +0100)]
Remove dead components from MAINTAINERS.

ChangeLog:

* MAINTAINERS: Remove entries for removed
components (HSA, BRIG, libhsail-rt).
Move Pekka to Write After Approval.

3 years agoRemove libhsail-rt.
Martin Liska [Thu, 11 Mar 2021 15:23:56 +0000 (16:23 +0100)]
Remove libhsail-rt.

ChangeLog:

* Makefile.def: Remove libhsail-rt.
* Makefile.in: Likewise.
* configure.ac: Likewise.
* configure: Regenerate.
* libhsail-rt/ChangeLog: Removed.
* libhsail-rt/Makefile.am: Removed.
* libhsail-rt/Makefile.in: Removed.
* libhsail-rt/README: Removed.
* libhsail-rt/aclocal.m4: Removed.
* libhsail-rt/configure: Removed.
* libhsail-rt/configure.ac: Removed.
* libhsail-rt/configure.tgt: Removed.
* libhsail-rt/include/internal/fibers.h: Removed.
* libhsail-rt/include/internal/phsa-queue-interface.h: Removed.
* libhsail-rt/include/internal/phsa-rt.h: Removed.
* libhsail-rt/include/internal/workitems.h: Removed.
* libhsail-rt/rt/arithmetic.c: Removed.
* libhsail-rt/rt/atomics.c: Removed.
* libhsail-rt/rt/bitstring.c: Removed.
* libhsail-rt/rt/fbarrier.c: Removed.
* libhsail-rt/rt/fibers.c: Removed.
* libhsail-rt/rt/fp16.c: Removed.
* libhsail-rt/rt/misc.c: Removed.
* libhsail-rt/rt/multimedia.c: Removed.
* libhsail-rt/rt/queue.c: Removed.
* libhsail-rt/rt/sat_arithmetic.c: Removed.
* libhsail-rt/rt/segment.c: Removed.
* libhsail-rt/rt/workitems.c: Removed.
* libhsail-rt/target-config.h.in: Removed.

contrib/ChangeLog:

* gcc_update: Remove libhsail-rt folder.
* update-copyright.py: Likewise.

3 years agoRemove BRIG front-end.
Martin Liska [Thu, 11 Mar 2021 15:13:24 +0000 (16:13 +0100)]
Remove BRIG front-end.

gcc/ada/ChangeLog:

* gcc-interface/ada-tree.h (BUILT_IN_LIKELY): Use builtins
from COROUTINES.
(BUILT_IN_UNLIKELY): Likewise.

gcc/ChangeLog:

* builtins.def (DEF_HSAIL_BUILTIN): Remove.
(DEF_HSAIL_ATOMIC_BUILTIN): Likewise.
(DEF_HSAIL_SAT_BUILTIN): Likewise.
(DEF_HSAIL_INTR_BUILTIN): Likewise.
(DEF_HSAIL_CVT_ZEROI_SAT_BUILTIN): Likewise.
* doc/frontends.texi: Remove BRIG.
* doc/install.texi: Likewise.
* doc/invoke.texi: Likewise.
* doc/standards.texi: Likewise.
* brig-builtins.def: Removed.
* brig/ChangeLog: Removed.
* brig/Make-lang.in: Removed.
* brig/brig-builtins.h: Removed.
* brig/brig-c.h: Removed.
* brig/brig-lang.c: Removed.
* brig/brigfrontend/brig-arg-block-handler.cc: Removed.
* brig/brigfrontend/brig-atomic-inst-handler.cc: Removed.
* brig/brigfrontend/brig-basic-inst-handler.cc: Removed.
* brig/brigfrontend/brig-branch-inst-handler.cc: Removed.
* brig/brigfrontend/brig-cmp-inst-handler.cc: Removed.
* brig/brigfrontend/brig-code-entry-handler.cc: Removed.
* brig/brigfrontend/brig-code-entry-handler.h: Removed.
* brig/brigfrontend/brig-comment-handler.cc: Removed.
* brig/brigfrontend/brig-control-handler.cc: Removed.
* brig/brigfrontend/brig-copy-move-inst-handler.cc: Removed.
* brig/brigfrontend/brig-cvt-inst-handler.cc: Removed.
* brig/brigfrontend/brig-fbarrier-handler.cc: Removed.
* brig/brigfrontend/brig-function-handler.cc: Removed.
* brig/brigfrontend/brig-function.cc: Removed.
* brig/brigfrontend/brig-function.h: Removed.
* brig/brigfrontend/brig-inst-mod-handler.cc: Removed.
* brig/brigfrontend/brig-label-handler.cc: Removed.
* brig/brigfrontend/brig-lane-inst-handler.cc: Removed.
* brig/brigfrontend/brig-machine.c: Removed.
* brig/brigfrontend/brig-machine.h: Removed.
* brig/brigfrontend/brig-mem-inst-handler.cc: Removed.
* brig/brigfrontend/brig-module-handler.cc: Removed.
* brig/brigfrontend/brig-queue-inst-handler.cc: Removed.
* brig/brigfrontend/brig-seg-inst-handler.cc: Removed.
* brig/brigfrontend/brig-signal-inst-handler.cc: Removed.
* brig/brigfrontend/brig-to-generic.cc: Removed.
* brig/brigfrontend/brig-to-generic.h: Removed.
* brig/brigfrontend/brig-util.cc: Removed.
* brig/brigfrontend/brig-util.h: Removed.
* brig/brigfrontend/brig-variable-handler.cc: Removed.
* brig/brigfrontend/hsa-brig-format.h: Removed.
* brig/brigfrontend/phsa.h: Removed.
* brig/brigspec.c: Removed.
* brig/config-lang.in: Removed.
* brig/gccbrig.texi: Removed.
* brig/lang-specs.h: Removed.
* brig/lang.opt: Removed.

gcc/testsuite/ChangeLog:

* gfortran.dg/goacc/pr78027.f90: Remove -Wno-hsa option.
* brig.dg/README: Removed.
* brig.dg/dg.exp: Removed.
* brig.dg/test/gimple/alloca.hsail: Removed.
* brig.dg/test/gimple/atomics.hsail: Removed.
* brig.dg/test/gimple/branches.hsail: Removed.
* brig.dg/test/gimple/fbarrier.hsail: Removed.
* brig.dg/test/gimple/function_calls.hsail: Removed.
* brig.dg/test/gimple/internal-casts.hsail: Removed.
* brig.dg/test/gimple/kernarg.hsail: Removed.
* brig.dg/test/gimple/mem.hsail: Removed.
* brig.dg/test/gimple/mulhi.hsail: Removed.
* brig.dg/test/gimple/packed.hsail: Removed.
* brig.dg/test/gimple/priv-array-offset-access.hsail: Removed.
* brig.dg/test/gimple/smoke_test.hsail: Removed.
* brig.dg/test/gimple/variables.hsail: Removed.
* brig.dg/test/gimple/vector.hsail: Removed.
* lib/brig-dg.exp: Removed.
* lib/brig.exp: Removed.

3 years agoipa/100513 - fix SSA_NAME_DEF_STMT corruption in IPA param manip
Richard Biener [Tue, 11 May 2021 11:23:45 +0000 (13:23 +0200)]
ipa/100513 - fix SSA_NAME_DEF_STMT corruption in IPA param manip

This fixes unintended clobbering of SSA_NAME_DEF_STMT of the
cloned/inlined from SSA name during IPA parameter manipulation
of call stmt LHSs.  gimple_call_set_lhs adjusts SSA_NAME_DEF_STMT
of the lhs to the stmt being modified but when
ipa_param_body_adjustments::modify_call_stmt is called the
cloning/inlining process has not yet remapped the stmts operands
to the copy variants but they are still original.

2021-05-11  Richard Biener  <rguenther@suse.de>

PR ipa/100513
* ipa-param-manipulation.c
(ipa_param_body_adjustments::modify_call_stmt): Avoid
altering SSA_NAME_DEF_STMT by adjusting the calls LHS
via gimple_call_lhs_ptr.

3 years agoarm: Avoid emitting bogus CFA adjusts for CMSE nonsecure calls [PR99725]
Alex Coplan [Tue, 11 May 2021 12:11:09 +0000 (13:11 +0100)]
arm: Avoid emitting bogus CFA adjusts for CMSE nonsecure calls [PR99725]

The PR shows us attaching REG_CFA_ADJUST_CFA notes to stack pointer
adjustments emitted in cmse_nonsecure_call_inline_register_clear (when
-march=armv8.1-m.main). However, the stack pointer is not guaranteed to
be the CFA reg. If we're at -O0 or we have -fno-omit-frame-pointer, then
the frame pointer will be used as the CFA reg, and these notes on the sp
adjustments will lead to ICEs in dwarf2out_frame_debug_adjust_cfa.

This patch avoids emitting these notes if the current function has a
frame pointer.

gcc/ChangeLog:

PR target/99725
* config/arm/arm.c (cmse_nonsecure_call_inline_register_clear):
Avoid emitting CFA adjusts on the sp if we have the fp.

gcc/testsuite/ChangeLog:

PR target/99725
* gcc.target/arm/cmse/pr99725.c: New test.

3 years agoaarch64: A couple of mul_laneq tweaks
Richard Sandiford [Tue, 11 May 2021 11:17:33 +0000 (12:17 +0100)]
aarch64: A couple of mul_laneq tweaks

This patch removes the duplication between the mul_laneq<mode>3
and the older mul-lane patterns.  The older patterns were previously
divided into two based on whether the indexed operand had the same mode
as the other operands or whether it had the opposite length from the
other operands (64-bit vs. 128-bit).  However, it seemed easier to
divide them instead based on whether the indexed operand was 64-bit or
128-bit, since that maps directly to the arm_neon.h “q” conventions.

Also, it looks like the older patterns were missing cases for
V8HF<->V4HF combinations, which meant that vmul_laneq_f16 and
vmulq_lane_f16 didn't produce single instructions.

There was a typo in the V2SF entry for VCONQ, but in practice
no patterns were using that entry until now.

The test passes for both endiannesses, but endianness does change
the mapping between regexps and functions.

gcc/
* config/aarch64/iterators.md (VMUL_CHANGE_NLANES): Delete.
(VMULD): New iterator.
(VCOND): Handle V4HF and V8HF.
(VCONQ): Fix entry for V2SF.
* config/aarch64/aarch64-simd.md (mul_lane<mode>3): Use VMULD
instead of VMUL.  Use a 64-bit vector mode for the indexed operand.
(*aarch64_mul3_elt_<vswap_width_name><mode>): Merge with...
(mul_laneq<mode>3): ...this define_insn.  Use VMUL instead of VDQSF.
Use a 128-bit vector mode for the indexed operand.  Use stype for
the scheduling type.

gcc/testsuite/
* gcc.target/aarch64/fmul_lane_1.c: New test.

3 years agoMore maybe_fold_reference TLC
Richard Biener [Tue, 11 May 2021 09:05:10 +0000 (11:05 +0200)]
More maybe_fold_reference TLC

This adjusts maybe_fold_reference to adhere to its desired behavior
of performing constant folding and thus explicitely avoid returning
unfolded reference trees.

2021-05-11  Richard Biener  <rguenther@suse.de>

* gimple-fold.c (maybe_fold_reference): Only return
is_gimple_min_invariant values.

3 years agomiddle-end/100509 - avoid folding constant to aggregate type
Richard Biener [Tue, 11 May 2021 08:58:35 +0000 (10:58 +0200)]
middle-end/100509 - avoid folding constant to aggregate type

When folding a constant initializer looking through aliases to
incompatible types can lead to us trying to fold a constant
to an aggregate type which can't work.  Simply avoid trying
to constant fold non-register typed symbols.

2021-05-11  Richard Biener  <rguenther@suse.de>

PR middle-end/100509
* gimple-fold.c (fold_gimple_assign): Only call
get_symbol_constant_value on register type symbols.

* gcc.dg/pr100509.c: New testcase.

3 years agoarm: Remove duplicate definitions from arm_mve.h (pr100419).
Srinath Parvathaneni [Tue, 11 May 2021 09:43:11 +0000 (10:43 +0100)]
arm: Remove duplicate definitions from arm_mve.h (pr100419).

This patch removes several duplicated intrinsic definitions from
arm_mve.h mentioned in PR100419 and also fixes the wrong arguments
in few of intrinsics polymorphic variants.

gcc/ChangeLog:

2021-05-04  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

PR target/100419
* config/arm/arm_mve.h (__arm_vstrwq_scatter_offset): Fix wrong arguments.
(__arm_vcmpneq): Remove duplicate definition.
(__arm_vstrwq_scatter_offset_p): Likewise.
(__arm_vmaxq_x): Likewise.
(__arm_vmlsdavaq): Likewise.
(__arm_vmlsdavaxq): Likewise.
(__arm_vmlsdavq_p): Likewise.
(__arm_vmlsdavxq_p): Likewise.
(__arm_vrmlaldavhaq): Likewise.
(__arm_vstrbq_p): Likewise.
(__arm_vstrbq_scatter_offset): Likewise.
(__arm_vstrbq_scatter_offset_p): Likewise.
(__arm_vstrdq_scatter_offset): Likewise.
(__arm_vstrdq_scatter_offset_p): Likewise.
(__arm_vstrdq_scatter_shifted_offset): Likewise.
(__arm_vstrdq_scatter_shifted_offset_p): Likewise.

Co-authored-by: Joe Ramsay <joe.ramsay@arm.com>
This page took 0.114587 seconds and 5 git commands to generate.