[Bug gcov-profile/97069] Zero valued #line directive results in excessively large blocks of memory being allocated

2020-10-02 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97069

--- Comment #7 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Martin Liska
:

https://gcc.gnu.org/g:20f699a44492f2f43351d19849873d1112ffc7e0

commit r9-8967-g20f699a44492f2f43351d19849873d1112ffc7e0
Author: Martin Liska 
Date:   Mon Sep 21 16:26:10 2020 +0200

gcov: fix streaming corruption

gcc/ChangeLog:

PR gcov-profile/97069
* profile.c (branch_prob): Line number must be at least 1.

gcc/testsuite/ChangeLog:

PR gcov-profile/97069
* g++.dg/gcov/pr97069.C: New test.

(cherry picked from commit 6b4e8bf88f1172ce8561f57b12fb81063b21a78f)

[Bug gcov-profile/96913] [10 regression] gcov TOPN streaming is incorrect for shared libraries

2020-10-02 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96913

--- Comment #10 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Sergei Trofimovich
:

https://gcc.gnu.org/g:b843d57c57ac92c9cd38eec7289da2f1ea696f18

commit r10-8844-gb843d57c57ac92c9cd38eec7289da2f1ea696f18
Author: Sergei Trofimovich 
Date:   Sun Sep 6 12:13:54 2020 +0100

gcov: fix TOPN streaming from shared libraries

Before the change gcc did not stream correctly TOPN counters
if counters belonged to a non-local shared object.

As a result zero-section optimization generated TOPN sections
in a form not recognizable by '__gcov_merge_topn'.

The problem happens because in a case of multiple shared objects
'__gcov_merge_topn' function is present in address space multiple
times (once per each object).

The fix is to never rely on function address and predicate on TOPN
counter types.

libgcc/ChangeLog:

PR gcov-profile/96913
* libgcov-driver.c (write_one_data): Avoid function pointer
comparison in TOP streaming decision.

(cherry picked from commit 4ecf368f4b4223fb2df4f3887429dfbb48852e38)

[Bug gcov-profile/64636] LTO PGO bootstrap fails on linux-sparc64 in stream_out_histogram_value

2020-10-02 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64636

--- Comment #18 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Martin Liska
:

https://gcc.gnu.org/g:7c55364eaaf5f882e80e8943e702081f9648f582

commit r9-8968-g7c55364eaaf5f882e80e8943e702081f9648f582
Author: Martin Liska 
Date:   Thu Oct 1 21:28:30 2020 +0200

gcov: fix streaming of HIST_TYPE_IOR histogram type.

gcc/ChangeLog:

PR gcov-profile/64636
* value-prof.c (stream_out_histogram_value): Allow negative
values for HIST_TYPE_IOR.

(cherry picked from commit 1921ebcaf6467996aede69e1bbe32400d8a20fe7)

[Bug gcov-profile/97193] [9/10/11 Regression] .gcno files are not written to same directory as the object file

2020-10-02 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97193

--- Comment #5 from CVS Commits  ---
The master branch has been updated by Martin Liska :

https://gcc.gnu.org/g:f8dcbea5d2fb17dca3a7de97f15fc49997222365

commit r11-3614-gf8dcbea5d2fb17dca3a7de97f15fc49997222365
Author: Martin Liska 
Date:   Fri Sep 25 10:53:26 2020 +0200

GCOV: do not mangle .gcno files.

gcc/ChangeLog:

PR gcov-profile/97193
* coverage.c (coverage_init): GCDA note files should not be
mangled and should end in output directory.

[Bug gcov-profile/97193] [9/10 Regression] .gcno files are not written to same directory as the object file

2020-10-02 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97193

--- Comment #7 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Martin Liska
:

https://gcc.gnu.org/g:f97ef0b2dfdad07db3d564b932c7b7373654b7d4

commit r10-8843-gf97ef0b2dfdad07db3d564b932c7b7373654b7d4
Author: Martin Liska 
Date:   Fri Sep 25 10:53:26 2020 +0200

GCOV: do not mangle .gcno files.

gcc/ChangeLog:

PR gcov-profile/97193
* coverage.c (coverage_init): GCDA note files should not be
mangled and should end in output directory.

(cherry picked from commit f8dcbea5d2fb17dca3a7de97f15fc49997222365)

[Bug gcov-profile/97193] [9/10 Regression] .gcno files are not written to same directory as the object file

2020-10-02 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97193

--- Comment #8 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Martin Liska
:

https://gcc.gnu.org/g:991a376015309ac9b413eeb97d94511908498e9a

commit r9-8969-g991a376015309ac9b413eeb97d94511908498e9a
Author: Martin Liska 
Date:   Fri Sep 25 10:53:26 2020 +0200

GCOV: do not mangle .gcno files.

gcc/ChangeLog:

PR gcov-profile/97193
* coverage.c (coverage_init): GCDA note files should not be
mangled and should end in output directory.

(cherry picked from commit f8dcbea5d2fb17dca3a7de97f15fc49997222365)

[Bug bootstrap/97305] options-save.c:8526:26: error: unused variable 'mask'

2020-10-07 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97305

--- Comment #1 from CVS Commits  ---
The master branch has been updated by Jakub Jelinek :

https://gcc.gnu.org/g:e91c34262d2dd06da4b9436744bff89007dee2c9

commit r11-3692-ge91c34262d2dd06da4b9436744bff89007dee2c9
Author: Jakub Jelinek 
Date:   Wed Oct 7 10:52:47 2020 +0200

options: Avoid unused variable mask warning [PR97305]

> options-save.c: In function 'void
cl_target_option_save(cl_target_option*, gcc_options*, gcc_options*)':
> options-save.c:8526:26: error: unused variable 'mask'
[-Werror=unused-variable]
>  8526 |   unsigned HOST_WIDE_INT mask = 0;
>   |  ^~~~
> options-save.c: In function 'void cl_target_option_restore(gcc_options*,
gcc_options*, cl_target_option*)':
> options-save.c:8537:26: error: unused variable 'mask'
[-Werror=unused-variable]
>  8537 |   unsigned HOST_WIDE_INT mask;
>   |  ^~~~

Oops, missed that, sorry.

The following patch should fix that, tested on x86_64-linux make
options-save.c (same file as before) and -> ia64-linux cross make
options-save.o (no warning anymore, just the unwanted declarations gone).

2020-10-07  Jakub Jelinek  

PR bootstrap/97305
* optc-save-gen.awk: Don't declare mask variable if explicit_mask
array is not present.

[Bug ipa/96394] [10/11 Regression] ICE in add_new_edges_to_heap, at ipa-inline.c:1746 (-O3 PGO)

2020-10-07 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96394

--- Comment #21 from CVS Commits  ---
The master branch has been updated by Martin Jambor :

https://gcc.gnu.org/g:e089e43365f7f2a90979e2316aea25d44823f5a3

commit r11-3698-ge089e43365f7f2a90979e2316aea25d44823f5a3
Author: Martin Jambor 
Date:   Wed Oct 7 14:12:49 2020 +0200

ipa-prop: Fix multiple-target speculation resolution

As the FIXME which this patch removes states, the current code does
not work when a call with multiple speculative targets gets resolved
through parameter tracking during inlining - it feeds the inliner an
edge it has already dealt with.  The patch makes the code which should
prevent it aware of the possibility that that speculation can have
more than one target now.

gcc/ChangeLog:

2020-09-30  Martin Jambor  

PR ipa/96394
* ipa-prop.c (update_indirect_edges_after_inlining): Do not add
resolved speculation edges to vector of new direct edges even in
presence of multiple speculative direct edges for a single call.

gcc/testsuite/ChangeLog:

2020-09-30  Martin Jambor  

PR ipa/96394
* gcc.dg/tree-prof/pr96394.c: New test.

[Bug libstdc++/97273] [8/9/10/11 Regression] Strange behaviour of unordered_set when vector is included (i686)

2020-10-07 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97273

--- Comment #4 from CVS Commits  ---
The master branch has been updated by Patrick Palka :

https://gcc.gnu.org/g:592fe221735bdaa375b1834dd49ce125d0b600d8

commit r11-3704-g592fe221735bdaa375b1834dd49ce125d0b600d8
Author: Patrick Palka 
Date:   Wed Oct 7 10:49:00 2020 -0400

c++: Distinguish alignof and __alignof__ in cp_tree_equal [PR97273]

cp_tree_equal currently considers alignof the same as __alignof__, but
these operators are semantically different ever since r8-7957.  In the
testcase below, this causes the second static_assert to fail on targets
where alignof(double) != __alignof__(double) because the specialization
table (which uses cp_tree_equal as its equality predicate) conflates the
two dependent specializations integral_constant<__alignof__(T)> and
integral_constant.

This patch makes cp_tree_equal distinguish between these two operators
by inspecting the ALIGNOF_EXPR_STD_P flag.

gcc/cp/ChangeLog:

PR c++/88115
PR libstdc++/97273
* tree.c (cp_tree_equal) : Return false if
ALIGNOF_EXPR_STD_P differ.

gcc/testsuite/ChangeLog:

PR c++/88115
PR libstdc++/97273
* g++.dg/template/alignof3.C: New test.

[Bug tree-optimization/97307] Optimization for pure vs. const function

2020-10-07 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97307

--- Comment #4 from CVS Commits  ---
The master branch has been updated by Richard Biener :

https://gcc.gnu.org/g:dae673abd37d400408959497e50fe1f3fbef5533

commit r11-3705-gdae673abd37d400408959497e50fe1f3fbef5533
Author: Richard Biener 
Date:   Wed Oct 7 10:42:12 2020 +0200

tree-optimization/97307 - improve sinking of loads

This improves the heuristics finding a sink location for loads that does
not cross any store.

2020-10-07  Richard Biener  

PR tree-optimization/97307
* tree-ssa-sink.c (statement_sink_location): Change heuristic
for not skipping stores to look for virtual definitions
rather than uses.

* gcc.dg/tree-ssa/ssa-sink-17.c: New testcase.
* gcc.dg/vect/pr65947-3.c: XFAIL.

[Bug fortran/47469] Check whether arrayfunc_assign_needs_temporary misses TBP/PPC attributes

2020-10-07 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47469

--- Comment #10 from CVS Commits  ---
The master branch has been updated by Paul Thomas :

https://gcc.gnu.org/g:7c7e841806aecf4187c69fc2ff07813c7be09582

commit r11-3702-g7c7e841806aecf4187c69fc2ff07813c7be09582
Author: Paul Thomas 
Date:   Wed Oct 7 14:59:10 2020 +0100

This patch fixes PR47469 - a trivial bit of tidying up.

2020-07-10  Paul Thomas  

gcc/fortran
PR fortran/47469
* trans-expr.c (arrayfunc_assign_needs_temporary): Tidy detection
of pointer and allocatable functions.

[Bug analyzer/97116] Fix argument numbering in C++ member function calls

2020-10-07 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97116

--- Comment #4 from CVS Commits  ---
The master branch has been updated by David Malcolm :

https://gcc.gnu.org/g:2f7c50b7091c09d665aaf27173aacf34c9904e4c

commit r11-3701-g2f7c50b7091c09d665aaf27173aacf34c9904e4c
Author: David Malcolm 
Date:   Tue Oct 6 17:59:07 2020 -0400

analyzer: handle C++ argument numbers and "this" [PR97116]

gcc/analyzer/ChangeLog:
PR analyzer/97116
* sm-malloc.cc (method_p): New.
(describe_argument_index): New.
(inform_nonnull_attribute): Use describe_argument_index.
(possible_null_arg::describe_final_event): Likewise.
(null_arg::describe_final_event): Likewise.

gcc/testsuite/ChangeLog:
PR analyzer/97116
* g++.dg/analyzer/pr97116.C: New test.

[Bug c++/88115] Incorrect result from alignof in templates, if also using __alignof__.

2020-10-07 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88115

--- Comment #1 from CVS Commits  ---
The master branch has been updated by Patrick Palka :

https://gcc.gnu.org/g:592fe221735bdaa375b1834dd49ce125d0b600d8

commit r11-3704-g592fe221735bdaa375b1834dd49ce125d0b600d8
Author: Patrick Palka 
Date:   Wed Oct 7 10:49:00 2020 -0400

c++: Distinguish alignof and __alignof__ in cp_tree_equal [PR97273]

cp_tree_equal currently considers alignof the same as __alignof__, but
these operators are semantically different ever since r8-7957.  In the
testcase below, this causes the second static_assert to fail on targets
where alignof(double) != __alignof__(double) because the specialization
table (which uses cp_tree_equal as its equality predicate) conflates the
two dependent specializations integral_constant<__alignof__(T)> and
integral_constant.

This patch makes cp_tree_equal distinguish between these two operators
by inspecting the ALIGNOF_EXPR_STD_P flag.

gcc/cp/ChangeLog:

PR c++/88115
PR libstdc++/97273
* tree.c (cp_tree_equal) : Return false if
ALIGNOF_EXPR_STD_P differ.

gcc/testsuite/ChangeLog:

PR c++/88115
PR libstdc++/97273
* g++.dg/template/alignof3.C: New test.

[Bug target/96914] missing MVE intrinsics

2020-10-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96914

--- Comment #9 from CVS Commits  ---
The master branch has been updated by Christophe Lyon :

https://gcc.gnu.org/g:5a448362da6133c3b16ffdb0c795b657af7fa5a4

commit r11-3730-g5a448362da6133c3b16ffdb0c795b657af7fa5a4
Author: Christophe Lyon 
Date:   Mon Oct 5 09:52:59 2020 +

arm: [MVE] Add missing __arm_vcvtnq_u32_f32 intrinsic (PR 96914)

__arm_vcvtnq_u32_f32 was missing from arm_mve.h, although the s32_f32 and
[su]16_f16 versions were present.

This patch adds the missing version and testcase, which are
cut-and-paste from the other versions.

2020-10-08  Christophe Lyon  

gcc/
PR target/96914
* config/arm/arm_mve.h (__arm_vcvtnq_u32_f32): New.

gcc/testsuite/
PR target/96914
* gcc.target/arm/mve/intrinsics/vcvtnq_u32_f32.c: New test.

[Bug other/97309] Improve documentation of -fallow-store-data-races

2020-10-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97309

--- Comment #2 from CVS Commits  ---
The master branch has been updated by Qing Zhao :

https://gcc.gnu.org/g:baf4750feaa6a5fa502ae7bc0b90f31640af6f47

commit r11-3732-gbaf4750feaa6a5fa502ae7bc0b90f31640af6f47
Author: qing zhao 
Date:   Thu Oct 8 17:01:07 2020 +0200

Improve documentation of -fallow-store-data-races

2020-10-08  John Henning  

gcc/

PR other/97309
* doc/invoke.texi: Improve documentation of
-fallow-store-data-races.

[Bug fortran/97272] Wrong answer from MAXLOC with character arg

2020-10-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97272

--- Comment #7 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Harald Anlauf
:

https://gcc.gnu.org/g:d4ec0a15afb7538247206aa9936071544fd860f8

commit r10-8870-gd4ec0a15afb7538247206aa9936071544fd860f8
Author: Harald Anlauf 
Date:   Sun Oct 4 20:24:29 2020 +0200

PR fortran/97272 - Wrong answer from MAXLOC with character arg

The optional KIND argument to the MINLOC/MAXLOC intrinsic must not be
passed to the library function, as the kind conversion of the result
is treated explicitly elsewhere.

gcc/fortran/ChangeLog:

PR fortran/97272
* trans-intrinsic.c (strip_kind_from_actual): Helper function for
removal of KIND argument.
(gfc_conv_intrinsic_minmaxloc): Ignore KIND argument here, as it
is treated elsewhere.

gcc/testsuite/ChangeLog:

PR fortran/97272
* gfortran.dg/pr97272.f90: New test.

(cherry picked from commit 35d2c6b6e8a7448a84abbf967feeb78a29117014)

[Bug target/96313] [AArch64] vqmovun* return types should be unsigned

2020-10-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96313

--- Comment #9 from CVS Commits  ---
The releases/gcc-8 branch has been updated by Kyrylo Tkachov
:

https://gcc.gnu.org/g:7f8115b305f1a1a2ddec4f59bc08a3415359dda6

commit r8-10575-g7f8115b305f1a1a2ddec4f59bc08a3415359dda6
Author: Kyrylo Tkachov 
Date:   Wed Sep 30 12:00:20 2020 +0100

PR target/96313 AArch64: vqmovun* return types should be unsigned

In this PR we have the wrong return type for some intrinsics. It should
be unsigned, but we implement it as signed.
Fix this by adjusting the type qualifiers used when creating the
builtins and fixing the type in the arm_neon.h intrinsic.
With the adjustment in qualifiers we now don't need to cast the result
when returning.

Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/
PR target/96313
* config/aarch64/aarch64-simd-builtins.def (sqmovun): Use UNOPUS
qualifiers.
* config/aarch64/arm_neon.h (vqmovun_s16): Adjust builtin call.
Remove unnecessary result cast.
(vqmovun_s32): Likewise.
(vqmovun_s64): Likewise.
(vqmovunh_s16): Likewise.  Fix return type.
(vqmovuns_s32): Likewise.
(vqmovund_s64): Likewise.

gcc/testsuite/
PR target/96313
* gcc.target/aarch64/pr96313.c: New test.
* gcc.target/aarch64/scalar_intrinsics.c (test_vqmovunh_s16):
Adjust return type.
(test_vqmovuns_s32): Likewise.
(test_vqmovund_s64): Likewise.

(cherry picked from commit 135b043196b5575c690ef1e07bcbb49bf037c3a2)
(cherry picked from commit 7d177b142dcbe841124fe023cb592914d4200e57)
(cherry picked from commit 18d980d94f8d7187ce30bf23ddd365fa54189c36)

[Bug target/97150] [AArch64] 2nd parameter of unsigned Neon scalar shift intrinsics should be signed

2020-10-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97150

--- Comment #7 from CVS Commits  ---
The releases/gcc-8 branch has been updated by Kyrylo Tkachov
:

https://gcc.gnu.org/g:311183d74e4f3fd5a37749cfbb0960e655e715fb

commit r8-10576-g311183d74e4f3fd5a37749cfbb0960e655e715fb
Author: Kyrylo Tkachov 
Date:   Wed Sep 30 12:01:23 2020 +0100

PR target/97150 AArch64: 2nd parameter of unsigned Neon scalar shift
intrinsics should be signed

In this PR the second argument to the intrinsics should be signed but we
use an unsigned one erroneously.
The corresponding builtins are already using the correct types so it's
just a matter of correcting the signatures in arm_neon.h

gcc/
PR target/97150
* config/aarch64/arm_neon.h (vqrshlb_u8): Make second argument
signed.
(vqrshlh_u16): Likewise.
(vqrshls_u32): Likewise.
(vqrshld_u64): Likewise.
(vqshlb_u8): Likewise.
(vqshlh_u16): Likewise.
(vqshls_u32): Likewise.
(vqshld_u64): Likewise.
(vshld_u64): Likewise.

gcc/testsuite/
PR target/97150
* gcc.target/aarch64/pr97150.c: New test.

(cherry picked from commit 2d8fbebdb1eaca8de557ab3052535a8e4b8f8972)
(cherry picked from commit 11af9c329ae528abb8c69ae8fae96a0f3fc6ed87)
(cherry picked from commit d5c6ea22fe6db1ee19a178941a8c7f8ff5d0538c)

[Bug middle-end/95886] suboptimal memcpy with embedded zero bytes

2020-10-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95886

--- Comment #8 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Martin Sebor
:

https://gcc.gnu.org/g:e4c9aac98611f63847ef6c57916808d9a2d7abcb

commit r10-8871-ge4c9aac98611f63847ef6c57916808d9a2d7abcb
Author: Martin Sebor 
Date:   Thu Oct 8 12:35:01 2020 -0600

Correct handling of constant representations containing embedded nuls
(backport from trunk).

Resolves:
PR middle-end/95189 - memcmp being wrongly stripped like strcm
PR middle-end/95886 - suboptimal memcpy with embedded zero bytes

gcc/ChangeLog:

PR middle-end/95189
PR middle-end/95886
* builtins.c (inline_expand_builtin_string_cmp): Rename...
(inline_expand_builtin_bytecmp): ...to this.
(builtin_memcpy_read_str): Don't expect data to be nul-terminated.
(expand_builtin_memory_copy_args): Handle object representations
with embedded nul bytes.
(expand_builtin_memcmp): Same.
(expand_builtin_strcmp): Adjust call to naming change.
(expand_builtin_strncmp): Same.
* expr.c (string_constant): Create empty strings with nonzero size.
* fold-const.c (c_getstr): Rename locals and update comments.
* tree.c (build_string): Accept null pointer argument.
(build_string_literal): Same.
* tree.h (build_string): Provide a default.
(build_string_literal): Same.

gcc/testsuite/ChangeLog:

PR middle-end/95189
PR middle-end/95886
* gcc.dg/memcmp-pr95189.c: New test.
* gcc.dg/strncmp-3.c: New test.
* gcc.target/i386/memcpy-pr95886.c: New test.

[Bug middle-end/95189] [9/10 Regression] memcmp being wrongly stripped like strcmp

2020-10-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95189

--- Comment #22 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Martin Sebor
:

https://gcc.gnu.org/g:e4c9aac98611f63847ef6c57916808d9a2d7abcb

commit r10-8871-ge4c9aac98611f63847ef6c57916808d9a2d7abcb
Author: Martin Sebor 
Date:   Thu Oct 8 12:35:01 2020 -0600

Correct handling of constant representations containing embedded nuls
(backport from trunk).

Resolves:
PR middle-end/95189 - memcmp being wrongly stripped like strcm
PR middle-end/95886 - suboptimal memcpy with embedded zero bytes

gcc/ChangeLog:

PR middle-end/95189
PR middle-end/95886
* builtins.c (inline_expand_builtin_string_cmp): Rename...
(inline_expand_builtin_bytecmp): ...to this.
(builtin_memcpy_read_str): Don't expect data to be nul-terminated.
(expand_builtin_memory_copy_args): Handle object representations
with embedded nul bytes.
(expand_builtin_memcmp): Same.
(expand_builtin_strcmp): Adjust call to naming change.
(expand_builtin_strncmp): Same.
* expr.c (string_constant): Create empty strings with nonzero size.
* fold-const.c (c_getstr): Rename locals and update comments.
* tree.c (build_string): Accept null pointer argument.
(build_string_literal): Same.
* tree.h (build_string): Provide a default.
(build_string_literal): Same.

gcc/testsuite/ChangeLog:

PR middle-end/95189
PR middle-end/95886
* gcc.dg/memcmp-pr95189.c: New test.
* gcc.dg/strncmp-3.c: New test.
* gcc.target/i386/memcpy-pr95886.c: New test.

[Bug target/97150] [AArch64] 2nd parameter of unsigned Neon scalar shift intrinsics should be signed

2020-10-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97150

--- Comment #6 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Kyrylo Tkachov
:

https://gcc.gnu.org/g:d5c6ea22fe6db1ee19a178941a8c7f8ff5d0538c

commit r9-8983-gd5c6ea22fe6db1ee19a178941a8c7f8ff5d0538c
Author: Kyrylo Tkachov 
Date:   Wed Sep 30 12:01:23 2020 +0100

PR target/97150 AArch64: 2nd parameter of unsigned Neon scalar shift
intrinsics should be signed

In this PR the second argument to the intrinsics should be signed but we
use an unsigned one erroneously.
The corresponding builtins are already using the correct types so it's
just a matter of correcting the signatures in arm_neon.h

gcc/
PR target/97150
* config/aarch64/arm_neon.h (vqrshlb_u8): Make second argument
signed.
(vqrshlh_u16): Likewise.
(vqrshls_u32): Likewise.
(vqrshld_u64): Likewise.
(vqshlb_u8): Likewise.
(vqshlh_u16): Likewise.
(vqshls_u32): Likewise.
(vqshld_u64): Likewise.
(vshld_u64): Likewise.

gcc/testsuite/
PR target/97150
* gcc.target/aarch64/pr97150.c: New test.

(cherry picked from commit 2d8fbebdb1eaca8de557ab3052535a8e4b8f8972)
(cherry picked from commit 11af9c329ae528abb8c69ae8fae96a0f3fc6ed87)

[Bug target/96313] [AArch64] vqmovun* return types should be unsigned

2020-10-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96313

--- Comment #8 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Kyrylo Tkachov
:

https://gcc.gnu.org/g:18d980d94f8d7187ce30bf23ddd365fa54189c36

commit r9-8982-g18d980d94f8d7187ce30bf23ddd365fa54189c36
Author: Kyrylo Tkachov 
Date:   Wed Sep 30 12:00:20 2020 +0100

PR target/96313 AArch64: vqmovun* return types should be unsigned

In this PR we have the wrong return type for some intrinsics. It should
be unsigned, but we implement it as signed.
Fix this by adjusting the type qualifiers used when creating the
builtins and fixing the type in the arm_neon.h intrinsic.
With the adjustment in qualifiers we now don't need to cast the result
when returning.

Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/
PR target/96313
* config/aarch64/aarch64-simd-builtins.def (sqmovun): Use UNOPUS
qualifiers.
* config/aarch64/arm_neon.h (vqmovun_s16): Adjust builtin call.
Remove unnecessary result cast.
(vqmovun_s32): Likewise.
(vqmovun_s64): Likewise.
(vqmovunh_s16): Likewise.  Fix return type.
(vqmovuns_s32): Likewise.
(vqmovund_s64): Likewise.

gcc/testsuite/
PR target/96313
* gcc.target/aarch64/pr96313.c: New test.
* gcc.target/aarch64/scalar_intrinsics.c (test_vqmovunh_s16):
Adjust return type.
(test_vqmovuns_s32): Likewise.
(test_vqmovund_s64): Likewise.

(cherry picked from commit 135b043196b5575c690ef1e07bcbb49bf037c3a2)
(cherry picked from commit 7d177b142dcbe841124fe023cb592914d4200e57)

[Bug target/97150] [AArch64] 2nd parameter of unsigned Neon scalar shift intrinsics should be signed

2020-10-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97150

--- Comment #5 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Kyrylo Tkachov
:

https://gcc.gnu.org/g:11af9c329ae528abb8c69ae8fae96a0f3fc6ed87

commit r10-8869-g11af9c329ae528abb8c69ae8fae96a0f3fc6ed87
Author: Kyrylo Tkachov 
Date:   Wed Sep 30 12:01:23 2020 +0100

PR target/97150 AArch64: 2nd parameter of unsigned Neon scalar shift
intrinsics should be signed

In this PR the second argument to the intrinsics should be signed but we
use an unsigned one erroneously.
The corresponding builtins are already using the correct types so it's
just a matter of correcting the signatures in arm_neon.h

gcc/
PR target/97150
* config/aarch64/arm_neon.h (vqrshlb_u8): Make second argument
signed.
(vqrshlh_u16): Likewise.
(vqrshls_u32): Likewise.
(vqrshld_u64): Likewise.
(vqshlb_u8): Likewise.
(vqshlh_u16): Likewise.
(vqshls_u32): Likewise.
(vqshld_u64): Likewise.
(vshld_u64): Likewise.

gcc/testsuite/
PR target/97150
* gcc.target/aarch64/pr97150.c: New test.

(cherry picked from commit 2d8fbebdb1eaca8de557ab3052535a8e4b8f8972)

[Bug libstdc++/82584] div by zero in random distribution

2020-10-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82584

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Jonathan Wakely :

https://gcc.gnu.org/g:b2a96bf9dce41ee777b1669e4a8b4c6df3ff3613

commit r11-3731-gb2a96bf9dce41ee777b1669e4a8b4c6df3ff3613
Author: Jonathan Wakely 
Date:   Thu Oct 8 15:14:58 2020 +0100

libstdc++: Add assertions for preconditions in sampling distributions [PR
82584]

These three distributions all require 0 < S where S is the sum of the
weights. When the sum is zero there's an undefined FP division by zero.
Add assertions to help users diagnose the problem.

libstdc++-v3/ChangeLog:

PR libstdc++/82584
* include/bits/random.tcc
(discrete_distribution::param_type::_M_initialize)
(piecewise_constant_distribution::param_type::_M_initialize)
(piecewise_linear_distribution::param_type::_M_initialize):
Add assertions for positive sums..
* testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error
line.

[Bug tree-optimization/97330] [11 Regression] ice for stmt with wrong VUSE

2020-10-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97330

--- Comment #5 from CVS Commits  ---
The master branch has been updated by Richard Biener :

https://gcc.gnu.org/g:629e0547af33221a925f38757b52a9284148b68a

commit r11-3726-g629e0547af33221a925f38757b52a9284148b68a
Author: Richard Biener 
Date:   Thu Oct 8 13:18:57 2020 +0200

tree-optimization/97330 - fix bad load sinking

This fixes bad placement of sunk loads.

2020-10-08  Richard Biener  

PR tree-optimization/97330
* tree-ssa-sink.c (statement_sink_location): Avoid skipping
PHIs when they dominate the insert location.

* gcc.dg/torture/pr97330-1.c: New testcase.
* gcc.dg/torture/pr97330-2.c: Likewise.

[Bug target/96313] [AArch64] vqmovun* return types should be unsigned

2020-10-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96313

--- Comment #7 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Kyrylo Tkachov
:

https://gcc.gnu.org/g:7d177b142dcbe841124fe023cb592914d4200e57

commit r10-8868-g7d177b142dcbe841124fe023cb592914d4200e57
Author: Kyrylo Tkachov 
Date:   Wed Sep 30 12:00:20 2020 +0100

PR target/96313 AArch64: vqmovun* return types should be unsigned

In this PR we have the wrong return type for some intrinsics. It should
be unsigned, but we implement it as signed.
Fix this by adjusting the type qualifiers used when creating the
builtins and fixing the type in the arm_neon.h intrinsic.
With the adjustment in qualifiers we now don't need to cast the result
when returning.

Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/
PR target/96313
* config/aarch64/aarch64-simd-builtins.def (sqmovun): Use UNOPUS
qualifiers.
* config/aarch64/arm_neon.h (vqmovun_s16): Adjust builtin call.
Remove unnecessary result cast.
(vqmovun_s32): Likewise.
(vqmovun_s64): Likewise.
(vqmovunh_s16): Likewise.  Fix return type.
(vqmovuns_s32): Likewise.
(vqmovund_s64): Likewise.

gcc/testsuite/
PR target/96313
* gcc.target/aarch64/pr96313.c: New test.
* gcc.target/aarch64/scalar_intrinsics.c (test_vqmovunh_s16):
Adjust return type.
(test_vqmovuns_s32): Likewise.
(test_vqmovund_s64): Likewise.

(cherry picked from commit 135b043196b5575c690ef1e07bcbb49bf037c3a2)

[Bug c++/96805] [10/11 Regression] ICE: Segmentation fault in instantiate_template / pop_nested_class()

2020-10-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96805

--- Comment #11 from CVS Commits  ---
The master branch has been updated by Jason Merrill :

https://gcc.gnu.org/g:1c56c143b2011080d8a4516f37f78f647b0ee258

commit r11-3738-g1c56c143b2011080d8a4516f37f78f647b0ee258
Author: Jason Merrill 
Date:   Thu Oct 8 15:43:26 2020 -0400

c++: Fix member alias template in C++17 and up. [PR96805]

Here we're trying to push into a::c in order to instantiate t, but
were building a TYPENAME_TYPE for it because a isn't open yet.  Don't
do that when we know we're trying to enter the scope.

gcc/cp/ChangeLog:

PR c++/96805
PR c++/96199
* pt.c (tsubst_aggr_type): Don't build a TYPENAME_TYPE when
entering_scope.
(tsubst_template_decl): Use tsubst_aggr_type.

gcc/testsuite/ChangeLog:

PR c++/96805
* g++.dg/cpp0x/alias-decl-pr96805.C: New test.

[Bug c++/96199] [10/11 Regression] internal compiler error: in tsubst_copy with CTAD for alias templates

2020-10-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96199

--- Comment #8 from CVS Commits  ---
The master branch has been updated by Jason Merrill :

https://gcc.gnu.org/g:1c56c143b2011080d8a4516f37f78f647b0ee258

commit r11-3738-g1c56c143b2011080d8a4516f37f78f647b0ee258
Author: Jason Merrill 
Date:   Thu Oct 8 15:43:26 2020 -0400

c++: Fix member alias template in C++17 and up. [PR96805]

Here we're trying to push into a::c in order to instantiate t, but
were building a TYPENAME_TYPE for it because a isn't open yet.  Don't
do that when we know we're trying to enter the scope.

gcc/cp/ChangeLog:

PR c++/96805
PR c++/96199
* pt.c (tsubst_aggr_type): Don't build a TYPENAME_TYPE when
entering_scope.
(tsubst_template_decl): Use tsubst_aggr_type.

gcc/testsuite/ChangeLog:

PR c++/96805
* g++.dg/cpp0x/alias-decl-pr96805.C: New test.

[Bug c++/88115] Incorrect result from alignof in templates, if also using __alignof__.

2020-10-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88115

--- Comment #2 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Patrick Palka
:

https://gcc.gnu.org/g:aeb69dda51e93379fce10fb03ec57650fbf73f31

commit r10-8872-gaeb69dda51e93379fce10fb03ec57650fbf73f31
Author: Patrick Palka 
Date:   Thu Oct 8 19:31:57 2020 -0400

c++: Distinguish alignof and __alignof__ in cp_tree_equal [PR97273]

cp_tree_equal currently considers alignof the same as __alignof__, but
these operators are semantically different ever since r8-7957.  In the
testcase below, this causes the second static_assert to fail on targets
where alignof(double) != __alignof__(double) because the specialization
table (which uses cp_tree_equal as its equality predicate) conflates the
two dependent specializations integral_constant<__alignof__(T)> and
integral_constant.

This patch makes cp_tree_equal distinguish between these two operators
by inspecting the ALIGNOF_EXPR_STD_P flag.

gcc/cp/ChangeLog:

PR c++/88115
PR libstdc++/97273
* tree.c (cp_tree_equal) : Return false if
ALIGNOF_EXPR_STD_P differ.

gcc/testsuite/ChangeLog:

PR c++/88115
PR libstdc++/97273
* g++.dg/template/alignof3.C: New test.

(cherry picked from commit 592fe221735bdaa375b1834dd49ce125d0b600d8)

[Bug libstdc++/97273] [8/9/10/11 Regression] Strange behaviour of unordered_set when vector is included (i686)

2020-10-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97273

--- Comment #5 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Patrick Palka
:

https://gcc.gnu.org/g:aeb69dda51e93379fce10fb03ec57650fbf73f31

commit r10-8872-gaeb69dda51e93379fce10fb03ec57650fbf73f31
Author: Patrick Palka 
Date:   Thu Oct 8 19:31:57 2020 -0400

c++: Distinguish alignof and __alignof__ in cp_tree_equal [PR97273]

cp_tree_equal currently considers alignof the same as __alignof__, but
these operators are semantically different ever since r8-7957.  In the
testcase below, this causes the second static_assert to fail on targets
where alignof(double) != __alignof__(double) because the specialization
table (which uses cp_tree_equal as its equality predicate) conflates the
two dependent specializations integral_constant<__alignof__(T)> and
integral_constant.

This patch makes cp_tree_equal distinguish between these two operators
by inspecting the ALIGNOF_EXPR_STD_P flag.

gcc/cp/ChangeLog:

PR c++/88115
PR libstdc++/97273
* tree.c (cp_tree_equal) : Return false if
ALIGNOF_EXPR_STD_P differ.

gcc/testsuite/ChangeLog:

PR c++/88115
PR libstdc++/97273
* g++.dg/template/alignof3.C: New test.

(cherry picked from commit 592fe221735bdaa375b1834dd49ce125d0b600d8)

[Bug fortran/97272] Wrong answer from MAXLOC with character arg

2020-10-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97272

--- Comment #8 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Harald Anlauf
:

https://gcc.gnu.org/g:83967508034454425dfce7fe0ea33a153c34e7cb

commit r9-8985-g83967508034454425dfce7fe0ea33a153c34e7cb
Author: Harald Anlauf 
Date:   Sun Oct 4 20:24:29 2020 +0200

PR fortran/97272 - Wrong answer from MAXLOC with character arg

The optional KIND argument to the MINLOC/MAXLOC intrinsic must not be
passed to the library function, as the kind conversion of the result
is treated explicitly elsewhere.

gcc/fortran/ChangeLog:

PR fortran/97272
* trans-intrinsic.c (strip_kind_from_actual): Helper function for
removal of KIND argument.
(gfc_conv_intrinsic_minmaxloc): Ignore KIND argument here, as it
is treated elsewhere.

gcc/testsuite/ChangeLog:

PR fortran/97272
* gfortran.dg/pr97272.f90: New test.

(cherry picked from commit 35d2c6b6e8a7448a84abbf967feeb78a29117014)

[Bug libstdc++/95788] std::ranges::construct_at's placement new not intercepted

2020-10-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95788

--- Comment #1 from CVS Commits  ---
The master branch has been updated by Patrick Palka :

https://gcc.gnu.org/g:9158a4d2a6cd58d6bb591d5ce64e766b399e4aef

commit r11-3739-g9158a4d2a6cd58d6bb591d5ce64e766b399e4aef
Author: Patrick Palka 
Date:   Thu Oct 8 18:10:05 2020 -0400

libstdc++: Make ranges::construct_at constexpr-friendly [PR95788]

This rewrites ranges::construct_at in terms of std::construct_at so
that we can piggyback on the compiler's existing support for
intercepting placement new within std::construct_at during constexpr
evaluation, instead of having to additionally teach the compiler about
ranges::construct_at.

While we're making changes to ranges::construct_at, this patch also
declares it conditionally noexcept and qualifies the calls to declval in
its requires-clause.

libstdc++-v3/ChangeLog:

PR libstdc++/95788
* include/bits/ranges_uninitialized.h:
(__construct_at_fn::operator()): Rewrite in terms of
std::construct_at.  Declare it conditionally noexcept.  Qualify
calls to declval in its requires-clause.
* testsuite/20_util/specialized_algorithms/construct_at/95788.cc:
New test.

[Bug tree-optimization/97334] inefficient vectorization of gcc.dg/vect/bb-slp-pr65935.c

2020-10-09 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97334

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Richard Biener :

https://gcc.gnu.org/g:16760e5bf7028dfa36b39af305d05cdf2c15b3a9

commit r11-3750-g16760e5bf7028dfa36b39af305d05cdf2c15b3a9
Author: Richard Biener 
Date:   Fri Oct 9 12:24:46 2020 +0200

tree-optimization/97334 - improve BB SLP discovery

We're running into a multiplication with one unvectorizable
operand we expect to build from scalars but SLP discovery
fatally fails the build of both since one stmt is commutated:

  _60 = _58 * _59;
  _63 = _59 * _62;
  _66 = _59 * _65;
...

where _59 is the "bad" operand.  The following patch makes the
case work where the first stmt has a good operand by not fatally
failing the SLP build for the operand but communicating upwards
how to commutate.

2020-10-09  Richard Biener  

PR tree-optimization/97334
* tree-vect-slp.c (vect_build_slp_tree_1): Do not fatally
fail lanes other than zero when BB vectorizing.

* gcc.dg/vect/bb-slp-pr65935.c: Amend.

[Bug target/97348] [nvptx] Make -misa=sm_35 the default

2020-10-09 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97348

--- Comment #4 from CVS Commits  ---
The master branch has been updated by Tom de Vries :

https://gcc.gnu.org/g:383400a6078d75bbfa1216c9af2c37f7e88740c9

commit r11-3752-g383400a6078d75bbfa1216c9af2c37f7e88740c9
Author: Tom de Vries 
Date:   Fri Oct 9 11:36:10 2020 +0200

[nvptx] Set -misa=sm_35 by default

The nvptx-as assembler verifies the ptx code using ptxas, if there's any
in the PATH.

The default in the nvptx port for -misa=sm_xx is sm_30, but the ptxas of
the
latest cuda release (11.1) no longer supports sm_30.

Consequently we cannot build gcc against that release (although we should
still be able to build without any cuda release).

Fix this by setting -misa=sm_35 by default.

Tested check-gcc on nvptx.

Tested libgomp on x86_64-linux with nvpx accelerator.

Both build again cuda 9.1.

gcc/ChangeLog:

2020-10-09  Tom de Vries  

PR target/97348
* config/nvptx/nvptx.h (ASM_SPEC): Also pass -m to nvptx-as if
default is used.
* config/nvptx/nvptx.opt (misa): Init with PTX_ISA_SM35.

[Bug middle-end/97391] [11 Regression] bogus -Warray-bounds accessing a multidimensional array parameter

2020-10-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97391

--- Comment #2 from CVS Commits  ---
The master branch has been updated by Martin Sebor :

https://gcc.gnu.org/g:14d83c6f584c321989b43526dc9437de4381aa47

commit r11-3901-g14d83c6f584c321989b43526dc9437de4381aa47
Author: Martin Sebor 
Date:   Wed Oct 14 15:19:39 2020 -0600

PR middle-end/97391 - bogus -Warray-bounds accessing a multidimensional
array parameter

gcc/ChangeLog:

PR middle-end/97391
* builtins.c (gimple_parm_array_size): Peel off one less layer
of array types.

gcc/testsuite/ChangeLog:

PR middle-end/97391
* gcc.dg/Warray-bounds-68.c: New test.

[Bug c++/97358] [8/9/10/11 Regression] ICE while building firefox since r8-2720

2020-10-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97358

--- Comment #12 from CVS Commits  ---
The master branch has been updated by Jason Merrill :

https://gcc.gnu.org/g:270c5a982ccb4ef83bd9ad37d39cf47461acb55a

commit r11-3893-g270c5a982ccb4ef83bd9ad37d39cf47461acb55a
Author: Jason Merrill 
Date:   Wed Oct 14 14:55:04 2020 -0400

c++: Diagnose bogus variadic lambda. [PR97358]

If the lambda has a capture pack, it cannot be used unexpanded within the
body of the lambda.  If you want to expand the pack across multiple
lambdas,
don't capture the whole pack.

gcc/cp/ChangeLog:

PR c++/97358
* pt.c (check_for_bare_parameter_packs): Diagnose use of
capture pack.

gcc/testsuite/ChangeLog:

PR c++/97358
* g++.dg/cpp0x/lambda/lambda-variadic11.C: New test.

[Bug analyzer/97394] Incorrect analyzer output for setjmp

2020-10-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97394

--- Comment #7 from CVS Commits  ---
The master branch has been updated by David Malcolm :

https://gcc.gnu.org/g:974e3975c5bd14ee8817f892532d1e55492227df

commit r11-3894-g974e3975c5bd14ee8817f892532d1e55492227df
Author: David Malcolm 
Date:   Tue Oct 13 15:56:45 2020 -0400

analyzer: don't use  in tests [PR97394]

PR analyzer/97394 reports issues with analyzer setjmp results
when testing against MUSL.  This patch fixes up gcc.dg/analyzer
so that it doesn't use .

gcc/testsuite/ChangeLog:
PR analyzer/97394
* gcc.dg/analyzer/setjmp-pr93378.c: Use test-setjmp.h rather than
.
* gcc.dg/analyzer/sigsetjmp-5.c: Likewise.
* gcc.dg/analyzer/sigsetjmp-6.c: Likewise.
* gcc.dg/analyzer/test-setjmp.h: Don't include .
Provide decls of jmp_buf, sigjmp_buf, setjmp, sigsetjmp,
longjmp, and siglongjmp.

[Bug analyzer/93723] ICEs building ada with -fanalyzer

2020-10-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93723

--- Comment #6 from CVS Commits  ---
The master branch has been updated by David Malcolm :

https://gcc.gnu.org/g:12b267cc606a48a2fef809189c35573c4a51d3a5

commit r11-3895-g12b267cc606a48a2fef809189c35573c4a51d3a5
Author: David Malcolm 
Date:   Tue Oct 13 17:11:17 2020 -0400

analyzer: fix build with ada [PR93723]

gcc/analyzer/ChangeLog:
PR analyzer/93723
* store.cc (binding_map::apply_ctor_to_region): Remove redundant
assertion.

[Bug c/97413] [11 Regression] gcc-11 fails to typecheck VLA declarations on emacs-27.1: error: wrong number of arguments specified for 'access' attribute

2020-10-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97413

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Martin Sebor :

https://gcc.gnu.org/g:34efa5c2a84a8c7c7beb855dec24a321eebcbd6b

commit r11-3900-g34efa5c2a84a8c7c7beb855dec24a321eebcbd6b
Author: Martin Sebor 
Date:   Wed Oct 14 15:18:19 2020 -0600

PR c/97413 - bogus error on function declaration with many VLA arguments

gcc/ChangeLog:

PR c/97413
* attribs.c (init_attr_rdwr_indices): Unwrap extra list layer.

gcc/c-family/ChangeLog:

PR c/97413
* c-attribs.c (build_attr_access_from_parms): Wrap chain of VLA
bounds in an extra list.

gcc/testsuite/ChangeLog:

PR c/97413
* gcc.dg/Wvla-parameter-8.c: New test.

[Bug analyzer/93388] ensure -fanalyzer works with our C code

2020-10-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93388

--- Comment #23 from CVS Commits  ---
The master branch has been updated by David Malcolm :

https://gcc.gnu.org/g:61a43de58cb6de7212a622060500ad0a0fd94fae

commit r11-3896-g61a43de58cb6de7212a622060500ad0a0fd94fae
Author: David Malcolm 
Date:   Tue Oct 13 18:49:11 2020 -0400

analyzer: fix ICE on globals with unknown size [PR93388]

This patch fixes an ICE seen when attempting to build various existing
tests in our testsuite with -fanalyzer, including
gcc.c-torture/compile/980816-1.c.

gcc/analyzer/ChangeLog:
PR analyzer/93388
* region-model.cc (region_model::get_initial_value_for_global):
Fall back to returning an initial_svalue if
decl_region::get_svalue_for_initializer fails.
* region.cc (decl_region::get_svalue_for_initializer): Don't
attempt to create a compound_svalue if the region has an unknown
size.

gcc/testsuite/ChangeLog:
PR analyzer/93388
* gcc.dg/analyzer/data-model-21.c: New test.

[Bug tree-optimization/97386] [8/9/10/11 Regression] wrong code with __builtin_bswap16() of rotated 64bit value

2020-10-13 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97386

--- Comment #4 from CVS Commits  ---
The master branch has been updated by Jakub Jelinek :

https://gcc.gnu.org/g:f76949cee9560d04d5417481dbcda5ca089c9ebc

commit r11-3855-gf76949cee9560d04d5417481dbcda5ca089c9ebc
Author: Jakub Jelinek 
Date:   Tue Oct 13 19:13:26 2020 +0200

combine: Fix up simplify_shift_const_1 for nested ROTATEs [PR97386]

The following testcases are miscompiled (the first one since my
improvements
to rotate discovery on GIMPLE, the other one for many years) because
combiner optimizes nested ROTATEs with narrowing SUBREG in between (i.e.
the outer rotate is performed in shorter precision than the inner one) to
just one ROTATE of the rotated constant.  While that (under certain
conditions) can work for shifts, it can't work for rotates where we can
only
do that with rotates of the same precision.

2020-10-13  Jakub Jelinek  

PR rtl-optimization/97386
* combine.c (simplify_shift_const_1): Don't optimize nested ROTATEs
if
they have different modes.

* gcc.c-torture/execute/pr97386-1.c: New test.
* gcc.c-torture/execute/pr97386-2.c: New test.

[Bug tree-optimization/97379] [11 Regression] Invalid read of size 8 at outgoing_range::calc_switch_ranges(gswitch*) (gimple-range-edge.cc:140) since r11-3685-gfcae5121154d1c33

2020-10-13 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97379

--- Comment #4 from CVS Commits  ---
The master branch has been updated by Aldy Hernandez :

https://gcc.gnu.org/g:739526a19deaeac19c2429cc7567052834d3098e

commit r11-3852-g739526a19deaeac19c2429cc7567052834d3098e
Author: Aldy Hernandez 
Date:   Tue Oct 13 04:40:20 2020 -0400

Do not save hash slots across calls to hash_table::get_or_insert.

There's a read of a freed block while accessing the default_slot in
calc_switch_ranges.

  default_slot->intersect (def_range);

It seems the default_slot got swiped from under us, and the valgrind
dump indicates the free came from the get_or_insert in the same
function:

  irange * = m_edge_table->get_or_insert (e, );

So it looks like the get_or_insert is actually freeing the value of
the previously allocated default_slot.  Looking down the chain
from get_or_insert, we see it calls hash_table<>::expand, which
actually does a free while doing a resize of sorts:

  if (!m_ggc)
Allocator  ::data_free (oentries);
  else
ggc_free (oentries);

This patch avoids keeping a pointer to the default_slot across multiple
calls to get_or_insert in the loop.

gcc/ChangeLog:

PR tree-optimization/97379
* gimple-range-edge.cc (outgoing_range::calc_switch_ranges): Do
not save hash slot across calls to hash_table<>::get_or_insert.

[Bug c++/96229] Invalid specialization accepted when also constrained in base template template parameter

2020-10-13 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96229

--- Comment #3 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Patrick Palka
:

https://gcc.gnu.org/g:1e8cd9628dcaedbb96bd014e0865e1415484e84b

commit r10-8887-g1e8cd9628dcaedbb96bd014e0865e1415484e84b
Author: Patrick Palka 
Date:   Thu Oct 8 00:05:36 2020 -0400

c++: Set the constraints of a class type sooner [PR96229]

In the testcase below, during processing (at parse time) of Y's base
class X, convert_template_argument calls is_compatible_template_arg
to check if the template argument Y is no more constrained than the
parameter P.  But at this point we haven't yet set Y's constraints, so
get_normalized_constraints_from_decl yields NULL_TREE as the normal form
and caches this result into the normalized_map.

We set Y's constraints later in cp_parser_class_specifier_1 but the
stale normal form in the normalized_map remains.  This ultimately causes
us to miss the constraint failure for Y because according to the
cached normal form, Y is not constrained.

This patch fixes this issue by moving up the call to
associate_classtype_constraints so that we set constraints before we
start processing a class's bases.

gcc/cp/ChangeLog:

PR c++/96229
* parser.c (cp_parser_class_specifier_1): Move call to
associate_classtype_constraints from here to ...
(cp_parser_class_head): ... here.
* pt.c (is_compatible_template_arg): Correct documentation to
say "argument is _no_ more constrained than the parameter".

gcc/testsuite/ChangeLog:

PR c++/96229
* g++.dg/cpp2a/concepts-class2.C: New test.

(cherry picked from commit 6b1b5c255f859e75a2d74ae58a011e846d87a277)

[Bug libstdc++/95788] std::ranges::construct_at's placement new not intercepted

2020-10-13 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95788

--- Comment #5 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Patrick Palka
:

https://gcc.gnu.org/g:5b814b6b618c8b3f0ff71717b4929a6fdf950714

commit r10--g5b814b6b618c8b3f0ff71717b4929a6fdf950714
Author: Patrick Palka 
Date:   Thu Oct 8 18:10:05 2020 -0400

libstdc++: Make ranges::construct_at constexpr-friendly [PR95788]

This rewrites ranges::construct_at in terms of std::construct_at so
that we can piggyback on the compiler's existing support for
intercepting placement new within std::construct_at during constexpr
evaluation, instead of having to additionally teach the compiler about
ranges::construct_at.

While we're making changes to ranges::construct_at, this patch also
declares it conditionally noexcept and qualifies the calls to declval in
its requires-clause.

libstdc++-v3/ChangeLog:

PR libstdc++/95788
* include/bits/ranges_uninitialized.h:
(__construct_at_fn::operator()): Rewrite in terms of
std::construct_at.  Declare it conditionally noexcept.  Qualify
calls to declval in its requires-clause.
* testsuite/20_util/specialized_algorithms/construct_at/95788.cc:
New test.

(cherry picked from commit 9158a4d2a6cd58d6bb591d5ce64e766b399e4aef)

[Bug ipa/97295] ICE on firefox built with lto+pgo: dist/include/mozilla/Casting.h:64:1: internal compiler error: in to_frequency, at profile-count.c:273

2020-10-15 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97295

--- Comment #9 from CVS Commits  ---
The master branch has been updated by Martin Liska :

https://gcc.gnu.org/g:508e2d88a4c512e8b8685cf5ba201ad48e6bb58d

commit r11-3908-g508e2d88a4c512e8b8685cf5ba201ad48e6bb58d
Author: Martin Liska 
Date:   Tue Oct 13 16:44:47 2020 +0200

IPA: fix profile handling in IRA

gcc/ChangeLog:

PR ipa/97295
* profile-count.c (profile_count::to_frequency): Move part of
gcc_assert to STATIC_ASSERT.
* regs.h (REG_FREQ_FROM_BB): Do not use count.to_frequency for
a function that does not have count_max initialized.

[Bug ipa/97295] ICE on firefox built with lto+pgo: dist/include/mozilla/Casting.h:64:1: internal compiler error: in to_frequency, at profile-count.c:273

2020-10-15 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97295

--- Comment #12 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Martin Liska
:

https://gcc.gnu.org/g:12c9413228d2955126ff5c45194f8aacf1aa81f6

commit r9-8996-g12c9413228d2955126ff5c45194f8aacf1aa81f6
Author: Martin Liska 
Date:   Tue Oct 13 16:44:47 2020 +0200

IPA: fix profile handling in IRA

gcc/ChangeLog:

PR ipa/97295
* profile-count.c (profile_count::to_frequency): Move part of
gcc_assert to STATIC_ASSERT.
* regs.h (REG_FREQ_FROM_BB): Do not use count.to_frequency for
a function that does not have count_max initialized.

(cherry picked from commit 508e2d88a4c512e8b8685cf5ba201ad48e6bb58d)

[Bug ipa/97295] ICE on firefox built with lto+pgo: dist/include/mozilla/Casting.h:64:1: internal compiler error: in to_frequency, at profile-count.c:273

2020-10-15 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97295

--- Comment #11 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Martin Liska
:

https://gcc.gnu.org/g:be8b62c99cf8baea6ee8163af8e85aa0e8634222

commit r10-8891-gbe8b62c99cf8baea6ee8163af8e85aa0e8634222
Author: Martin Liska 
Date:   Tue Oct 13 16:44:47 2020 +0200

IPA: fix profile handling in IRA

gcc/ChangeLog:

PR ipa/97295
* profile-count.c (profile_count::to_frequency): Move part of
gcc_assert to STATIC_ASSERT.
* regs.h (REG_FREQ_FROM_BB): Do not use count.to_frequency for
a function that does not have count_max initialized.

(cherry picked from commit 508e2d88a4c512e8b8685cf5ba201ad48e6bb58d)

[Bug target/97436] [nvptx] Remove -m32 support

2020-10-15 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97436

--- Comment #2 from CVS Commits  ---
The master branch has been updated by Tom de Vries :

https://gcc.gnu.org/g:34af17c0164f3138df094b144c7f74c2d1805444

commit r11-3953-g34af17c0164f3138df094b144c7f74c2d1805444
Author: Tom de Vries 
Date:   Thu Oct 15 11:37:43 2020 +0200

[nvptx] Remove -m32

The nvptx port has an -m32 option, but it's not clear whether this
was ever build/tested/used.

Don't expose to user anymore.  Tested on nvptx.

gcc/ChangeLog:

2020-10-15  Tom de Vries  

PR target/97436
* config/nvptx/nvptx.opt (m32): Comment out.
* doc/invoke.texi (NVPTX options): Remove -m32.

gcc/testsuite/ChangeLog:

2020-10-15  Tom de Vries  

PR target/97436
* gcc.target/nvptx/atomic_fetch-3.c: Remove.

[Bug bootstrap/97350] [11 Regression] Ada bootstrap fails with: self_referential_size, at stor-layout.c:172

2020-10-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97350

--- Comment #14 from CVS Commits  ---
The master branch has been updated by Jan Hubicka :

https://gcc.gnu.org/g:87d75a11a5cb93668ae0bf6d97030e01b2eae3f2

commit r11-3864-g87d75a11a5cb93668ae0bf6d97030e01b2eae3f2
Author: Jan Hubicka 
Date:   Wed Oct 14 10:54:00 2020 +0200

Fix SCC discovery in ipa-modref

this patch fixes SCC discovery in ipa-modref which is causing
misoptimization
of gnat bootstrapped with LTO, PGO and -O3.

I also improved debug info and spotted wrong parameter to ignore_stores_p
(which is probably quite harmless since we only inline matching functions,
but
it is better to be consistent).

PR bootstrap/97350
* ipa-modref.c (ignore_edge): Do not ignore inlined edes.
(ipa_merge_modref_summary_after_inlining): Improve debug output and
fix parameter of ignore_stores_p.

[Bug c++/95844] [11 Regression] ICE: Segmentation fault (in cp_warn_deprecated_use)

2020-10-15 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95844

--- Comment #2 from CVS Commits  ---
The master branch has been updated by Jason Merrill :

https://gcc.gnu.org/g:f3ee94724686b82556c07b4d33821ae973eb9aba

commit r11-3958-gf3ee94724686b82556c07b4d33821ae973eb9aba
Author: Jason Merrill 
Date:   Thu Oct 15 12:54:16 2020 -0400

c++: Fix [[deprecated]] and implicit operator==. [PR97358]

Trying to diagnose the problem with an implicit copy function breaks if the
function isn't actually a copy function.

gcc/cp/ChangeLog:

PR c++/95844
* decl.c (copy_fn_p): Return false for a function that is neither a
constructor nor an assignment operator.
(move_signature_fn_p): Likewise.

gcc/testsuite/ChangeLog:

PR c++/95844
* g++.dg/cpp2a/spaceship-eq10.C: New test.

[Bug target/96759] [10/11 Regression] ICE in extract_insn, at recog.c:2294

2020-10-13 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96759

--- Comment #4 from CVS Commits  ---
The master branch has been updated by Kito Cheng :

https://gcc.gnu.org/g:78fbe731a8822e819c4ca0e6d6f777c7a2f36bad

commit r11-3860-g78fbe731a8822e819c4ca0e6d6f777c7a2f36bad
Author: Kito Cheng 
Date:   Wed Sep 2 14:26:15 2020 +0800

PR target/96759 - Handle global variable assignment from misaligned
structure/PARALLEL return values.

In g:70cdb21e579191fe9f0f1d45e328908e59c0179e, DECL/global variable has
handled
misaligned stores, but it didn't handle PARALLEL values, and I refer the
other part of this function, I found the PARALLEL need handled by
emit_group_* functions, so I add a check, and using emit_group_store if
storing a PARALLEL value, also checked this change didn't break the
testcase(gcc.target/arm/unaligned-argument-3.c) added by the orginal
changes.

For riscv64 target, struct S {int a; double b;} will pack into a parallel
value to return and it has TImode when misaligned access is supported,
however TImode required 16-byte align, but it only 8-byte align, so it go
to
the misaligned stores handling, then it will try to generate move
instruction from a PARALLEL value.

Tested on following target without introduced new reguression:
  - riscv32/riscv64 elf
  - x86_64-linux
  - arm-eabi

v2 changes:
  - Use maybe_emit_group_store instead of emit_group_store.
  - Remove push_temp_slots/pop_temp_slots, emit_group_store only require
stack temp slot when dst is CONCAT or PARALLEL, however
maybe_emit_group_store will always use REG for dst if needed.

gcc/ChangeLog:

PR target/96759
* expr.c (expand_assignment): Handle misaligned stores with
PARALLEL
value.

gcc/testsuite/ChangeLog:

PR target/96759
* g++.target/riscv/pr96759.C: New.
* gcc.target/riscv/pr96759.c: New.

[Bug c++/97197] With -O2, Incorrect -Werror=maybe-uninitialized thrown, leads to 'target_mem_ref' and 'dump_expr' in message

2020-10-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97197

--- Comment #5 from CVS Commits  ---
The master branch has been updated by Jakub Jelinek :

https://gcc.gnu.org/g:ac1c65ad1a16d83ec63674efa07c00b062562f15

commit r11-3659-gac1c65ad1a16d83ec63674efa07c00b062562f15
Author: Jakub Jelinek 
Date:   Mon Oct 5 18:33:17 2020 +0200

support TARGET_MEM_REF in C/C++ error pretty-printing [PR97197]

> See my comment above for Martins attempts to improve things.  I don't
> really want to try decide what to do with those late diagnostic IL
> printing but my commit was blamed for showing target-mem-ref unsupported.
>
> I don't have much time to spend to think what to best print and what not,
> but yes, printing only the MEM_REF part is certainly imprecise.

Here is an updated version of the patch that prints TARGET_MEM_REF the way
it should be printed - as C representation of what it actually means.
Of course it would be better to have the original expressions, but with the
late diagnostics we no longer have them.

2020-10-05  Richard Biener  
Jakub Jelinek  

PR c++/97197
gcc/cp/
* error.c (dump_expr): Handle TARGET_MEM_REF.
gcc/c-family/
* c-pretty-print.c: Include langhooks.h.
(c_pretty_printer::postfix_expression): Handle TARGET_MEM_REF as
expression.
(c_pretty_printer::expression): Handle TARGET_MEM_REF as
unary_expression.
(c_pretty_printer::unary_expression): Handle TARGET_MEM_REF.

[Bug target/97302] FreeBSD build fails with contrib/download_prerequisites with missing gmp.h

2020-10-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97302

--- Comment #4 from CVS Commits  ---
The master branch has been updated by Tobias Burnus :

https://gcc.gnu.org/g:c0d0a722da8583f74a0c192041be2f379cf487c1

commit r11-3675-gc0d0a722da8583f74a0c192041be2f379cf487c1
Author: Tobias Burnus 
Date:   Tue Oct 6 11:49:34 2020 +0200

configure: Fix in-tree building of GMP on BSD [PR97302]

ChangeLog:
PR target/97302
* configure.ac: Only set with_gmp to /usr/local
if not building in tree.
* configure: Regenerate.

[Bug target/96456] [10/11 Regression] ICE in expand_insn, at optabs.c:7511 on s390x-linux-gnu

2020-10-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96456

--- Comment #3 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Andreas Krebbel
:

https://gcc.gnu.org/g:537f9f4e5b12f4ef5ca363f89466c0470f3482bf

commit r10-8856-g537f9f4e5b12f4ef5ca363f89466c0470f3482bf
Author: Andreas Krebbel 
Date:   Wed Aug 12 08:02:34 2020 +0200

IBM Z: Fix PR96456

The testcase failed because our backend refuses to generate vector
compare instructions for signaling operators with -fno-trapping-math
-fno-finite-math-only.

gcc/ChangeLog:

PR target/96456
* config/s390/s390.h (TARGET_NONSIGNALING_VECTOR_COMPARE_OK): New
macro.
* config/s390/vector.md (vcond_comparison_operator): Use new macro
for the check.

gcc/testsuite/ChangeLog:

PR target/96456
* gcc.target/s390/pr96456.c: New test.

(cherry picked from commit 1d17c38ac1d1d916abbce14e6b2e0d61517c6e9b)

[Bug target/97302] FreeBSD build fails with contrib/download_prerequisites with missing gmp.h

2020-10-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97302

--- Comment #5 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Tobias Burnus
:

https://gcc.gnu.org/g:7cacf5a576675109f3b081cbd436d1fbadad776d

commit r10-8858-g7cacf5a576675109f3b081cbd436d1fbadad776d
Author: Tobias Burnus 
Date:   Tue Oct 6 11:49:34 2020 +0200

configure: Fix in-tree building of GMP on BSD [PR97302]

ChangeLog:
PR target/97302
* configure.ac: Only set with_gmp to /usr/local
if not building in tree.
* configure: Regenerate.
(cherry picked from commit c0d0a722da8583f74a0c192041be2f379cf487c1)

[Bug rtl-optimization/97282] division done twice for modulo and divsion for 128-bit integers

2020-10-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97282

--- Comment #4 from CVS Commits  ---
The master branch has been updated by Jakub Jelinek :

https://gcc.gnu.org/g:bf510679bb3f9bfd6019666065016bb26a5b5466

commit r11-3671-gbf510679bb3f9bfd6019666065016bb26a5b5466
Author: Jakub Jelinek 
Date:   Tue Oct 6 10:32:22 2020 +0200

divmod: Match and expand DIVMOD even in some cases of constant divisor
[PR97282]

As written in the comment, tree-ssa-math-opts.c wouldn't create a DIVMOD
ifn call for division + modulo by constant for the fear that during
expansion we could generate better code for those cases.
If the divisoris a power of two, that is certainly the case always,
but otherwise expand_divmod can punt in many cases, e.g. if the division
type's precision is above HOST_BITS_PER_WIDE_INT, we don't even call
choose_multiplier, because it works on HOST_WIDE_INTs (true, something
we should fix eventually now that we have wide_ints), or if pre/post shift
is larger than BITS_PER_WORD.

So, the following patch recognizes DIVMOD with constant last argument even
when it is unclear if expand_divmod will be able to optimize it, and then
during DIVMOD expansion if the divisor is constant attempts to expand it as
division + modulo and if they actually don't contain any libcalls or
division/modulo, they are kept as is, otherwise that sequence is thrown
away
and divmod optab or libcall is used.

2020-10-06  Jakub Jelinek  

PR rtl-optimization/97282
* tree-ssa-math-opts.c (divmod_candidate_p): Don't return false for
constant op2 if it is not a power of two and the type has precision
larger than HOST_BITS_PER_WIDE_INT or BITS_PER_WORD.
* internal-fn.c (contains_call_div_mod): New function.
(expand_DIVMOD): If last argument is a constant, try to expand it
as
TRUNC_DIV_EXPR followed by TRUNC_MOD_EXPR, but if the sequence
contains any calls or {,U}{DIV,MOD} rtxes, throw it away and use
divmod optab or divmod libfunc.

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

[Bug middle-end/97289] [11 Regression] ICE in get, at cgraph.h:446

2020-10-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97289

--- Comment #2 from CVS Commits  ---
The master branch has been updated by Jakub Jelinek :

https://gcc.gnu.org/g:44e20dce597328f3cb00e997fa90b95a2b710d4c

commit r11-3669-g44e20dce597328f3cb00e997fa90b95a2b710d4c
Author: Jakub Jelinek 
Date:   Tue Oct 6 09:25:00 2020 +0200

openmp: Fix ICE in omp_discover_declare_target_tgt_fn_r

This ICEs because node->alias_target is (not yet) a FUNCTION_DECL, but
IDENTIFIER_NODE.

I guess we should retry the discovery before LTO streaming out, the reason
to do it this early is that it can affect the gimplification and omp
lowering.

2020-10-06  Jakub Jelinek  

PR middle-end/97289
* omp-offload.c (omp_discover_declare_target_tgt_fn_r): Only follow
node->alias_target if it is a FUNCTION_DECL.

* c-c++-common/gomp/pr97289.c: New test.

[Bug target/97302] FreeBSD build fails with contrib/download_prerequisites with missing gmp.h

2020-10-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97302

--- Comment #6 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Tobias Burnus
:

https://gcc.gnu.org/g:96b32c86f507f5391512a9cb5ec536e604472ea2

commit r9-8977-g96b32c86f507f5391512a9cb5ec536e604472ea2
Author: Tobias Burnus 
Date:   Tue Oct 6 11:49:34 2020 +0200

configure: Fix in-tree building of GMP on BSD [PR97302]

ChangeLog:
PR target/97302
* configure.ac: Only set with_gmp to /usr/local
if not building in tree.
* configure: Regenerate.
(cherry picked from commit c0d0a722da8583f74a0c192041be2f379cf487c1)

[Bug tree-optimization/97236] [10 Regression] g:e93428a8b056aed83a7678 triggers vlc miscompile

2020-10-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97236

--- Comment #8 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Matthias Klose
:

https://gcc.gnu.org/g:1ab88985631dd2c5a5e3b5c0dce47cf8b6ed2f82

commit r10-8859-g1ab88985631dd2c5a5e3b5c0dce47cf8b6ed2f82
Author: Matthias Klose 
Date:   Tue Oct 6 13:41:37 2020 +0200

Backport fix for PR/tree-optimization/97236 - fix bad use of
VMAT_CONTIGUOUS

This avoids using VMAT_CONTIGUOUS with single-element interleaving
when using V1mode vectors.  Instead keep VMAT_ELEMENTWISE but
continue to avoid load-lanes and gathers.

2020-10-01  Richard Biener  

PR tree-optimization/97236
* tree-vect-stmts.c (get_group_load_store_type): Keep
VMAT_ELEMENTWISE for single-element vectors.

* gcc.dg/vect/pr97236.c: New testcase.

[Bug fortran/97272] Wrong answer from MAXLOC with character arg

2020-10-04 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97272

--- Comment #4 from CVS Commits  ---
The master branch has been updated by Harald Anlauf :

https://gcc.gnu.org/g:35d2c6b6e8a7448a84abbf967feeb78a29117014

commit r11-3646-g35d2c6b6e8a7448a84abbf967feeb78a29117014
Author: Harald Anlauf 
Date:   Sun Oct 4 20:24:29 2020 +0200

PR fortran/97272 - Wrong answer from MAXLOC with character arg

The optional KIND argument to the MINLOC/MAXLOC intrinsic must not be
passed to the library function, as the kind conversion of the result
is treated explicitly elsewhere.

gcc/fortran/ChangeLog:

PR fortran/97272
* trans-intrinsic.c (strip_kind_from_actual): Helper function for
removal of KIND argument.
(gfc_conv_intrinsic_minmaxloc): Ignore KIND argument here, as it
is treated elsewhere.

gcc/testsuite/ChangeLog:

PR fortran/97272
* gfortran.dg/pr97272.f90: New test.

[Bug fortran/95654] nvptx offloading: FAIL: libgomp.fortran/pr66199-5.f90 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions execution test

2020-10-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95654

--- Comment #16 from CVS Commits  ---
The master branch has been updated by Tom de Vries :

https://gcc.gnu.org/g:ab3f4b27abe8abc947e84ef84bfc9a18797c5868

commit r11-3648-gab3f4b27abe8abc947e84ef84bfc9a18797c5868
Author: Tom de Vries 
Date:   Tue Sep 22 16:38:07 2020 +0200

[omp, ftracer] Don't duplicate blocks in SIMT region

When running the libgomp testsuite on x86_64-linux with nvptx accelerator
on
the test-case included in this patch, we run into:
...
FAIL: libgomp.fortran/pr95654.f90 -O3 -fomit-frame-pointer -funroll-loops \
  -fpeel-loops -ftracer -finline-functions  execution test
...

The test-case is a minimal version of this FAIL:
...
FAIL: libgomp.fortran/pr66199-5.f90 -O3 -fomit-frame-pointer -funroll-loops
\
  -fpeel-loops -ftracer -finline-functions  execution test
...
but that one has stopped failing at commit c2ebf4f10de "openmp: Add support
for non-rect simd and improve collapsed simd support".

The problem is that ftracer duplicates a block containing
GOMP_SIMT_VOTE_ANY.

That is, before ftracer we have (dropping the GOMP_SIMT_ prefix):
...
bb4(ENTER_ALLOC)
*--+
|   \
|\
| v
| *
v bb8
*<*
bb5(VOTE_ANY)
*-+
| |
| |
| |
| |
| v
| *
v bb7(XCHG_IDX)
*<*
bb6(EXIT)
...

The XCHG_IDX internal-fn does inter-SIMT-lane communication, which for
nvptx
maps onto shfl, an operator which has the requirement that the warp
executing
the operator is convergent.  The warp diverges at bb4, and
reconverges at bb5, and does not diverge by going to bb7, so the shfl is
indeed executed by a convergent warp.

After ftracer, we have:
...
bb4(ENTER_ALLOC)
*--+
|   \
|\
| \
|  \
v   v
*   *
bb5(VOTE_ANY)   bb8(VOTE_ANY)
*   *
|\ /|
| \  ++ |
|  \/   |
|  /\   |
| /  +--v
|/  *
v   bb7(XCHG_IDX)
*<--*
bb6(EXIT)
...

The warp diverges again at bb5, but does not reconverge again before bb6,
so
the shfl is executed by a divergent warp, which causes the FAIL.

Fix this by making ftracer ignore blocks containing ENTER_ALLOC, VOTE_ANY
and
EXIT, effectively treating the SIMT region conservatively.

An argument can be made that the test needs to be added in a more
generic place, like gimple_can_duplicate_bb_p or some such, and that
ftracer
then needs to use the generic test.  But that's a discussion with a much
broader scope, so I'm leaving that for another patch.

Bootstrapped and reg-tested on x86_64-linux.

Build on x86_64-linux with nvptx accelerator, tested with libgomp.

gcc/ChangeLog:

PR fortran/95654
* tracer.c (ignore_bb_p): Ignore GOMP_SIMT_ENTER_ALLOC,
GOMP_SIMT_VOTE_ANY and GOMP_SIMT_EXIT.

libgomp/ChangeLog:

2020-10-05  Tom de Vries  

PR fortran/95654
* testsuite/libgomp.fortran/pr95654.f90: New test.

[Bug middle-end/90861] OpenACC 'declare' not cleaning up for VLAs

2020-10-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90861

--- Comment #6 from CVS Commits  ---
The master branch has been updated by Tom de Vries :

https://gcc.gnu.org/g:3f2e15c2e66af9cca1dfe24ad7e9692f511ebd06

commit r11-3680-g3f2e15c2e66af9cca1dfe24ad7e9692f511ebd06
Author: Tom de Vries 
Date:   Tue Oct 6 13:07:25 2020 +0200

[openacc] Fix acc declare for VLAs

Consider test-case test.c, with VLA A:
...
int main (void) {
  int N = 1000;
  int A[N];
  #pragma acc declare copy(A)
  return 0;
}
...
compiled using:
...
$ gcc test.c -fopenacc -S -fdump-tree-all
...

At original, we have:
...
  #pragma acc declare map(tofrom:A);
...
but at gimple, we have a map (to:A.1), but not a map (from:A.1):
...
  int[0:D.2074] * A.1;

  {
int A[0:D.2074] [value-expr: *A.1];

saved_stack.2 = __builtin_stack_save ();
try
  {
A.1 = __builtin_alloca_with_align (D.2078, 32);
#pragma omp target oacc_declare map(to:(*A.1) [len: D.2076])
  }
finally
  {
__builtin_stack_restore (saved_stack.2);
  }
  }
...

This is caused by the following incompatibility.  When storing the desired
from clause in oacc_declare_returns, we use 'A.1' as the key:
...
10898 oacc_declare_returns->put (decl, c);
(gdb) call debug_generic_expr (decl)
A.1
(gdb) call debug_generic_expr (c)
map(from:(*A.1))
...
but when looking it up, we use 'A' as the key:
...
(gdb)
1471  tree *c = oacc_declare_returns->get (t);
(gdb) call debug_generic_expr (t)
A
...

Fix this by extracing the 'A.1' lookup key from 'A' using the decl-expr.

In addition, unshare the looked up value, to fix avoid running into
an "incorrect sharing of tree nodes" error.

Using these two fixes, we get our desired:
...
 finally
   {
+#pragma omp target oacc_declare map(from:(*A.1))
 __builtin_stack_restore (saved_stack.2);
   }
...

Build on x86_64-linux with nvptx accelerator, tested libgomp.

gcc/ChangeLog:

2020-10-06  Tom de Vries  

PR middle-end/90861
* gimplify.c (gimplify_bind_expr): Handle lookup in
oacc_declare_returns using key with decl-expr.

libgomp/ChangeLog:

2020-10-06  Tom de Vries  

PR middle-end/90861
* testsuite/libgomp.oacc-c-c++-common/declare-vla.c: Remove xfail.

[Bug libstdc++/90295] Please define ~exception_ptr inline

2020-10-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90295

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Jonathan Wakely :

https://gcc.gnu.org/g:1352ea192513e9a45808b8034df62b9434c674a7

commit r11-3682-g1352ea192513e9a45808b8034df62b9434c674a7
Author: Jonathan Wakely 
Date:   Tue Oct 6 16:55:06 2020 +0100

libstdc++: Inline std::exception_ptr members [PR 90295]

This inlines most members of std::exception_ptr so that all operations
on a null exception_ptr can be optimized away. This benefits code like
std::future and coroutines where an exception_ptr object is present to
cope with exceptional cases, but is usually not used and remains null.

Since those functions were previously non-inline we have to continue to
export them from the library, for objects that were compiled against the
old headers and expect to find definitions in the library.

In order to inline the copy constructor and destructor we need to export
the _M_addref() and _M_release() members that increment/decrement the
reference count when copying/destroying a non-null exception_ptr. The
copy ctor and dtor check for null and don't call _M_addref and
_M_release unless they need to. The checks for null pointers in
_M_addref and _M_release are still needed because old code might call
them without checking for null first. But we can use __builtin_expect to
predict that they are usually called for the non-null case.

libstdc++-v3/ChangeLog:

PR libstdc++/90295
* config/abi/pre/gnu.ver (CXXABI_1.3.13): New symbol version.
(exception_ptr::_M_addref(), exception_ptr::_M_release()):
Export symbols.
* libsupc++/eh_ptr.cc (exception_ptr::exception_ptr()):
Remove out-of-line definition.
(exception_ptr::exception_ptr(const exception_ptr&)):
Likewise.
(exception_ptr::~exception_ptr()): Likewise.
(exception_ptr::operator=(const exception_ptr&)):
Likewise.
(exception_ptr::swap(exception_ptr&)): Likewise.
(exception_ptr::_M_addref()): Add branch prediction.
* libsupc++/exception_ptr.h (exception_ptr::operator bool):
Add noexcept.
[!_GLIBCXX_EH_PTR_COMPAT] (operator==, operator!=): Define
inline as hidden friends. Remove declarations at namespace
scope.
(exception_ptr::exception_ptr()): Define inline.
(exception_ptr::exception_ptr(const exception_ptr&)):
Likewise.
(exception_ptr::~exception_ptr()): Likewise.
(exception_ptr::operator=(const exception_ptr&)):
Likewise.
(exception_ptr::swap(exception_ptr&)): Likewise.
* testsuite/util/testsuite_abi.cc: Add CXXABI_1.3.13.
* testsuite/18_support/exception_ptr/90295.cc: New test.

[Bug c++/97145] Sanitizer pointer-subtract breaks constexpr functions subtracting pointers

2020-10-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97145

--- Comment #5 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
:

https://gcc.gnu.org/g:3f56563cf84f97ef271ef0f949a571c13cdd06e2

commit r10-8850-g3f56563cf84f97ef271ef0f949a571c13cdd06e2
Author: Jakub Jelinek 
Date:   Tue Sep 22 21:06:32 2020 +0200

c++: Ignore __sanitizer_ptr_{sub,cmp} builtin calls during constant
expression evaluation [PR97145]

These two builtin calls are added already during parsing before pointer
subtractions or comparisons, normally they perform runtime verification
of whether the pointers point to the same object or different objects,
but during constant expressione valuation we don't really need those
builtins for anything.

2020-09-22  Jakub Jelinek  

PR c++/97145
* constexpr.c (cxx_eval_builtin_function_call): Return void_node
for
calls to __sanitize_ptr_{sub,cmp} builtins.

* g++.dg/asan/pr97145.C: New test.

(cherry picked from commit bc13106e0414b86af8f6878e7681e6a959921b9e)

[Bug c++/97195] construct_at on a union member is not a constant expression

2020-10-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97195

--- Comment #4 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
:

https://gcc.gnu.org/g:355b42c5d9d58d266829d2e44528f7a5ca0eae37

commit r10-8852-g355b42c5d9d58d266829d2e44528f7a5ca0eae37
Author: Jakub Jelinek 
Date:   Thu Oct 1 11:16:44 2020 +0200

c++: Handle std::construct_at on automatic vars during constant evaluation
[PR97195]

As mentioned in the PR, we only support due to a bug in constant
expressions
std::construct_at on non-automatic variables, because we VERIFY_CONSTANT
the
second argument of placement new, which fails verification if it is an
address of an automatic variable.
The following patch fixes it by not performing that verification, the
placement new evaluation later on will verify it after it is dereferenced.

2020-10-01  Jakub Jelinek  

PR c++/97195
* constexpr.c (cxx_eval_call_expression): Don't VERIFY_CONSTANT the
second argument.

* g++.dg/cpp2a/constexpr-new14.C: New test.

(cherry picked from commit 2805fcb32660bc0cdcd5ba54310f1f02651e039f)

[Bug bootstrap/97163] Build error with -mcpu=power9 on ppc64

2020-10-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97163

--- Comment #9 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
:

https://gcc.gnu.org/g:cd547f0ddcd3a54e5b73bcda5ac0f0c46808db8b

commit r10-8851-gcd547f0ddcd3a54e5b73bcda5ac0f0c46808db8b
Author: Jakub Jelinek 
Date:   Sat Sep 26 10:07:41 2020 +0200

powerpc, libcpp: Fix gcc build with clang on power8 [PR97163]

libcpp has two specialized altivec implementations of search_line_fast,
one for power8+ and the other one otherwise.
Both use __attribute__((altivec(vector))) and the GCC builtins rather than
altivec.h and the APIs from there, which is fine, but should be restricted
to when libcpp is built with GCC, so that it can be relied on.
The second elif is
and thus e.g. when built with clang it isn't picked, but the first one was
just guarded with
and so according to the bugreporter clang fails miserably on that.

The following patch fixes that by adding the same GCC_VERSION requirement
as the second version.  I don't know where the 4.5 in there comes from and
the exact version doesn't matter that much, as long as it is above 4.2 that
clang pretends to be and smaller or equal to 4.8 as the oldest gcc we
support as bootstrap compiler ATM.
Furthermore, the patch fixes the comment, the version it is talking about
is
not pre-GCC 5, but actually the GCC 5+ one.

2020-09-26  Jakub Jelinek  

PR bootstrap/97163
* lex.c (search_line_fast): Only use _ARCH_PWR8 Altivec version
for GCC >= 4.5.

(cherry picked from commit d00b1b023ecfc3ddc3fe952c0063dab7529d5f7a)

[Bug c++/96994] Missing code from consteval constructor initializing const variable

2020-10-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96994

--- Comment #10 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
:

https://gcc.gnu.org/g:2513dad670c00dd9db3a85be348f6f4020b18b81

commit r10-8853-g2513dad670c00dd9db3a85be348f6f4020b18b81
Author: Jakub Jelinek 
Date:   Thu Oct 1 11:18:35 2020 +0200

c++: Fix up default initialization with consteval default ctor [PR96994]

> > The following testcase is miscompiled (in particular the a and i
> > initialization).  The problem is that build_special_member_call due to
> > the immediate constructors (but not evaluated in constant expression
mode)
> > doesn't create a CALL_EXPR, but returns a TARGET_EXPR with CONSTRUCTOR
> > as the initializer for it,
>
> That seems like the bug; at the end of build_over_call, after you
>
> >call = cxx_constant_value (call, obj_arg);
>
> You need to build an INIT_EXPR if obj_arg isn't a dummy.

That works.  obj_arg is NULL if it is a dummy from the earlier code.

2020-10-01  Jakub Jelinek  

PR c++/96994
* call.c (build_over_call): If obj_arg is non-NULL, return
INIT_EXPR
setting obj_arg to call.

* g++.dg/cpp2a/consteval18.C: New test.

(cherry picked from commit 56da736cc6ced0f1c339744321a14ae569db8606)

[Bug libstdc++/91486] future::wait_for and shared_timed_mutex::wait_for do not work properly with float duration

2020-10-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91486

--- Comment #12 from CVS Commits  ---
The master branch has been updated by Jonathan Wakely :

https://gcc.gnu.org/g:f33a43f9f7eab7482837662821abb7fd02cb4350

commit r11-3653-gf33a43f9f7eab7482837662821abb7fd02cb4350
Author: Mike Crowe 
Date:   Mon Oct 5 11:12:38 2020 +0100

libstdc++: Use correct duration for atomic_futex wait on custom clock [PR
91486]

As Jonathan Wakely pointed out[1], my change in commit
f9ddb696a289cc48d24d3d23c0b324cb88de9573 should have been rounding to
the target clock duration type rather than the input clock duration type
in __atomic_futex_unsigned::_M_load_when_equal_until just as (e.g.)
condition_variable does.

As well as fixing this, let's create a rather contrived test that fails
with the previous code, but unfortunately only when run on a machine
with an uptime of over 208.5 days, and even then not always.

[1] https://gcc.gnu.org/pipermail/libstdc++/2020-September/051004.html

libstdc++-v3/ChangeLog:

PR libstdc++/91486
* include/bits/atomic_futex.h:
(__atomic_futex_unsigned::_M_load_when_equal_until): Use target
clock duration type when rounding.
* testsuite/30_threads/async/async.cc (test_pr91486_wait_for):
Rename from test_pr91486.
(float_steady_clock): New class for test.
(test_pr91486_wait_until): New test.

[Bug fortran/96099] ICE in gfc_validate_kind, at fortran/trans-types.c:773

2020-10-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96099

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Mark Eggleston
:

https://gcc.gnu.org/g:875c29a245150b6d023b8b0eb7f0ba224df082d0

commit r11-3807-g875c29a245150b6d023b8b0eb7f0ba224df082d0
Author: Mark Eggleston 
Date:   Thu Oct 1 11:14:09 2020 +0100

Fortran  : ICE in gfc_validate_kind PR96099

Only check for kind if the type supports kind.

2020-10-12  Mark Eggleston  

gcc/fortran/ChangeLog:

PR fortran/96099
* decl.c (gfc_match_implicit): Check for numeric and logical
types.

2020-10-12  Mark Eggleston  

gcc/testsuite/ChangeLog:

PR fortran/96099
* gfortran.dg/pr96099_1.f90: New test.
* gfortran.dg/pr96099_2.f90: New test.

[Bug tree-optimization/97079] [11 Regression] aarch64, SVE: ICE in SLP recognizer since r11-3148-g8d3767c30240c901a493d82d9d20f306b2f0152d

2020-10-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97079

--- Comment #8 from CVS Commits  ---
The master branch has been updated by Martin Liska :

https://gcc.gnu.org/g:bd28b730cf35dbeeb2b26aa173971630ca9e

commit r11-3821-gbd28b730cf35dbeeb2b26aa173971630ca9e
Author: Martin Liska 
Date:   Mon Oct 12 12:54:31 2020 +0200

SLP: fix SVE issues

The patch fixes the following 2 issues:

  .MASK_STORE_LANES (, 4B, max_mask_34, vect_array.12);

here we miss to return the last argument as stored value.

ivtmp_32 = ivtmp_31 + POLY_INT_CST [4, 4];

here we miss a bail out in vect_recog_over_widening_pattern.

gcc/ChangeLog:

PR tree-optimization/97079
* internal-fn.c (internal_fn_stored_value_index): Handle also
.MASK_STORE_LANES.
* tree-vect-patterns.c (vect_recog_over_widening_pattern): Bail
out for unsupported TREE_TYPE.

gcc/testsuite/ChangeLog:

PR tree-optimization/97079
* gcc.target/aarch64/sve/pr97079.c: New test.

[Bug middle-end/97357] [10 Regression] Unable to coalesce ssa_names which are marked as MUST COALESCE.

2020-10-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97357

--- Comment #8 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Christophe Lyon
:

https://gcc.gnu.org/g:124b4630636974638dfab057bb96f91bb7ee40eb

commit r10-8881-g124b4630636974638dfab057bb96f91bb7ee40eb
Author: Christophe Lyon 
Date:   Mon Oct 12 14:04:06 2020 +

tree-optimization/97357: Fix testcase

Calling _setjmp causing a warning when targeting newlib.

2020-10-12  Christophe Lyon  

gcc/testsuite/
PR tree-optimization/97357
* gcc.dg/pr97357.c: Call setjmp instead of _setjmp.

(cherry picked from commit f10f11eb63b0ed082674d9a589e67230aa49efb5)

[Bug tree-optimization/97201] [11 Regression] ICE in location_wrapper_p at gcc/gcc/tree.h:4002 since r11-3410-g67aeddb785ddcc86

2020-10-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97201

--- Comment #5 from CVS Commits  ---
The master branch has been updated by Martin Sebor :

https://gcc.gnu.org/g:1be51a3a9ac3409561223c8058d4943f9b574d15

commit r11-3828-g1be51a3a9ac3409561223c8058d4943f9b574d15
Author: Martin Sebor 
Date:   Mon Oct 12 09:35:02 2020 -0600

PR c++/97201 - ICE in -Warray-bounds writing to result of operator new(0)

gcc/cp/ChangeLog:

PR c++/97201
* error.c (dump_type_suffix): Handle both the C and C++ forms of
zero-length arrays.

libstdc++-v3/ChangeLog:

PR c++/97201
* libsupc++/new (operator new): Add attribute alloc_size and
malloc.

gcc/testsuite/ChangeLog:

PR c++/97201
* g++.dg/warn/Wplacement-new-size-8.C: Adjust expected message.
* g++.dg/warn/Warray-bounds-10.C: New test.
* g++.dg/warn/Warray-bounds-11.C: New test.
* g++.dg/warn/Warray-bounds-12.C: New test.
* g++.dg/warn/Warray-bounds-13.C: New test.

[Bug middle-end/90404] No warning on attempts to modify a const object

2020-10-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90404

--- Comment #7 from CVS Commits  ---
The master branch has been updated by David Malcolm :

https://gcc.gnu.org/g:3175d40fc52fb8eb3c3b18cc343d773da24434fb

commit r11-3829-g3175d40fc52fb8eb3c3b18cc343d773da24434fb
Author: David Malcolm 
Date:   Wed Oct 7 18:34:09 2020 -0400

analyzer: add warnings about writes to constant regions [PR95007]

This patch adds two new warnings:
  -Wanalyzer-write-to-const
  -Wanalyzer-write-to-string-literal
for code paths where the analyzer detects a write to a constant region.

As noted in the documentation part of the patch, the analyzer doesn't
prioritize detection of such writes, in that the state-merging logic
will blithely lose the distinction between const and non-const regions.
Hence false negatives are likely to arise due to state-merging.

However, if the analyzer does happen to spot such a write, it seems worth
reporting, hence this patch.

gcc/analyzer/ChangeLog:
* analyzer.opt (Wanalyzer-write-to-const): New.
(Wanalyzer-write-to-string-literal): New.
* region-model-impl-calls.cc (region_model::impl_call_memcpy):
Call check_for_writable_region.
(region_model::impl_call_memset): Likewise.
(region_model::impl_call_strcpy): Likewise.
* region-model.cc (class write_to_const_diagnostic): New.
(class write_to_string_literal_diagnostic): New.
(region_model::check_for_writable_region): New.
(region_model::set_value): Call check_for_writable_region.
* region-model.h (region_model::check_for_writable_region): New
decl.

gcc/ChangeLog:
* doc/invoke.texi: Document -Wanalyzer-write-to-const and
-Wanalyzer-write-to-string-literal.

gcc/testsuite/ChangeLog:
PR c/83347
PR middle-end/90404
PR analyzer/95007
* gcc.dg/analyzer/write-to-const-1.c: New test.
* gcc.dg/analyzer/write-to-string-literal-1.c: New test.

[Bug analyzer/95007] RFE: -fanalyzer should complain about writes to string literals

2020-10-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95007

--- Comment #3 from CVS Commits  ---
The master branch has been updated by David Malcolm :

https://gcc.gnu.org/g:3175d40fc52fb8eb3c3b18cc343d773da24434fb

commit r11-3829-g3175d40fc52fb8eb3c3b18cc343d773da24434fb
Author: David Malcolm 
Date:   Wed Oct 7 18:34:09 2020 -0400

analyzer: add warnings about writes to constant regions [PR95007]

This patch adds two new warnings:
  -Wanalyzer-write-to-const
  -Wanalyzer-write-to-string-literal
for code paths where the analyzer detects a write to a constant region.

As noted in the documentation part of the patch, the analyzer doesn't
prioritize detection of such writes, in that the state-merging logic
will blithely lose the distinction between const and non-const regions.
Hence false negatives are likely to arise due to state-merging.

However, if the analyzer does happen to spot such a write, it seems worth
reporting, hence this patch.

gcc/analyzer/ChangeLog:
* analyzer.opt (Wanalyzer-write-to-const): New.
(Wanalyzer-write-to-string-literal): New.
* region-model-impl-calls.cc (region_model::impl_call_memcpy):
Call check_for_writable_region.
(region_model::impl_call_memset): Likewise.
(region_model::impl_call_strcpy): Likewise.
* region-model.cc (class write_to_const_diagnostic): New.
(class write_to_string_literal_diagnostic): New.
(region_model::check_for_writable_region): New.
(region_model::set_value): Call check_for_writable_region.
* region-model.h (region_model::check_for_writable_region): New
decl.

gcc/ChangeLog:
* doc/invoke.texi: Document -Wanalyzer-write-to-const and
-Wanalyzer-write-to-string-literal.

gcc/testsuite/ChangeLog:
PR c/83347
PR middle-end/90404
PR analyzer/95007
* gcc.dg/analyzer/write-to-const-1.c: New test.
* gcc.dg/analyzer/write-to-string-literal-1.c: New test.

[Bug c/83347] write pointer to const string possible without warning

2020-10-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83347

--- Comment #5 from CVS Commits  ---
The master branch has been updated by David Malcolm :

https://gcc.gnu.org/g:3175d40fc52fb8eb3c3b18cc343d773da24434fb

commit r11-3829-g3175d40fc52fb8eb3c3b18cc343d773da24434fb
Author: David Malcolm 
Date:   Wed Oct 7 18:34:09 2020 -0400

analyzer: add warnings about writes to constant regions [PR95007]

This patch adds two new warnings:
  -Wanalyzer-write-to-const
  -Wanalyzer-write-to-string-literal
for code paths where the analyzer detects a write to a constant region.

As noted in the documentation part of the patch, the analyzer doesn't
prioritize detection of such writes, in that the state-merging logic
will blithely lose the distinction between const and non-const regions.
Hence false negatives are likely to arise due to state-merging.

However, if the analyzer does happen to spot such a write, it seems worth
reporting, hence this patch.

gcc/analyzer/ChangeLog:
* analyzer.opt (Wanalyzer-write-to-const): New.
(Wanalyzer-write-to-string-literal): New.
* region-model-impl-calls.cc (region_model::impl_call_memcpy):
Call check_for_writable_region.
(region_model::impl_call_memset): Likewise.
(region_model::impl_call_strcpy): Likewise.
* region-model.cc (class write_to_const_diagnostic): New.
(class write_to_string_literal_diagnostic): New.
(region_model::check_for_writable_region): New.
(region_model::set_value): Call check_for_writable_region.
* region-model.h (region_model::check_for_writable_region): New
decl.

gcc/ChangeLog:
* doc/invoke.texi: Document -Wanalyzer-write-to-const and
-Wanalyzer-write-to-string-literal.

gcc/testsuite/ChangeLog:
PR c/83347
PR middle-end/90404
PR analyzer/95007
* gcc.dg/analyzer/write-to-const-1.c: New test.
* gcc.dg/analyzer/write-to-string-literal-1.c: New test.

[Bug middle-end/97357] [10 Regression] Unable to coalesce ssa_names which are marked as MUST COALESCE.

2020-10-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97357

--- Comment #7 from CVS Commits  ---
The master branch has been updated by Christophe Lyon :

https://gcc.gnu.org/g:f10f11eb63b0ed082674d9a589e67230aa49efb5

commit r11-3824-gf10f11eb63b0ed082674d9a589e67230aa49efb5
Author: Christophe Lyon 
Date:   Mon Oct 12 14:04:06 2020 +

tree-optimization/97357: Fix testcase

Calling _setjmp causing a warning when targeting newlib.

2020-10-12  Christophe Lyon  

gcc/testsuite/
PR tree-optimization/97357
* gcc.dg/pr97357.c: Call setjmp instead of _setjmp.

[Bug middle-end/97342] [11 Regression] bogus -Wstringop-overflow with nonzero signed and unsigned offsets

2020-10-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97342

--- Comment #2 from CVS Commits  ---
The master branch has been updated by Martin Sebor :

https://gcc.gnu.org/g:83685efd5fd1623cfc4e4c435ce2773d95d458d1

commit r11-3827-g83685efd5fd1623cfc4e4c435ce2773d95d458d1
Author: Martin Sebor 
Date:   Fri Oct 9 14:48:43 2020 -0600

Generalize compute_objsize to return maximum size/offset instead of failing
(PR middle-end/97023).

Also resolves:
PR middle-end/97342 - bogus -Wstringop-overflow with nonzero signed and
unsigned offsets
PR middle-end/97023 - missing warning on buffer overflow in chained mempcpy
PR middle-end/96384 - bogus -Wstringop-overflow= storing into
multidimensional array with index in range

gcc/ChangeLog:

PR middle-end/97342
PR middle-end/97023
PR middle-end/96384
* builtins.c (access_ref::access_ref): Initialize new member.  Use
new enum.
(access_ref::size_remaining): Define new member function.
(inform_access): Handle expressions referencing objects.
(gimple_call_alloc_size): Call get_size_range instead of get_range.
(gimple_call_return_array): New function.
(get_range): Rename...
(get_offset_range): ...to this.  Improve detection of ranges from
types of expressions.
(gimple_call_return_array): Adjust calls to get_range per above.
(compute_objsize): Same.  Set maximum size or offset instead of
failing for unknown objects and handle more kinds of expressions.
(compute_objsize): Call access_ref::size_remaining.
(compute_objsize): Have transitional wrapper fail for pointers
into unknown objects.
(expand_builtin_strncmp): Call access_ref::size_remaining and
handle new cases.
* builtins.h (access_ref::size_remaining): Declare new member
function.
(access_ref::set_max_size_range): Define new member function.
(access_ref::add_ofset, access_ref::add_max_ofset): Same.
(access_ref::add_base0): New data member.
* calls.c (get_size_range): Change argument type.  Handle new
condition.
* calls.h (get_size_range): Adjust signature.
(enum size_range_flags): Define new type.
* gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref):
Correct
argument to get_size_range.
* tree-ssa-strlen.c (get_range): Handle anti-ranges.
(maybe_warn_overflow): Check DECL_P before assuming it's one.

gcc/testsuite/ChangeLog:

PR middle-end/97342
PR middle-end/97023
PR middle-end/96384
* c-c++-common/Wrestrict.c: Adjust comment.
* gcc.dg/Wstringop-overflow-34.c: Remove xfail.
* gcc.dg/Wstringop-overflow-43.c: Remove xfails.  Adjust regex
patterns.
* gcc.dg/pr51683.c: Prune out expected warning.
* gcc.target/i386/pr60693.c: Same.
* g++.dg/warn/Wplacement-new-size-8.C: New test.
* gcc.dg/Wstringop-overflow-41.c: New test.
* gcc.dg/Wstringop-overflow-44.s: New test.
* gcc.dg/Wstringop-overflow-45.c: New test.
* gcc.dg/Wstringop-overflow-46.c: New test.
* gcc.dg/Wstringop-overflow-47.c: New test.
* gcc.dg/Wstringop-overflow-49.c: New test.
* gcc.dg/Wstringop-overflow-50.c: New test.
* gcc.dg/Wstringop-overflow-51.c: New test.
* gcc.dg/Wstringop-overflow-52.c: New test.
* gcc.dg/Wstringop-overflow-53.c: New test.
* gcc.dg/Wstringop-overflow-54.c: New test.
* gcc.dg/Wstringop-overflow-55.c: New test.
* gcc.dg/Wstringop-overread-5.c: New test.

[Bug middle-end/97023] missing warning on buffer overflow in chained mempcpy

2020-10-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97023

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Martin Sebor :

https://gcc.gnu.org/g:83685efd5fd1623cfc4e4c435ce2773d95d458d1

commit r11-3827-g83685efd5fd1623cfc4e4c435ce2773d95d458d1
Author: Martin Sebor 
Date:   Fri Oct 9 14:48:43 2020 -0600

Generalize compute_objsize to return maximum size/offset instead of failing
(PR middle-end/97023).

Also resolves:
PR middle-end/97342 - bogus -Wstringop-overflow with nonzero signed and
unsigned offsets
PR middle-end/97023 - missing warning on buffer overflow in chained mempcpy
PR middle-end/96384 - bogus -Wstringop-overflow= storing into
multidimensional array with index in range

gcc/ChangeLog:

PR middle-end/97342
PR middle-end/97023
PR middle-end/96384
* builtins.c (access_ref::access_ref): Initialize new member.  Use
new enum.
(access_ref::size_remaining): Define new member function.
(inform_access): Handle expressions referencing objects.
(gimple_call_alloc_size): Call get_size_range instead of get_range.
(gimple_call_return_array): New function.
(get_range): Rename...
(get_offset_range): ...to this.  Improve detection of ranges from
types of expressions.
(gimple_call_return_array): Adjust calls to get_range per above.
(compute_objsize): Same.  Set maximum size or offset instead of
failing for unknown objects and handle more kinds of expressions.
(compute_objsize): Call access_ref::size_remaining.
(compute_objsize): Have transitional wrapper fail for pointers
into unknown objects.
(expand_builtin_strncmp): Call access_ref::size_remaining and
handle new cases.
* builtins.h (access_ref::size_remaining): Declare new member
function.
(access_ref::set_max_size_range): Define new member function.
(access_ref::add_ofset, access_ref::add_max_ofset): Same.
(access_ref::add_base0): New data member.
* calls.c (get_size_range): Change argument type.  Handle new
condition.
* calls.h (get_size_range): Adjust signature.
(enum size_range_flags): Define new type.
* gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref):
Correct
argument to get_size_range.
* tree-ssa-strlen.c (get_range): Handle anti-ranges.
(maybe_warn_overflow): Check DECL_P before assuming it's one.

gcc/testsuite/ChangeLog:

PR middle-end/97342
PR middle-end/97023
PR middle-end/96384
* c-c++-common/Wrestrict.c: Adjust comment.
* gcc.dg/Wstringop-overflow-34.c: Remove xfail.
* gcc.dg/Wstringop-overflow-43.c: Remove xfails.  Adjust regex
patterns.
* gcc.dg/pr51683.c: Prune out expected warning.
* gcc.target/i386/pr60693.c: Same.
* g++.dg/warn/Wplacement-new-size-8.C: New test.
* gcc.dg/Wstringop-overflow-41.c: New test.
* gcc.dg/Wstringop-overflow-44.s: New test.
* gcc.dg/Wstringop-overflow-45.c: New test.
* gcc.dg/Wstringop-overflow-46.c: New test.
* gcc.dg/Wstringop-overflow-47.c: New test.
* gcc.dg/Wstringop-overflow-49.c: New test.
* gcc.dg/Wstringop-overflow-50.c: New test.
* gcc.dg/Wstringop-overflow-51.c: New test.
* gcc.dg/Wstringop-overflow-52.c: New test.
* gcc.dg/Wstringop-overflow-53.c: New test.
* gcc.dg/Wstringop-overflow-54.c: New test.
* gcc.dg/Wstringop-overflow-55.c: New test.
* gcc.dg/Wstringop-overread-5.c: New test.

[Bug middle-end/96384] [11 Regression] bogus -Wstringop-overflow= storing into multidimensional array with index in range

2020-10-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96384

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Martin Sebor :

https://gcc.gnu.org/g:de05c19d5fd661ae16dd75a895b49d32d12f5edc

commit r11-3826-gde05c19d5fd661ae16dd75a895b49d32d12f5edc
Author: Martin Sebor 
Date:   Fri Oct 9 13:56:53 2020 -0600

Correct handling of indices into arrays with elements larger than 1 (PR
c++/96511)

Resolves:
PR c++/96511 - Incorrect -Wplacement-new on POINTER_PLUS into an array with
4-byte elements
PR middle-end/96384 - bogus -Wstringop-overflow= storing into
multidimensional array with index in range

gcc/ChangeLog:

PR c++/96511
PR middle-end/96384
* builtins.c (get_range): Return full range of type when neither
value nor its range is available.  Fail for ranges inverted due
to the signedness of offsets.
(compute_objsize): Handle more special array members.  Handle
POINTER_PLUS_EXPR and VIEW_CONVERT_EXPR that come up in front end
code.
(access_ref::offset_bounded): Define new member function.
* builtins.h (access_ref::eval): New data member.
(access_ref::offset_bounded): New member function.
(access_ref::offset_zero): New member function.
(compute_objsize): Declare a new overload.
* gimple-array-bounds.cc (array_bounds_checker::check_array_ref):
Use
enum special_array_member.
* tree.c (component_ref_size): Use special_array_member.
* tree.h (special_array_member): Define a new type.
(component_ref_size): Change signature.

gcc/cp/ChangeLog:

PR c++/96511
PR middle-end/96384
* init.c (warn_placement_new_too_small): Call builtin_objsize
instead
of duplicating what it does.

gcc/testsuite/ChangeLog:

PR c++/96511
PR middle-end/96384
* g++.dg/init/strlen.C: Add expected warning.
* g++.dg/warn/Wplacement-new-size-1.C: Relax warnings.
* g++.dg/warn/Wplacement-new-size-2.C: Same.
* g++.dg/warn/Wplacement-new-size-6.C: Same.
* gcc.dg/Warray-bounds-58.c: Adjust
* gcc.dg/Wstringop-overflow-37.c: Same.
* g++.dg/warn/Wplacement-new-size-7.C: New test.

[Bug middle-end/96384] [11 Regression] bogus -Wstringop-overflow= storing into multidimensional array with index in range

2020-10-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96384

--- Comment #4 from CVS Commits  ---
The master branch has been updated by Martin Sebor :

https://gcc.gnu.org/g:83685efd5fd1623cfc4e4c435ce2773d95d458d1

commit r11-3827-g83685efd5fd1623cfc4e4c435ce2773d95d458d1
Author: Martin Sebor 
Date:   Fri Oct 9 14:48:43 2020 -0600

Generalize compute_objsize to return maximum size/offset instead of failing
(PR middle-end/97023).

Also resolves:
PR middle-end/97342 - bogus -Wstringop-overflow with nonzero signed and
unsigned offsets
PR middle-end/97023 - missing warning on buffer overflow in chained mempcpy
PR middle-end/96384 - bogus -Wstringop-overflow= storing into
multidimensional array with index in range

gcc/ChangeLog:

PR middle-end/97342
PR middle-end/97023
PR middle-end/96384
* builtins.c (access_ref::access_ref): Initialize new member.  Use
new enum.
(access_ref::size_remaining): Define new member function.
(inform_access): Handle expressions referencing objects.
(gimple_call_alloc_size): Call get_size_range instead of get_range.
(gimple_call_return_array): New function.
(get_range): Rename...
(get_offset_range): ...to this.  Improve detection of ranges from
types of expressions.
(gimple_call_return_array): Adjust calls to get_range per above.
(compute_objsize): Same.  Set maximum size or offset instead of
failing for unknown objects and handle more kinds of expressions.
(compute_objsize): Call access_ref::size_remaining.
(compute_objsize): Have transitional wrapper fail for pointers
into unknown objects.
(expand_builtin_strncmp): Call access_ref::size_remaining and
handle new cases.
* builtins.h (access_ref::size_remaining): Declare new member
function.
(access_ref::set_max_size_range): Define new member function.
(access_ref::add_ofset, access_ref::add_max_ofset): Same.
(access_ref::add_base0): New data member.
* calls.c (get_size_range): Change argument type.  Handle new
condition.
* calls.h (get_size_range): Adjust signature.
(enum size_range_flags): Define new type.
* gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref):
Correct
argument to get_size_range.
* tree-ssa-strlen.c (get_range): Handle anti-ranges.
(maybe_warn_overflow): Check DECL_P before assuming it's one.

gcc/testsuite/ChangeLog:

PR middle-end/97342
PR middle-end/97023
PR middle-end/96384
* c-c++-common/Wrestrict.c: Adjust comment.
* gcc.dg/Wstringop-overflow-34.c: Remove xfail.
* gcc.dg/Wstringop-overflow-43.c: Remove xfails.  Adjust regex
patterns.
* gcc.dg/pr51683.c: Prune out expected warning.
* gcc.target/i386/pr60693.c: Same.
* g++.dg/warn/Wplacement-new-size-8.C: New test.
* gcc.dg/Wstringop-overflow-41.c: New test.
* gcc.dg/Wstringop-overflow-44.s: New test.
* gcc.dg/Wstringop-overflow-45.c: New test.
* gcc.dg/Wstringop-overflow-46.c: New test.
* gcc.dg/Wstringop-overflow-47.c: New test.
* gcc.dg/Wstringop-overflow-49.c: New test.
* gcc.dg/Wstringop-overflow-50.c: New test.
* gcc.dg/Wstringop-overflow-51.c: New test.
* gcc.dg/Wstringop-overflow-52.c: New test.
* gcc.dg/Wstringop-overflow-53.c: New test.
* gcc.dg/Wstringop-overflow-54.c: New test.
* gcc.dg/Wstringop-overflow-55.c: New test.
* gcc.dg/Wstringop-overread-5.c: New test.

[Bug c++/96511] Incorrect placement-new warning

2020-10-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96511

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Martin Sebor :

https://gcc.gnu.org/g:de05c19d5fd661ae16dd75a895b49d32d12f5edc

commit r11-3826-gde05c19d5fd661ae16dd75a895b49d32d12f5edc
Author: Martin Sebor 
Date:   Fri Oct 9 13:56:53 2020 -0600

Correct handling of indices into arrays with elements larger than 1 (PR
c++/96511)

Resolves:
PR c++/96511 - Incorrect -Wplacement-new on POINTER_PLUS into an array with
4-byte elements
PR middle-end/96384 - bogus -Wstringop-overflow= storing into
multidimensional array with index in range

gcc/ChangeLog:

PR c++/96511
PR middle-end/96384
* builtins.c (get_range): Return full range of type when neither
value nor its range is available.  Fail for ranges inverted due
to the signedness of offsets.
(compute_objsize): Handle more special array members.  Handle
POINTER_PLUS_EXPR and VIEW_CONVERT_EXPR that come up in front end
code.
(access_ref::offset_bounded): Define new member function.
* builtins.h (access_ref::eval): New data member.
(access_ref::offset_bounded): New member function.
(access_ref::offset_zero): New member function.
(compute_objsize): Declare a new overload.
* gimple-array-bounds.cc (array_bounds_checker::check_array_ref):
Use
enum special_array_member.
* tree.c (component_ref_size): Use special_array_member.
* tree.h (special_array_member): Define a new type.
(component_ref_size): Change signature.

gcc/cp/ChangeLog:

PR c++/96511
PR middle-end/96384
* init.c (warn_placement_new_too_small): Call builtin_objsize
instead
of duplicating what it does.

gcc/testsuite/ChangeLog:

PR c++/96511
PR middle-end/96384
* g++.dg/init/strlen.C: Add expected warning.
* g++.dg/warn/Wplacement-new-size-1.C: Relax warnings.
* g++.dg/warn/Wplacement-new-size-2.C: Same.
* g++.dg/warn/Wplacement-new-size-6.C: Same.
* gcc.dg/Warray-bounds-58.c: Adjust
* gcc.dg/Wstringop-overflow-37.c: Same.
* g++.dg/warn/Wplacement-new-size-7.C: New test.

[Bug target/97349] Incorrect types for some AArch64 Neon vdupq_n_<...> intrinsics

2020-10-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97349

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Kyrylo Tkachov :

https://gcc.gnu.org/g:8a3da2e6060ff0f61dae6aaada716e2c67f3d54f

commit r11-3817-g8a3da2e6060ff0f61dae6aaada716e2c67f3d54f
Author: Kyrylo Tkachov 
Date:   Fri Oct 9 10:34:15 2020 +0100

PR target/97349 AArch64: Incorrect types for some Neon vdupq_n_<...>
intrinsics

This patch fixes the PR by adjusting the input types of the intrinsic
prototypes to the ones mandated by ACLE
Turns out the tests in the testsuite were already using the correct
ones, but implicit conversions hid the bug...

Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/
PR target/97349
* config/aarch64/arm_neon.h (vdupq_n_p8, vdupq_n_p16,
vdupq_n_p64, vdupq_n_s8, vdupq_n_s16, vdupq_n_u8, vdupq_n_u16):
Fix argument type.

gcc/testsuite/
PR target/97349
* gcc.target/aarch64/simd/pr97349.c: New test.

[Bug middle-end/97357] [10 Regression] Unable to coalesce ssa_names which are marked as MUST COALESCE.

2020-10-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97357

--- Comment #5 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Richard Biener
:

https://gcc.gnu.org/g:e293967739f8ac5341ad4e2121f9d87b67499008

commit r10-8879-ge293967739f8ac5341ad4e2121f9d87b67499008
Author: Richard Biener 
Date:   Mon Oct 12 08:51:05 2020 +0200

tree-optimization/97357 - avoid abnormals in loop splitting conditions

This avoids abnormals in another place.

2020-10-12  Richard Biener  

PR tree-optimization/97357
* tree-ssa-loop-split.c (ssa_semi_invariant_p): Abnormal
SSA names are not semi invariant.

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

[Bug tree-optimization/97371] [11 Regression] evrp problem with gcc.target/s390/pr77822-2.c and -O3

2020-10-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97371

--- Comment #5 from CVS Commits  ---
The master branch has been updated by Aldy Hernandez :

https://gcc.gnu.org/g:e1b4fbfea6ad24f47279b90aec27ef1512625c80

commit r11-3812-ge1b4fbfea6ad24f47279b90aec27ef1512625c80
Author: Aldy Hernandez 
Date:   Mon Oct 12 04:08:28 2020 -0400

Ignore shifts larger than precision in operator_rshift::op1_range.

gcc/ChangeLog:

PR tree-optimization/97371
* range-op.cc (operator_rshift::op1_range): Ignore shifts larger
than
or equal to type precision.

gcc/testsuite/ChangeLog:

* gcc.dg/pr97371.c: New test.

[Bug tree-optimization/97255] [8/9/10 Regression] Vectorizer gives a boolean a value of 255

2020-10-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97255

--- Comment #5 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Richard Biener
:

https://gcc.gnu.org/g:67baa11f68e72cf562c491a8107bcdf3f1d6fc9b

commit r10-8878-g67baa11f68e72cf562c491a8107bcdf3f1d6fc9b
Author: Richard Biener 
Date:   Thu Oct 1 09:29:32 2020 +0200

tree-optimization/97255 - missing vector bool pattern of SRAed bool

SRA tends to use VIEW_CONVERT_EXPR when replacing bool fields with
unsigned char fields.  Those are not handled in vector bool pattern
detection causing vector true values to leak.  The following fixes
this by turning those into b ? 1 : 0 as well.

2020-10-01  Richard Biener  

PR tree-optimization/97255
* tree-vect-patterns.c (vect_recog_bool_pattern): Also handle
VIEW_CONVERT_EXPR.

* g++.dg/vect/pr97255.cc: New testcase.

[Bug tree-optimization/96757] aarch64:ICE during GIMPLE pass: vect

2020-10-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96757

--- Comment #1 from CVS Commits  ---
The master branch has been updated by Richard Sandiford :

https://gcc.gnu.org/g:91d80cf4bd2827dd9c40fe6a7c719c909d79083d

commit r11-3819-g91d80cf4bd2827dd9c40fe6a7c719c909d79083d
Author: Duan bo 
Date:   Mon Oct 12 12:32:57 2020 +0100

vect: Fix an ICE in vect_recog_mask_conversion_pattern

When processing the cond expression, vect_recog_mask_conversion_pattern
doesn't consider the situation that two operands of rhs1 are different
vectypes, leading to a vect ICE. This patch adds the identification and
handling of the situation to fix the problem.

gcc/ChangeLog:

PR target/96757
* tree-vect-patterns.c (vect_recog_mask_conversion_pattern): Add
the identification and handling of the dropped situation in the
cond expression processing phase.

gcc/testsuite/ChangeLog:

PR target/96757
* gcc.target/aarch64/pr96757.c: New test.

[Bug middle-end/97357] [10 Regression] Unable to coalesce ssa_names which are marked as MUST COALESCE.

2020-10-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97357

--- Comment #4 from CVS Commits  ---
The master branch has been updated by Richard Biener :

https://gcc.gnu.org/g:5b2cc633794f6e1f882d46bdefe267401d33285e

commit r11-3808-g5b2cc633794f6e1f882d46bdefe267401d33285e
Author: Richard Biener 
Date:   Mon Oct 12 08:51:05 2020 +0200

tree-optimization/97357 - avoid abnormals in loop splitting conditions

This avoids abnormals in another place.

2020-10-12  Richard Biener  

PR tree-optimization/97357
* tree-ssa-loop-split.c (ssa_semi_invariant_p): Abnormal
SSA names are not semi invariant.

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

[Bug libstdc++/95904] Improve the diagnostic for conflicting return types in std::visit

2020-10-09 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95904

--- Comment #1 from CVS Commits  ---
The master branch has been updated by Ville Voutilainen :

https://gcc.gnu.org/g:3427e31331677ca826c5588c87924214f7e5c54b

commit r11-3760-g3427e31331677ca826c5588c87924214f7e5c54b
Author: Ville Voutilainen 
Date:   Fri Oct 9 20:47:01 2020 +0300

libstdc++: Diagnose visitors with different return types [PR95904]

libstdc++-v3/ChangeLog:

PR libstdc++/95904
* include/std/variant (__deduce_visit_result): Add a nested ::type.
(__gen_vtable_impl::_S_apply):
Check the visitor return type.
(__same_types): New.
(__check_visitor_result): Likewise.
(__check_visitor_results): Likewise.
(visit(_Visitor&&, _Variants&&...)): Use __check_visitor_results
in case we're visiting just one variant.
* testsuite/20_util/variant/visit_neg.cc: Adjust.

[Bug libstdc++/94823] modulo arithmetic bug in random.tcc

2020-10-09 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94823

--- Comment #8 from CVS Commits  ---
The master branch has been updated by Jonathan Wakely :

https://gcc.gnu.org/g:3ee44d4c518d61c6bbf75fcf280edc6ce5326ce0

commit r11-3759-g3ee44d4c518d61c6bbf75fcf280edc6ce5326ce0
Author: Jonathan Wakely 
Date:   Fri Oct 9 16:10:31 2020 +0100

libstdc++: Fix incorrect results in std::seed_seq::generate [PR 97311]

This ensures that intermediate results are done in uint32_t values,
meeting the requirement for operations to be done modulo 2^32.

If the target doesn't define __UINT32_TYPE__ then substitute uint32_t
with a class type that uses uint_least32_t and masks the value to
UINT32_MAX.

I've also split the first loop that goes from k=0 to k

[Bug libstdc++/97311] Bug in std::seed_seq::generate() when integer type has more than 32 bits

2020-10-09 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97311

--- Comment #8 from CVS Commits  ---
The master branch has been updated by Jonathan Wakely :

https://gcc.gnu.org/g:3ee44d4c518d61c6bbf75fcf280edc6ce5326ce0

commit r11-3759-g3ee44d4c518d61c6bbf75fcf280edc6ce5326ce0
Author: Jonathan Wakely 
Date:   Fri Oct 9 16:10:31 2020 +0100

libstdc++: Fix incorrect results in std::seed_seq::generate [PR 97311]

This ensures that intermediate results are done in uint32_t values,
meeting the requirement for operations to be done modulo 2^32.

If the target doesn't define __UINT32_TYPE__ then substitute uint32_t
with a class type that uses uint_least32_t and masks the value to
UINT32_MAX.

I've also split the first loop that goes from k=0 to k

[Bug libstdc++/95322] std::list | take | transform, expression does not work cbegin() == end()

2020-10-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95322

--- Comment #17 from CVS Commits  ---
The master branch has been updated by Patrick Palka :

https://gcc.gnu.org/g:e066821b6f6b7332c7a67981f7b33c9ba0ccaee7

commit r11-3834-ge066821b6f6b7332c7a67981f7b33c9ba0ccaee7
Author: Patrick Palka 
Date:   Mon Oct 12 13:46:21 2020 -0400

libstdc++: Apply proposed resolution for LWG 3449 [PR95322]

Now that the frontend bug PR96805 is fixed, we can cleanly apply the
proposed resolution for this issue.

This slightly deviates from the proposed resolution by declaring _CI a
member of take_view instead of take_view::_Sentinel, since it doesn't
depend on anything within _Sentinel anymore.

libstdc++-v3/ChangeLog:

PR libstdc++/95322
* include/std/ranges (take_view::_CI): Define this alias
template as per LWG 3449 and remove ...
(take_view::_Sentinel::_CI): ... this type alias.
(take_view::_Sentinel::operator==): Adjust use of _CI
accordingly.  Define a second overload that accepts an iterator
of the opposite constness as per LWG 3449.
(take_while_view::_Sentinel::operator==): Likewise.
* testsuite/std/ranges/adaptors/95322.cc: Add tests for LWG 3449.

[Bug target/97349] Incorrect types for some AArch64 Neon vdupq_n_<...> intrinsics

2020-10-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97349

--- Comment #4 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Kyrylo Tkachov
:

https://gcc.gnu.org/g:ce33401ac31248933a58b8b47c0ca3813b614381

commit r10-8882-gce33401ac31248933a58b8b47c0ca3813b614381
Author: Kyrylo Tkachov 
Date:   Fri Oct 9 10:34:15 2020 +0100

PR target/97349 AArch64: Incorrect types for some Neon vdupq_n_<...>
intrinsics

This patch fixes the PR by adjusting the input types of the intrinsic
prototypes to the ones mandated by ACLE
Turns out the tests in the testsuite were already using the correct
ones, but implicit conversions hid the bug...

Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/
PR target/97349
* config/aarch64/arm_neon.h (vdupq_n_p8, vdupq_n_p16,
vdupq_n_p64, vdupq_n_s8, vdupq_n_s16, vdupq_n_u8, vdupq_n_u16):
Fix argument type.

gcc/testsuite/
PR target/97349
* gcc.target/aarch64/simd/pr97349.c: New test.

(cherry picked from commit 8a3da2e6060ff0f61dae6aaada716e2c67f3d54f)

[Bug tree-optimization/97378] [11 Regression] ICE in tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:87 since r11-3685-gfcae5121154d1c

2020-10-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97378

--- Comment #4 from CVS Commits  ---
The master branch has been updated by Aldy Hernandez :

https://gcc.gnu.org/g:82118acc18e416b9c82c82ce7737f5e6246d6574

commit r11-3830-g82118acc18e416b9c82c82ce7737f5e6246d6574
Author: Aldy Hernandez 
Date:   Mon Oct 12 10:41:21 2020 -0400

operator_trunc_mod::wi_fold: Return VARYING for mod by zero.

gcc/ChangeLog:

PR tree-optimization/97378
* range-op.cc (operator_trunc_mod::wi_fold): Return VARYING for mod
by zero.

gcc/testsuite/ChangeLog:

* gcc.dg/pr97378.c: New test.

[Bug tree-optimization/97381] [11 Regression] ice error: invalid types in nop conversion

2020-10-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97381

--- Comment #6 from CVS Commits  ---
The master branch has been updated by Aldy Hernandez :

https://gcc.gnu.org/g:46f4a397ab0907ce5786e1f0b92030a73e8b89ef

commit r11-3836-g46f4a397ab0907ce5786e1f0b92030a73e8b89ef
Author: Andrew MacLeod 
Date:   Mon Oct 12 13:00:12 2020 -0400

Do not ignore failures from gimple_range_calc_op2.

We were ignoring the return value if op2 returned false and getting garbage
ranges propagated.

gcc/ChangeLog:

PR tree-optimization/97381
* gimple-range-gori.cc (gori_compute::compute_operand2_range): If a
range cannot be
calculated through operand 2, return false.

gcc/testsuite/ChangeLog:

* gcc.dg/pr97381.c: New test.

[Bug analyzer/97258] -fanalyze fails to analyze static callbacks

2020-10-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97258

--- Comment #1 from CVS Commits  ---
The master branch has been updated by David Malcolm :

https://gcc.gnu.org/g:af66094d037793773eb8a49597866457f2f6a104

commit r11-3840-gaf66094d037793773eb8a49597866457f2f6a104
Author: David Malcolm 
Date:   Wed Sep 30 18:51:26 2020 -0400

analyzer: handle static callbacks [PR97258]

The analyzer's initial worklist was only populated with non-static
functions in the TU (along with those that look promising for call
summaries).  Hence some static functions that were never explicitly
called but could be called via function pointers were not being
analyzed.

This patch remedies this by ensuring that functions that escape as
function pointers get added to the worklist, if they haven't been
already.  Another fix would be to simply analyze all functions that
we have a body for, but too much of the testsuite relies on static
test functions not being directly analyzed.

gcc/analyzer/ChangeLog:
PR analyzer/97258
* engine.cc (impl_region_model_context::on_escaped_function): New
vfunc.
(exploded_graph::add_function_entry): Use m_functions_with_enodes
to implement idempotency.
(add_any_callbacks): New.
(exploded_graph::build_initial_worklist): Use the above to find
callbacks that are reachable from global initializers.
(exploded_graph::on_escaped_function): New.
* exploded-graph.h
(impl_region_model_context::on_escaped_function): New decl.
(exploded_graph::on_escaped_function): New decl.
(exploded_graph::m_functions_with_enodes): New field.
* region-model-reachability.cc
(reachable_regions::reachable_regions): Replace "store" param with
"model" param; use it to initialize m_model.
(reachable_regions::add): When getting the svalue for the region,
call get_store_value on the model rather than using an initial
value.
(reachable_regions::mark_escaped_clusters): Add ctxt param and
use it to call on_escaped_function when a function_region escapes.
* region-model-reachability.h
(reachable_regions::reachable_regions): Replace "store" param with
"model" param.
(reachable_regions::mark_escaped_clusters): Add ctxt param.
(reachable_regions::m_model): New field.
* region-model.cc (region_model::handle_unrecognized_call): Update
for change in reachable_regions ctor.
(region_model::handle_unrecognized_call): Pass ctxt to
mark_escaped_clusters.
(region_model::get_reachable_svalues): Update for change in
reachable_regions ctor.
(region_model::get_initial_value_for_global): Read-only variables
keep their initial values.
* region-model.h (region_model_context::on_escaped_function): New
vfunc.
(noop_region_model_context::on_escaped_function): New.

gcc/testsuite/ChangeLog:
PR analyzer/97258
* gcc.dg/analyzer/callbacks-1.c: New test.
* gcc.dg/analyzer/callbacks-2.c: New test.
* gcc.dg/analyzer/callbacks-3.c: New test.

[Bug ipa/97389] [11 Regression] Segfault in tramp3d since r11-3825-g71dbabccbfb295c8

2020-10-13 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97389

--- Comment #2 from CVS Commits  ---
The master branch has been updated by Jan Hubicka :

https://gcc.gnu.org/g:56cb815ba22dd2ec00fee7a38f0862bc21d1c2a9

commit r11-3842-g56cb815ba22dd2ec00fee7a38f0862bc21d1c2a9
Author: Jan Hubicka 
Date:   Tue Oct 13 09:19:54 2020 +0200

Fix tramp3d PGO misoptimization

this patch fixes tramp3d ICE with PGO.  It has turned out to be by a
misupdate
in ignore_edge I introduced in previous patch that made us to not compute
SCCs correctly with -fno-lto.

While looking for problem I proofread the sources and also fortified the
srouces for situation where we insert a summary for no good reason and
noticed
a problem that early ipa-modref disabled itself in some cases.
I also noticed that param_index is treamed as uhwi while it is signed (that
wastes file space).

Bootstrapping/regtesting x86_64-linux, will commit it tomorrow if that
passes.

gcc/ChangeLog:

2020-10-13  Jan Hubicka  

PR ipa/97389
* ipa-modref.c (dump_lto_records): Fix formating of dump file.
(modref_summary::dump): Do not check loads to be non-null.
(modref_summary_lto::dump): Do not check loads to be non-null.
(merge_call_side_effects): Improve debug output.
(analyze_call): Crash when cur_summary->loads is NULL.
(analyze_function): Update.
(modref_summaries::insert): Insert only into summaries, not
optimization_summaries.
(modref_summaries::duplicate): Likewise; crash when load or sotres
are NULL.
(modref_summaries_lto::duplicate): Crash when loads or stores are
NULL.
(write_modref_records): param_index is signed.
(read_modref_records): param_index is signed.
(modref_write): Crash when loads or stores are NULL.
(read_section): Compensate previous change.
(pass_modref::execute): Do not check optimization_summaries t be
non-NULL.
(ignore_edge): Fix.
(compute_parm_map): Fix formating.
(modref_propagate_in_scc): Do not expect loads/stores to be NULL.

[Bug middle-end/97392] [11 regression] g++.dg/asan/asan_test.C compilation failure starting with r11-3827

2020-10-13 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97392

--- Comment #2 from CVS Commits  ---
The master branch has been updated by Martin Liska :

https://gcc.gnu.org/g:8e0e9417ccda583a1bf05ff08e86fdffbec62b3e

commit r11-3845-g8e0e9417ccda583a1bf05ff08e86fdffbec62b3e
Author: Martin Liska 
Date:   Tue Oct 13 10:09:47 2020 +0200

ASAN: disable -Wno-stringop-overflow for 2 tests

gcc/testsuite/ChangeLog:

PR middle-end/97392
* g++.dg/asan/asan_test.C: Disable -Wstringop-overflow.
* gcc.dg/asan/pr80166.c: Likewise.

[Bug target/97349] Incorrect types for some AArch64 Neon vdupq_n_<...> intrinsics

2020-10-13 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97349

--- Comment #5 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Kyrylo Tkachov
:

https://gcc.gnu.org/g:b9c1ca3e2fc84b40dc2ab70d12064e3d0eb8abdd

commit r9-8992-gb9c1ca3e2fc84b40dc2ab70d12064e3d0eb8abdd
Author: Kyrylo Tkachov 
Date:   Fri Oct 9 10:34:15 2020 +0100

PR target/97349 AArch64: Incorrect types for some Neon vdupq_n_<...>
intrinsics

This patch fixes the PR by adjusting the input types of the intrinsic
prototypes to the ones mandated by ACLE
Turns out the tests in the testsuite were already using the correct
ones, but implicit conversions hid the bug...

Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/
PR target/97349
* config/aarch64/arm_neon.h (vdupq_n_p8, vdupq_n_p16,
vdupq_n_p64, vdupq_n_s8, vdupq_n_s16, vdupq_n_u8, vdupq_n_u16):
Fix argument type.

gcc/testsuite/
PR target/97349
* gcc.target/aarch64/simd/pr97349.c: New test.

(cherry picked from commit 8a3da2e6060ff0f61dae6aaada716e2c67f3d54f)

[Bug target/97349] Incorrect types for some AArch64 Neon vdupq_n_<...> intrinsics

2020-10-13 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97349

--- Comment #6 from CVS Commits  ---
The releases/gcc-8 branch has been updated by Kyrylo Tkachov
:

https://gcc.gnu.org/g:5d3052a4755173f447cfcffa361086562033c8be

commit r8-10582-g5d3052a4755173f447cfcffa361086562033c8be
Author: Kyrylo Tkachov 
Date:   Fri Oct 9 10:34:15 2020 +0100

PR target/97349 AArch64: Incorrect types for some Neon vdupq_n_<...>
intrinsics

This patch fixes the PR by adjusting the input types of the intrinsic
prototypes to the ones mandated by ACLE
Turns out the tests in the testsuite were already using the correct
ones, but implicit conversions hid the bug...

Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/
PR target/97349
* config/aarch64/arm_neon.h (vdupq_n_p8, vdupq_n_p16,
vdupq_n_p64, vdupq_n_s8, vdupq_n_s16, vdupq_n_u8, vdupq_n_u16):
Fix argument type.

gcc/testsuite/
PR target/97349
* gcc.target/aarch64/simd/pr97349.c: New test.

(cherry picked from commit 8a3da2e6060ff0f61dae6aaada716e2c67f3d54f)
(cherry picked from commit b9c1ca3e2fc84b40dc2ab70d12064e3d0eb8abdd)

[Bug target/97251] [10 Regression] arm: ICEs compiling pure-code/no-literal-pool.c with integer MVE

2020-10-13 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97251

--- Comment #3 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Przemyslaw Wirkus
:

https://gcc.gnu.org/g:d121b3259b77203e62402024add1538c1bdf5fdf

commit r10-8885-gd121b3259b77203e62402024add1538c1bdf5fdf
Author: Alex Coplan 
Date:   Wed Sep 30 09:02:47 2020 +0100

arm: Fix ICEs in no-literal-pool.c on MVE [PR97251]

This patch fixes ICEs when compiling
gcc/testsuite/gcc.target/arm/pure-code/no-literal-pool.c with
-mfp16-format=ieee -mfloat-abi=hard -march=armv8.1-m.main+mve
-mpure-code.

The existing conditions in the movsf/movdf expanders (as well as the
no_literal_pool patterns) were too restrictive, requiring
TARGET_HARD_FLOAT instead of TARGET_VFP_BASE, which caused unrecognised
insns when compiling this testcase with integer MVE and -mpure-code.

gcc/ChangeLog:

PR target/97251
* config/arm/arm.md (movsf): Relax TARGET_HARD_FLOAT to
TARGET_VFP_BASE.
(movdf): Likewise.
* config/arm/vfp.md (no_literal_pool_df_immediate): Likewise.
(no_literal_pool_sf_immediate): Likewise.

(cherry picked from commit f63023fafbbc13545fef67e6b32a55b48a945fcf)

  1   2   3   4   5   6   7   8   9   10   >