[Bug target/99234] [10/11 regression] wrong result for 1.0/3.0 with -O2 -fno-omit-frame-pointer -frounding-math

2021-02-28 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99234

--- Comment #20 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Eric Botcazou
:

https://gcc.gnu.org/g:49a714e59194a7c549aa6657676a1b4be4520650

commit r10-9397-g49a714e59194a7c549aa6657676a1b4be4520650
Author: Eric Botcazou 
Date:   Mon Mar 1 07:53:05 2021 +0100

Fix wrong result for 1.0/3.0 at -O2 -fno-omit-frame-pointer -frounding-math

This wrong-code PR for the C++ compiler on x86-64/Windows is a regression
in GCC 9 and later, but the underlying issue has probably been there since
SEH was implemented and is exposed by this comment in config/i386/winnt.c:

  /* SEH records saves relative to the "current" stack pointer, whether
 or not there's a frame pointer in place.  This tracks the current
 stack pointer offset from the CFA.  */
  HOST_WIDE_INT sp_offset;

That's not what the (current) Microsoft documentation says; instead it
says:

  /* SEH records offsets relative to the lowest address of the fixed stack
 allocation.  If there is no frame pointer, these offsets are from the
 stack pointer; if there is a frame pointer, these offsets are from the
 value of the stack pointer when the frame pointer was established,
i.e.
 the frame pointer minus the offset in the .seh_setframe directive.  */

That's why the implementation is correct only under the condition that the
frame pointer be established *after* the fixed stack allocation; as a
matter
of fact, that's clearly the model underpinning SEH, but is the opposite of
what is done e.g. on Linux.

However the issue is mostly papered over in practice because:

  1. SEH forces use_fast_prologue_epilogue to false, which in turns forces
save_regs_using_mov to false, so the general regs are always pushed when
they need to be saved, which eliminates the offset computation for them.

  2. As soon as a frame is larger than 240 bytes, the frame pointer is
fixed
arbitrarily to 128 bytes above the stack pointer, which of course requires
that it be established after the fixed stack allocation.

So you need a small frame clobbering one of the call-saved XMM registers in
order to generate wrong SEH unwind info.

The attached fix makes sure that the frame pointer is always established
after the fixed stack allocation by pointing it at or below the lowest used
register save area, i.e. the SSE save area, and removing the special early
saves in the prologue; the end result is a uniform prologue sequence for
SEH whatever the frame size.  And it avoids a discrepancy between cases
where the number of saved general regs is even and cases where it is odd.

gcc/
PR target/99234
* config/i386/i386.c (ix86_compute_frame_layout): For a SEH target,
point the hard frame pointer to the SSE register save area instead
of the general register save area.  Perform only minimal adjustment
for small frames if it is initially not correctly aligned.
(ix86_expand_prologue): Remove early saves for a SEH target.
* config/i386/winnt.c (struct seh_frame_state): Document
constraint.
gcc/testsuite/
* g++.dg/eh/seh-xmm-unwind.C: New test.

[Bug target/99234] [10/11 regression] wrong result for 1.0/3.0 with -O2 -fno-omit-frame-pointer -frounding-math

2021-02-28 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99234

--- Comment #21 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Eric Botcazou
:

https://gcc.gnu.org/g:838adf69533ca15a259d47dd67e056c4101af368

commit r9-9258-g838adf69533ca15a259d47dd67e056c4101af368
Author: Eric Botcazou 
Date:   Mon Mar 1 07:53:05 2021 +0100

Fix wrong result for 1.0/3.0 at -O2 -fno-omit-frame-pointer -frounding-math

This wrong-code PR for the C++ compiler on x86-64/Windows is a regression
in GCC 9 and later, but the underlying issue has probably been there since
SEH was implemented and is exposed by this comment in config/i386/winnt.c:

  /* SEH records saves relative to the "current" stack pointer, whether
 or not there's a frame pointer in place.  This tracks the current
 stack pointer offset from the CFA.  */
  HOST_WIDE_INT sp_offset;

That's not what the (current) Microsoft documentation says; instead it
says:

  /* SEH records offsets relative to the lowest address of the fixed stack
 allocation.  If there is no frame pointer, these offsets are from the
 stack pointer; if there is a frame pointer, these offsets are from the
 value of the stack pointer when the frame pointer was established,
i.e.
 the frame pointer minus the offset in the .seh_setframe directive.  */

That's why the implementation is correct only under the condition that the
frame pointer be established *after* the fixed stack allocation; as a
matter
of fact, that's clearly the model underpinning SEH, but is the opposite of
what is done e.g. on Linux.

However the issue is mostly papered over in practice because:

  1. SEH forces use_fast_prologue_epilogue to false, which in turns forces
save_regs_using_mov to false, so the general regs are always pushed when
they need to be saved, which eliminates the offset computation for them.

  2. As soon as a frame is larger than 240 bytes, the frame pointer is
fixed
arbitrarily to 128 bytes above the stack pointer, which of course requires
that it be established after the fixed stack allocation.

So you need a small frame clobbering one of the call-saved XMM registers in
order to generate wrong SEH unwind info.

The attached fix makes sure that the frame pointer is always established
after the fixed stack allocation by pointing it at or below the lowest used
register save area, i.e. the SSE save area, and removing the special early
saves in the prologue; the end result is a uniform prologue sequence for
SEH whatever the frame size.  And it avoids a discrepancy between cases
where the number of saved general regs is even and cases where it is odd.

gcc/
PR target/99234
* config/i386/i386.c (ix86_compute_frame_layout): For a SEH target,
point the hard frame pointer to the SSE register save area instead
of the general register save area.  Perform only minimal adjustment
for small frames if it is initially not correctly aligned.
(ix86_expand_prologue): Remove early saves for a SEH target.
* config/i386/winnt.c (struct seh_frame_state): Document
constraint.
gcc/testsuite/
* g++.dg/eh/seh-xmm-unwind.C: New test.

[Bug bootstrap/98338] [10/11 Regression] profiledbootstrap failure on x86_64-linux

2021-03-01 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98338

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

https://gcc.gnu.org/g:150bde36c119eff4b8a74667c9d728d6a8a5e8a1

commit r11-7440-g150bde36c119eff4b8a74667c9d728d6a8a5e8a1
Author: Jan Hubicka 
Date:   Mon Mar 1 14:36:11 2021 +0100

Fix ICE in compute_fn_summary

PR ipa/98338
* ipa-fnsummary.c (compute_fn_summary): Fix sanity check.

[Bug c++/99294] [modules] tdef-inst-1 fails with -fno-module-lazy

2021-03-01 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99294

--- Comment #1 from CVS Commits  ---
The master branch has been updated by Nathan Sidwell :

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

commit r11-7441-g2e0bb9eec2d455840bc4773391b3313a320b3c23
Author: Nathan Sidwell 
Date:   Mon Mar 1 05:41:10 2021 -0800

c++: Completeness of typedef structs [PR 99294]

When we read in a class definition, we use fixup_type_variants to
propagate the now-completed fields of the class's TYPE to other
variants.  Unfortunately that doesn't propagate all of them, and in
this case we had a typedef to an (incomplete) instantiation.  That
typedef ended up with a VOIDmode, which blew up gimple expansion as
the type itself isn't VOID.  Without modules, that information is
propagated in finalize_type_size when laying out the class.  But that
doesn't happen with stream-in -- we already know the layout.  There is
already some overlap between the two functions, now there's a bit
more.  In fixup_type_variants, I pay attention to the TYPE_NAME to
decide whether to override a user's TYPE_ALIGN -- variants of the
main-variant typedef just copy the main-variant.  Other variants
recalculate.  Overaligning is still permitted.

I also added a TYPE_ALIGN_RAW accessor, and fixed a bug in the
alignment streaming I noticed.  I did not refactor TYPE_ALIGN beyond
using the new accessor.  (It could be written as ((1 << align_raw) >>
1), rather than use the conditional.)

PR c++/99294
gcc/
* tree.h (TYPE_ALIGN_RAW): New accessor.
(TYPE_ALIGN): Use it.
gcc/cp/
* class.c (fixup_type_variants): Propagate mode, precision,
alignment & emptiness.
* module.cc (trees_out::type_node): Use TYPE_ALIGN_RAW.
(trees_in::tree_node): Rematerialize alignment here.
gcc/testsuite/
* g++.dg/modules/pr99294.h: New.
* g++.dg/modules/pr99294_a.C: New.
* g++.dg/modules/pr99294_b.C: New.

[Bug target/99313] ICE while changing global target options via pragma

2021-03-01 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99313

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

https://gcc.gnu.org/g:4ed0a92f6cfc647e2ad8ceaa1e5709545c915465

commit r11-7442-g4ed0a92f6cfc647e2ad8ceaa1e5709545c915465
Author: Martin Liska 
Date:   Mon Mar 1 15:41:14 2021 +0100

s390: add exceptions for param modified by target pragma

gcc/ChangeLog:

PR target/99313
* optc-save-gen.awk: Add 4 more exceptions.

gcc/testsuite/ChangeLog:

PR target/99313
* gcc.target/s390/target-attribute/pr99313.c: New test.

[Bug target/99271] [10 regression] Wrong code for Arm-v8-m.main CMSE calling __gnu_cmse_nonsecure_call

2021-03-01 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99271

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

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

commit r10-9398-g1b3bb23a576e6a864f540e3bea5097f47fea507c
Author: Richard Earnshaw 
Date:   Mon Feb 22 15:00:53 2021 +

arm: force use of r4 for __gnu_cmse_nonsecure_call when !FPCXT [PR99271]

Commit r10-6017 relaxed the constraint on thumb2 calls to
__gnu_cmse_nonsecure_call to allow any register for the call address.
Although the initial code expansion continues to use r4 with the FPCXT
extension is not enabled, the change was unsafe because subsequent
optimizations could use the additional freedom to change which
register was being used.

To fix this we need to split the output patterns in the machine
description to use distinct recognizers: one with the additional
freedom when FPCXT is enabled an another that retains the original
restrictions when the extension is not available.

gcc:
PR target/99271
* config/arm/thumb2.md (nonsecure_call_reg_thumb2_fpcxt): New
pattern.
(nonsecure_call_value_reg_thumb2_fpcxt): Likewise.
(nonsecure_call_reg_thumb2): Restrict to using r4 for the callee
address and disable when the FPCXT is not available.
(nonsecure_call_value_reg_thumb2): Likewise.

gcc/testsuite:
* gcc.target/arm/cmse/cmse-18.c: New test.

[Bug target/44107] gcc emits frame (epilogue) info incompatible with the darwin {8,9}-unwinder,10-compacter

2021-03-01 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44107

--- Comment #34 from CVS Commits  ---
The master branch has been updated by Iain D Sandoe :

https://gcc.gnu.org/g:491d5b3cf8216f9285a67aa213b9a66b0035137b

commit r11-7443-g491d5b3cf8216f9285a67aa213b9a66b0035137b
Author: Iain Sandoe 
Date:   Mon Jan 18 20:09:10 2021 +

dwarf2unwind : Force the CFA after remember/restore pairs [44107/48097].

This address one of the more long-standing and serious regressions
for Darwin.  GCC emits unwind code by default on the assumption that
the unwinder will be (of have the same capability) as the one in the
current libgcc_s.  For Darwin platforms, this is not the case - some
of them are based on the libgcc_s from GCC-4.2.1 and some are using
the unwinder provided by libunwind (part of the LLVM project). The
latter implementation has gradually adopted a section that deals with
GNU unwind.

The most serious problem for some of the platform versions is in
handling DW_CFA_remember/restore_state pairs.  The DWARF description
talks about these in terms of saving/restoring register rows; this is
what GCC originally did (and is what the unwinders do for the Darwin
versions based on libgcc_s).

However, in r118068, this was changed so that not only the registers
but also the current frame address expression were saved.  The unwind
code assumes that the unwinder will do this; some of Darwin's unwinders
do not, leading to lockups etc.  To date, the only solution has been
to replace the system libgcc_s with a newer one which is not a viable
solution for many end-users (since that means overwritting the one
provided with the system installation).

The fix here provides a target hook that allows the target to specify
that the CFA should be reinstated after a DW_CFA_restore.  This fixes
the issue (and also the closed WONTFIX of 44107).

(As a matter of record, it also fixes reported Java issues if
 backported to GCC-5).

gcc/ChangeLog:

PR target/44107
PR target/48097
* config/darwin-protos.h (darwin_should_restore_cfa_state): New.
* config/darwin.c (darwin_should_restore_cfa_state): New.
* config/darwin.h (TARGET_ASM_SHOULD_RESTORE_CFA_STATE): New.
* doc/tm.texi: Regenerated.
* doc/tm.texi.in: Document TARGET_ASM_SHOULD_RESTORE_CFA_STATE.
* dwarf2cfi.c (connect_traces): If the target requests, restore
the CFA expression after a DW_CFA_restore.
* target.def (TARGET_ASM_SHOULD_RESTORE_CFA_STATE): New hook.

[Bug target/48097] gcc sometimes generates code that uses the buggy libgcc_s unwinder on darwin (originally exposed by Throw_2 failures in libjava testsuite under Xcode 4.0)

2021-03-01 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48097

--- Comment #18 from CVS Commits  ---
The master branch has been updated by Iain D Sandoe :

https://gcc.gnu.org/g:491d5b3cf8216f9285a67aa213b9a66b0035137b

commit r11-7443-g491d5b3cf8216f9285a67aa213b9a66b0035137b
Author: Iain Sandoe 
Date:   Mon Jan 18 20:09:10 2021 +

dwarf2unwind : Force the CFA after remember/restore pairs [44107/48097].

This address one of the more long-standing and serious regressions
for Darwin.  GCC emits unwind code by default on the assumption that
the unwinder will be (of have the same capability) as the one in the
current libgcc_s.  For Darwin platforms, this is not the case - some
of them are based on the libgcc_s from GCC-4.2.1 and some are using
the unwinder provided by libunwind (part of the LLVM project). The
latter implementation has gradually adopted a section that deals with
GNU unwind.

The most serious problem for some of the platform versions is in
handling DW_CFA_remember/restore_state pairs.  The DWARF description
talks about these in terms of saving/restoring register rows; this is
what GCC originally did (and is what the unwinders do for the Darwin
versions based on libgcc_s).

However, in r118068, this was changed so that not only the registers
but also the current frame address expression were saved.  The unwind
code assumes that the unwinder will do this; some of Darwin's unwinders
do not, leading to lockups etc.  To date, the only solution has been
to replace the system libgcc_s with a newer one which is not a viable
solution for many end-users (since that means overwritting the one
provided with the system installation).

The fix here provides a target hook that allows the target to specify
that the CFA should be reinstated after a DW_CFA_restore.  This fixes
the issue (and also the closed WONTFIX of 44107).

(As a matter of record, it also fixes reported Java issues if
 backported to GCC-5).

gcc/ChangeLog:

PR target/44107
PR target/48097
* config/darwin-protos.h (darwin_should_restore_cfa_state): New.
* config/darwin.c (darwin_should_restore_cfa_state): New.
* config/darwin.h (TARGET_ASM_SHOULD_RESTORE_CFA_STATE): New.
* doc/tm.texi: Regenerated.
* doc/tm.texi.in: Document TARGET_ASM_SHOULD_RESTORE_CFA_STATE.
* dwarf2cfi.c (connect_traces): If the target requests, restore
the CFA expression after a DW_CFA_restore.
* target.def (TARGET_ASM_SHOULD_RESTORE_CFA_STATE): New hook.

[Bug ada/99020] ICE in record containing discriminated accesses

2021-03-01 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99020

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Eric Botcazou :

https://gcc.gnu.org/g:3104dbdcf4a2b7766b5570a0fa2d30157082f04e

commit r11-7444-g3104dbdcf4a2b7766b5570a0fa2d30157082f04e
Author: Eric Botcazou 
Date:   Tue Mar 2 01:04:10 2021 +0100

Do not call Set_Cloned_Subtype on private type

Build_Discriminated_Subtype may be invoked on a E_Record_Type_With_Private,
in which case it builds a E_Record_Subtype_With_Private which does not have
the Cloned_Subtype field.

gcc/ada/
PR ada/99020
* sem_ch3.adb (Build_Discriminated_Subtype): Set the Cloned_Subtype
only if the type is not private.

[Bug middle-end/95757] [11 regression] missing warning in gcc.dg/Wstringop-overflow-25.c since r11-1517

2021-03-02 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95757

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

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

commit r11-7448-gff92ede8d269375f800e1b347a48f4698874b4a3
Author: Jakub Jelinek 
Date:   Tue Mar 2 11:49:12 2021 +0100

vrp: Improve register_edge_assert_for [PR95757]

The Wstringop-overflow-25.c testcase doesn't emit one of the expected
warnings on targets that don't do short curcuiting due to target costs
(or e.g. with --param=logical-op-non-short-circuit=0 on all targets).

The problem is that only reassoc2 optimizes:
  _49 ={v} unsigned_value_source;
  if (_49 == 0)
goto ; [50.00%]
  else
goto ; [50.00%]

   [local count: 536870913]:
  if (_49 > 2)
goto ; [50.00%]
  else
goto ; [50.00%]

   [local count: 268435457]:
  _53 = _49 + 1;
into:
  _49 ={v} unsigned_value_source;
  _48 = _49 + 18446744073709551615;
  _1 = _48 > 1;
  if (_1 != 0)
goto ; [50.00%]
  else
goto ; [50.00%]

   [local count: 268435457]:
  _53 = _49 + 1;
(but, note the _1 = _48 > 1; if (_1 != 0)),
then dom3 is run and because of that if (_1 != 0) vs. if (_48 > 1) doesn't
register edge asserts for _48 and _49) and so we don't get
SSA_NAME_RANGE_INFO for _53 (and ditto for vrp2) and only afterwards comes
forwprop4 that canonicalizes it to if (_48 > 1).  While with
--param=logical-op-non-short-circuit=1 it is already reassoc1 that
optimizes
it and forwprop3 that propagates it, so we have on the SSA_NAME
corresponding to _53 above SSA_NAME_RANGE_INFO and during expansion we
warn.

The following patch fixes it by handling those not yet propagated
comparisons into GIMPLE_COND in register_edge_assert_for.  We already
have all the infrastructure there to handle the
--param=logical-op-non-short-circuit=1
| and &s.

2021-03-02  Jakub Jelinek  

PR middle-end/95757
* tree-vrp.c (register_edge_assert_for): Remove superfluous ()s
around
condition.  Call register_edge_assert_for_1 for == 0, != 0, == 1
and
!= 1 comparisons if name is lhs of a comparison.

[Bug c++/96960] [C++20] ICE in tsubst_copy_and_build, at cp/pt.c:20531 from lambda in return-type-requirement

2021-03-02 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96960

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

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

commit r11-7454-ge52f8ec25c0e58ebd083e8370e2fbc8af4120d87
Author: Patrick Palka 
Date:   Tue Mar 2 07:49:29 2021 -0500

c++: Fix satisfaction of placeholder type constraints [PR96443]

This fixes the way we check satisfaction of constraints on placeholder
types in various deduction contexts, and in particular when the
constraint is dependent.

Firstly, when evaluating the return type requirement of a compound
requirement, we currently substitute the outer template arguments into
the constraint before checking satisfaction. But we should instead be
passing in the complete set of template arguments to satisfaction and
not do a prior separate substitution.  Our current approach leads to us
incorrectly rejecting the testcase concepts-return-req2.C below.

Secondly, when checking the constraints on a placeholder variable or
return type, we don't consider the template arguments of the enclosing
context at all.  This leads to bogus errors during satisfaction when the
constraint is dependent as in the testcase concepts-placeholder3.C
below.

In order to fix these two issues, we need to be able to normalize the
constraints on a placeholder 'auto' on demand, which in turn requires us
to know the template parameters that were in scope where the 'auto' was
introduced.  This information currently doesn't seem to be easily available
when we need it, so this patch turns PLACEHOLDER_TYPE_CONSTRAINTS into a
TREE_LIST whose TREE_PURPOSE additionally holds the value of
current_template_parms whence a constrained 'auto' was formed.

This patch also removes some seemingly wrong handling of placeholder
type arguments from tsubst_parameter_mapping.  The code doesn't trigger
with the example used in the comments, because type_uses_auto doesn't
look inside non-deduced contexts such as the operand of decltype.  And
the call to do_auto_deduction seems confused because if 'arg' is a type,
then so is 'parm', and therefore 'init' too is a type, but
do_auto_deduction expects it to be an expression.  Before this patch,
this code was dead (as far as our testsuite can tell), but now it breaks
other parts of this patch, so let's remove it.

gcc/cp/ChangeLog:

PR c++/96443
PR c++/96960
* constraint.cc (type_deducible_p): Don't substitute into the
constraints, and instead just pass 'args' to do_auto_deduction
as the outer template arguments.
(tsubst_parameter_mapping): Remove confused code for handling
placeholder type arguments.
(normalize_placeholder_type_constraint): Define.
(satisfy_constraint_expression): Use it to handle placeholder
'auto' types.
* cp-tree.h (PLACEHOLDER_TYPE_CONSTRAINTS_INFO): Define.
(PLACEHOLDER_TYPE_CONSTRAINTS): Redefine in terms of the above.
* pt.c (tsubst) : Use
PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
(make_constrained_placeholder_type): Set
PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
(do_auto_deduction): Clarify comments about the outer_targs
parameter.  Rework satisfaction of a placeholder type constraint
to pass in the complete set of template arguments directly to
constraints_satisfied_p.
(splice_late_return_type): Use PLACEHOLDER_TYPE_CONSTRAINTS_INFO
instead.  Also rebuild the the constraint info on the new auto.

gcc/testsuite/ChangeLog:

PR c++/96443
PR c++/96960
* g++.dg/concepts/abbrev9.C: New test.
* g++.dg/cpp2a/concepts-lambda15.C: New test.
* g++.dg/cpp2a/concepts-placeholder3.C: New test.
* g++.dg/cpp2a/concepts-return-req2.C: New test.
* g++.dg/cpp2a/concepts-ts1.C: Add dg-bogus directive to the
call to f15 that we expect to accept.

[Bug c++/96443] Incorrect satisfaction value for dependent placeholder return type constraint

2021-03-02 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96443

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

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

commit r11-7454-ge52f8ec25c0e58ebd083e8370e2fbc8af4120d87
Author: Patrick Palka 
Date:   Tue Mar 2 07:49:29 2021 -0500

c++: Fix satisfaction of placeholder type constraints [PR96443]

This fixes the way we check satisfaction of constraints on placeholder
types in various deduction contexts, and in particular when the
constraint is dependent.

Firstly, when evaluating the return type requirement of a compound
requirement, we currently substitute the outer template arguments into
the constraint before checking satisfaction. But we should instead be
passing in the complete set of template arguments to satisfaction and
not do a prior separate substitution.  Our current approach leads to us
incorrectly rejecting the testcase concepts-return-req2.C below.

Secondly, when checking the constraints on a placeholder variable or
return type, we don't consider the template arguments of the enclosing
context at all.  This leads to bogus errors during satisfaction when the
constraint is dependent as in the testcase concepts-placeholder3.C
below.

In order to fix these two issues, we need to be able to normalize the
constraints on a placeholder 'auto' on demand, which in turn requires us
to know the template parameters that were in scope where the 'auto' was
introduced.  This information currently doesn't seem to be easily available
when we need it, so this patch turns PLACEHOLDER_TYPE_CONSTRAINTS into a
TREE_LIST whose TREE_PURPOSE additionally holds the value of
current_template_parms whence a constrained 'auto' was formed.

This patch also removes some seemingly wrong handling of placeholder
type arguments from tsubst_parameter_mapping.  The code doesn't trigger
with the example used in the comments, because type_uses_auto doesn't
look inside non-deduced contexts such as the operand of decltype.  And
the call to do_auto_deduction seems confused because if 'arg' is a type,
then so is 'parm', and therefore 'init' too is a type, but
do_auto_deduction expects it to be an expression.  Before this patch,
this code was dead (as far as our testsuite can tell), but now it breaks
other parts of this patch, so let's remove it.

gcc/cp/ChangeLog:

PR c++/96443
PR c++/96960
* constraint.cc (type_deducible_p): Don't substitute into the
constraints, and instead just pass 'args' to do_auto_deduction
as the outer template arguments.
(tsubst_parameter_mapping): Remove confused code for handling
placeholder type arguments.
(normalize_placeholder_type_constraint): Define.
(satisfy_constraint_expression): Use it to handle placeholder
'auto' types.
* cp-tree.h (PLACEHOLDER_TYPE_CONSTRAINTS_INFO): Define.
(PLACEHOLDER_TYPE_CONSTRAINTS): Redefine in terms of the above.
* pt.c (tsubst) : Use
PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
(make_constrained_placeholder_type): Set
PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
(do_auto_deduction): Clarify comments about the outer_targs
parameter.  Rework satisfaction of a placeholder type constraint
to pass in the complete set of template arguments directly to
constraints_satisfied_p.
(splice_late_return_type): Use PLACEHOLDER_TYPE_CONSTRAINTS_INFO
instead.  Also rebuild the the constraint info on the new auto.

gcc/testsuite/ChangeLog:

PR c++/96443
PR c++/96960
* g++.dg/concepts/abbrev9.C: New test.
* g++.dg/cpp2a/concepts-lambda15.C: New test.
* g++.dg/cpp2a/concepts-placeholder3.C: New test.
* g++.dg/cpp2a/concepts-return-req2.C: New test.
* g++.dg/cpp2a/concepts-ts1.C: Add dg-bogus directive to the
call to f15 that we expect to accept.

[Bug bootstrap/98338] [10/11 Regression] profiledbootstrap failure on x86_64-linux

2021-03-02 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98338

--- Comment #26 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Jan Hubicka
:

https://gcc.gnu.org/g:62125ef043e19c58780bc06d0e2f2221bbbf28f6

commit r10-9401-g62125ef043e19c58780bc06d0e2f2221bbbf28f6
Author: Jan Hubicka 
Date:   Mon Mar 1 14:36:11 2021 +0100

Fix ICE in compute_fn_summary

PR ipa/98338
* ipa-fnsummary.c (compute_fn_summary): Fix sanity check.

(cherry picked from commit 150bde36c119eff4b8a74667c9d728d6a8a5e8a1)

[Bug ada/99095] [10/11 regression] issue with function returning unconstrained array of limited record

2021-03-02 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99095

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Eric Botcazou :

https://gcc.gnu.org/g:168b75ff54b4e70650b8709816edff13f93e737a

commit r11-7456-g168b75ff54b4e70650b8709816edff13f93e737a
Author: Eric Botcazou 
Date:   Tue Mar 2 17:58:46 2021 +0100

Fix PR ada/99095

This is a regression present on the mainline and 10 branch, where we fail
to make the bounds explicit for the return value of a function returning
an unconstrained array of a limited record type.

gcc/ada/
PR ada/99095
* sem_ch8.adb (Check_Constrained_Object): Restrict again the
special
optimization for limited types to non-array types except in the
case
of an extended return statement.
gcc/testsuite/
* gnat.dg/limited5.adb: New test.

[Bug ada/99095] [10/11 regression] issue with function returning unconstrained array of limited record

2021-03-02 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99095

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

https://gcc.gnu.org/g:7297af89ea22c1a1da8609d811e100cf73e574d6

commit r10-9402-g7297af89ea22c1a1da8609d811e100cf73e574d6
Author: Eric Botcazou 
Date:   Tue Mar 2 17:58:46 2021 +0100

Fix PR ada/99095

This is a regression present on the mainline and 10 branch, where we fail
to make the bounds explicit for the return value of a function returning
an unconstrained array of a limited record type.

gcc/ada/
PR ada/99095
* sem_ch8.adb (Check_Constrained_Object): Restrict again the
special
optimization for limited types to non-array types except in the
case
of an extended return statement.
gcc/testsuite/
* gnat.dg/limited5.adb: New test.

[Bug debug/99319] DW_MACRO_define_strp uses uleb128 for second operand

2021-03-02 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99319

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

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

commit r11-7457-g5a233ae4d8c978a3c863c8199d6c3050389a84d1
Author: Jakub Jelinek 
Date:   Tue Mar 2 18:25:45 2021 +0100

dwarf2out: Fix up split-dwarf .debug_macro handling [PR99319]

The -gsplit-dwarf changes came a few months after .debug_macro
and the r0-120109 changes just changed the 2nd operand of
DW_MACRO_GNU_{define,undef}_indirect from the usual .debug_str
section offset argument to leb128 index into .debug_str_offsets
without changing the opcodes.

DWARF5 standardized different opcodes for those, but GCC hasn't been
changed
yet for that.
This patch starts using DW_MACRO_define_strx and DW_MACRO_undef_strx
instead of DW_MACRO_define_strp and DW_MACRO_undef_strp when -gsplit-dwarf
-gdwarf-5 -g3.  I'm not sure what to do if anything with the -gdwarf-4
-gsplit-dwarf -g3 -gno-strict-dwarf case, we've been emitting it that way
for 8 years and it is an extension, so presumably the consumers that cared
have already hacks to handle DW_MACRO_GNU_{define,undef}_indirect
differently in .debug_macro 4 sections depending on if it is
.debug_macro.dwo or .debug_macro.
Another change the patch does is that it will use
DW_MACRO_{define,undef}_str{p,x} even with -gdwarf-5 -gstrict-dwarf -g3,
for DWARF 4 we were doing that only for -gno-strict-dwarf as we've emitted
.debug_macro section only in that case.

2021-03-02  Jakub Jelinek  

PR debug/99319
* dwarf2out.c (output_macinfo_op): Use DW_MACRO_*_str* even with
-gdwarf-5 -gstrict-dwarf.  For -gsplit-dwarf -gdwarf-5 use
DW_MACRO_*_strx instead of DW_MACRO_*_strp.  Handle
DW_MACRO_define_strx and DW_MACRO_undef_strx.
(save_macinfo_strings): Use DW_MACRO_*_str* even with
-gdwarf-5 -gstrict-dwarf.  Handle DW_MACRO_define_strx and
DW_MACRO_undef_strx.

[Bug c++/99251] [11 Regression] inconsistent -Wnonnull warning behaviour with dynamic_cast

2021-03-02 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99251

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

https://gcc.gnu.org/g:66ecb059c9d77cfcfb06cbdc3cac6a63b9e67f3d

commit r11-7458-g66ecb059c9d77cfcfb06cbdc3cac6a63b9e67f3d
Author: Martin Sebor 
Date:   Tue Mar 2 11:12:50 2021 -0700

PR c++/99251 - inconsistent -Wnonnull warning behaviour with dynamic_cast

gcc/cp/ChangeLog:

PR c++/99251
* class.c (build_base_path): Call build_if_nonnull.
* cp-tree.h (build_if_nonnull): Declare.
* rtti.c (ifnonnull): Rename...
(build_if_nonnull): ...to this.  Set no-warning bit on COND_EXPR.
(build_dynamic_cast_1): Adjust to name change.

gcc/testsuite/ChangeLog:

PR c++/99251
* g++.dg/warn/Wnonnull9.C: Expect no warnings.
* g++.dg/warn/Wnonnull12.C: New test.

[Bug c/99295] [9/10/11 Regression] documentation on __attribute__((malloc)) is wrong

2021-03-02 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99295

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

https://gcc.gnu.org/g:397ed1dbffe6c4a48548b601b35699e571e200a3

commit r11-7459-g397ed1dbffe6c4a48548b601b35699e571e200a3
Author: Martin Sebor 
Date:   Tue Mar 2 11:19:49 2021 -0700

PR middle-end/99295 - documentation on __attribute__((malloc)) is wrong

gcc/ChangeLog:

PR middle-end/99295
* doc/extend.texi (attribute malloc): Reword and clarify
nonaliasing
property.

[Bug c/99276] grammar in diagnostics for overflowing the destination

2021-03-02 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99276

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

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

commit r11-7460-ge7ca37649e4f322e7512c6d11813992c61b0a4b3
Author: Martin Sebor 
Date:   Tue Mar 2 13:37:01 2021 -0700

PR middle-end/99276 - grammar in diagnostics for overflowing the
destination

gcc/ChangeLog:

PR middle-end/99276
* builtins.c (warn_for_access): Remove stray warning text.

[Bug c/99323] [9/10/11 Regression] ICE in add_hint, at diagnostic-show-locus.c:2234 since r8-379-gd1b5f5cc3cfd148e

2021-03-02 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99323

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

https://gcc.gnu.org/g:41fbacdd10305654b1d10f887fa3f4677f9b8f34

commit r11-7461-g41fbacdd10305654b1d10f887fa3f4677f9b8f34
Author: David Malcolm 
Date:   Tue Mar 2 15:46:06 2021 -0500

diagnostics: fix ICE on fix-it hints on very long lines [PR99323]

PR c/99323 describes an ICE due to a failed assertion deep inside the
fix-it printing machinery, where the fix-it hints on one line have not
been properly sorted in layout's constructor.

The underlying issue occurs when multiple fix-it hints affect a line
wider that LINE_MAP_MAX_COLUMN_NUMBER, where the location_t values for
characters after that threshold fall back to having column zero.

It's not meaningful to try to handle fix-it hints without column
information, so this patch rejects them as they are added to the
rich_location, falling back to the "no fix-it hints on this diagnostic"
case, fixing the crash.

gcc/ChangeLog:
PR c/99323
* diagnostic-show-locus.c
(selftest::test_one_liner_many_fixits_2): Fix accidental usage of
column 0.

gcc/testsuite/ChangeLog:
PR c/99323
* gcc.dg/pr99323-1.c: New test.
* gcc.dg/pr99323-2.c: New test.

libcpp/ChangeLog:
PR c/99323
* line-map.c (rich_location::maybe_add_fixit): Reject fix-it hints
at column 0.

[Bug libbacktrace/98818] [libbacktrace] Don't throw fatal error for unsupported dwarf version

2021-03-02 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98818

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Ian Lance Taylor :

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

commit r11-7462-gdf003d1e0bf2d0a8e2ed45a323d4e974b15dc95f
Author: Ian Lance Taylor 
Date:   Tue Mar 2 13:45:56 2021 -0800

libbacktrace: pass -1 to error callback for unrecognized DWARF

PR libbacktrace/98818
* dwarf.c (dwarf_buf_error): Add errnum parameter.  Change all
callers.
* backtrace.h: Update backtrace_error_callback comment.

[Bug bootstrap/98590] [11 regression] Bootstrap failure with Ada on Cygwin since switch to C++11

2021-03-02 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98590

--- Comment #13 from CVS Commits  ---
The master branch has been updated by Jeff Law :

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

commit r11-7464-g8b6ebc025cf2b25fdc1e8f6e6261701dc71bac74
Author: Mikael Pettersson 
Date:   Tue Mar 2 15:20:06 2021 -0700

[PATCH] Fix Ada bootstrap failure on Cygwin since switch to C++11 (PR98590)

gcc/ada
PR bootstrap/98590
* cstreams.c: Ensure fileno_unlocked() is visible on Cygwin.

[Bug c++/96078] [10/11 Regression] flatten attribute on constructor and destructor causes spurious warning

2021-03-02 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96078

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

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

commit r11-7469-gf8e7f3f3f33e22721a28772cc3f9b616e48cd1c9
Author: Jason Merrill 
Date:   Thu Feb 11 22:01:19 2021 -0500

cgraph: flatten and same_body aliases [PR96078]

The patch for PR92372 made us start warning about a flatten attribute on an
alias.  But in the case of C++ 'tor base/complete variants, the user didn't
create the alias.  If the alias target also has the attribute, the alias
points to a flattened function, so we shouldn't warn.

gcc/ChangeLog:

PR c++/96078
* cgraphunit.c (process_function_and_variable_attributes): Don't
warn about flatten on an alias if the target also has it.
* cgraph.h (symtab_node::get_alias_target_tree): New.

gcc/testsuite/ChangeLog:

PR c++/96078
* g++.dg/ext/attr-flatten1.C: New test.

[Bug libfortran/81986] sanitizer detects negation of large number in string.c

2021-03-02 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81986

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

https://gcc.gnu.org/g:006693a59f7cd1310aed53a2816020bedf1fb742

commit r11-7470-g006693a59f7cd1310aed53a2816020bedf1fb742
Author: Tobias Burnus 
Date:   Wed Mar 3 08:05:45 2021 +0100

libgfortran: Fix negation for largest integer [PR81986]

libgfortran/ChangeLog:
2021-03-01  Vittorio Zecca  
Tobias Burnus  

PR libfortran/81986
* runtime/string.c (gfc_itoa): Cast to unsigned before
negating.

[Bug rtl-optimization/99085] [10/11 Regression] ICE: verify_flow_info failed (error: multiple hot/cold transitions found)

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99085

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

https://gcc.gnu.org/g:4ad5b1915d50cc39691487f58794d699c7900ace

commit r11-7471-g4ad5b1915d50cc39691487f58794d699c7900ace
Author: Jakub Jelinek 
Date:   Wed Mar 3 09:51:54 2021 +0100

cfgrtl: Fix up fixup_partitions caused ICE [PR99085]

fixup_partitions sometimes changes some basic blocks from hot partition to
cold partition, in particular if after unreachable block removal or other
optimizations a hot partition block is dominated by cold partition
block(s).
It fixes up the edges and jumps on those edges, but when after reorder
blocks and in rtl (non-cfglayout) mode that is clearly not enough, because
it keeps the block order the same and so we can end up with more than
1 hot/cold section transition in the same function.

So, this patch fixes that up too.

2021-03-03  Jakub Jelinek  

PR target/99085
* cfgrtl.c (fixup_partitions): When changing some bbs from hot to
cold
partitions, if in non-layout mode after reorder_blocks also move
affected blocks to ensure a single partition transition.

* gcc.dg/graphite/pr99085.c: New test.

[Bug debug/99090] gsplit-dwarf broken on riscv64-linux

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99090

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

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

commit r11-7472-gb5040344b9ca609e19ee59ba56cd4af9697a1692
Author: Jakub Jelinek 
Date:   Wed Mar 3 09:53:58 2021 +0100

dwarf2out: Fix -gsplit-dwarf on riscv or other non-.uleb128 targets
[PR99090]

As mentioned in the PR, riscv* only supports .uleb128 with constant
arguments, doesn't support difference of two labels because of aggressive
linker relaxations.  But I bet various other targets, especially those not
using GNU assembler, might suffer from the same problem.
As the FIXME comment in output_loc_list indicates, we ICE on
-gsplit-dwarf on those targets whenever we need .debug_loclists, because
we only emit DW_LLE_startx_length which requires working .uleb128 delta
of 2 code section labels.  We can't use DW_LLE_base_addressx
once followed by DW_LLE_offset_pair either because the latter suffers
from the same issue - need .uleb128 difference of code section labels
(and in that case not just for the second operand but also for the first).

So, this patch implements what the comment said and emits
DW_LLE_startx_endx
instead, which wastes more space in .debug_addr, but will work.

Bootstrapped/regtested on x86_64-linux and i686-linux and as written in the
PR, Jim has tested it on riscv*linux.  Ok for trunk?

BTW, for HAVE_AS_LEB128 -gdwarf-5 -gsplit-dwarf, maybe we should consider
instead of always emitting DW_LLE_startx_length do all the optimizations
that we do for HAVE_AS_LEB128 -gdwarf-5, or at least a subset of them.
For !have_multiple_function_sections, we in that case emit just
DW_LLE_offset_pair (that can certainly be a win for small TUs, we wouldn't
need any .debug_addr entry in that case; on the other side, just using
DW_LLE_offset_pair can be harmful for very large TUs especially if the
loclist has many entries, emitting in that case a single
DW_LLE_base_address
or for -gsplit-dwarf DW_LLE_base_addressx followed by DW_LLE_offset_pair
might be much smaller), and for have_multiple_function_sections figuring
out if DW_LLE_base_address followed by DW_LLE_offset_pair entries
or DW_LLE_start_length is bettter.  So perhaps a middle-ground for
-gsplit-dwarf would be to always do the have_multiple_function_sections
behavior, i.e. DW_LLE_base_addressx followed by DW_LLE_offset_pair vs.
DW_LLE_startx_length decisions based on the ranges and their counts.
And perhaps dwz could optimize afterwards, on linked binaries or shared
libraries it knows all the offsets and could figure out optimal DW_LLE_*.

2021-03-03  Jakub Jelinek  

PR debug/99090
* dwarf2out.c (dw_loc_list_struct): Add end_entry member.
(new_loc_list): Clear end_entry.
(output_loc_list): Only use DW_LLE_startx_length for -gsplit-dwarf
if HAVE_AS_LEB128, otherwise use DW_LLE_startx_endx.  Fix comment
typo.
(index_location_lists): For dwarf_version >= 5 without
HAVE_AS_LEB128,
initialize also end_entry.

[Bug c/99324] [8/9/10/11 Regression] ICE in mark_addressable, at gimple-expr.c:918 since r6-314

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99324

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

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

commit r11-7473-gba09d11a9d0ae2382bab715b102a7746d20dea6d
Author: Jakub Jelinek 
Date:   Wed Mar 3 09:55:19 2021 +0100

c-family: Avoid ICE on va_arg [PR99324]

build_va_arg calls the middle-end mark_addressable, which e.g. requires
that
cfun is non-NULL.  The following patch calls instead
c_common_mark_addressable_vec
which is the c-family variant similarly to the FE c_mark_addressable and
cxx_mark_addressable, except that it doesn't error on addresses of register
variables.  As the taking of the address is artificial for the .VA_ARG
ifn and when that is lowered goes away, it is similar case to the vector
subscripting for which c_common_mark_addressable_vec has been added.

2021-03-03  Jakub Jelinek  

PR c/99324
* c-common.c (build_va_arg): Call c_common_mark_addressable_vec
instead of mark_addressable.  Fix a comment typo -
neutrallly -> neutrally.

* gcc.c-torture/compile/pr99324.c: New test.

[Bug debug/98656] [9/10 Regression] switchlower_O0 drops line number of switch

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98656

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

https://gcc.gnu.org/g:186573a26a19e6e6523d86739248953042735372

commit r10-9404-g186573a26a19e6e6523d86739248953042735372
Author: Tom de Vries 
Date:   Fri Feb 5 10:36:38 2021 +0100

debug: fix switch lowering debug info

gcc/ChangeLog:

PR debug/98656
* tree-switch-conversion.c (jump_table_cluster::emit): Add loc
argument.
(bit_test_cluster::emit): Reuse location_t for newly created
gswitch statement.
(switch_decision_tree::try_switch_expansion): Preserve
location_t.
* tree-switch-conversion.h: Change function signatures.

(cherry picked from commit 4ede02a5f2af1205434f0e05aaaeff762b24e329)

[Bug target/99321] [11 Regression] ICE: in extract_constrain_insn, at recog.c:2670: insn does not satisfy its constraints: {*uminv16qi3} since r11-7121-g37876976b0511ec9

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99321

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

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

commit r11-7474-gf1b13064609a41fcaf4d1859663453bba237e277
Author: Jakub Jelinek 
Date:   Wed Mar 3 10:06:14 2021 +0100

i386: Fix a peephole2 for -mavx512vl -mno-avx512bw [PR99321]

As the testcase shows, the
(define_peephole2
  [(set (match_operand 0 "sse_reg_operand")
(match_operand 1 "sse_reg_operand"))
   (set (match_dup 0)
(match_operator 3 "commutative_operator"
  [(match_dup 0)
   (match_operand 2 "memory_operand")]))]
peephole2 can for AVX512VL without AVX512BW (I guess it is a hyphothetical
CPU, but unfortunately they are separate CPUID bits and we have separate
options for them) turn something that is valid without that peephole2
into something that is invalid (and in this case ICEs).
The problem is that the vpadd[bw], vpmullw, vpmin[su][bw] and vpmax[su][bw]
instructions require both AVX512BW and AVX512VL when they have
16-byte or 32-byte operands.  If operands[0] is %[xy]mm0 .. %[xy]mm15
but operands[1] is %[xy]mm16 .. %[xy]mm31, then before we have
a vector move which uses vmovdqa{32,64} and doesn't need AVX512BW,
AVX512VL is I think implied from HARD_REGNO_MODE_OK only supporting
V{16Q,32Q,8H,16H}imode in EXT_REX_SSE_REGNO_P regs with AVX512VL, and then
we have a commutative operation with that %[xy]mm0 .. %[xy]mm15 destination
and one source and a memory operand, so VEX encoded operation.
And, the peephole2 wants to replace it with a load into the destination
register from memory (ok) and then the commutative arith instruction.
But that needs EVEX encoding because of the high register and so requires
AVX512BW which might not be enabled.
The exception is and/ior/xor, because the hw doesn't have
vp{and,or,xor}{b,w} instructions at all, it uses vp{and,or,xor}d instead
and that of course doesn't need AVX512BW.

BTW, there are other bugs I need to look at, while the vp{min,max}ub with
16-byte operands instruction properly requires avx512bw for v constraints
and otherwise uses x, e.g. the vpadd[bw] etc. instructions don't.
I'll try to handle that incrementally later this week.

2021-03-03  Jakub Jelinek  

PR target/99321
* config/i386/predicates.md (logic_operator): New define_predicate.
* config/i386/i386.md (mov + mem using comm arith peephole2):
Punt if operands[1] is EXT_REX_SSE_REGNO_P, AVX512BW is not enabled
and the inner mode is [QH]Imode.

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

[Bug tree-optimization/97897] ICE tree check: expected ssa_name, have integer_cst in compute_optimized_partition_bases, at tree-ssa-coalesce.c:1638

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97897

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

https://gcc.gnu.org/g:9272936ac5fac472a3690145572afa6ed19eaa8e

commit r10-9405-g9272936ac5fac472a3690145572afa6ed19eaa8e
Author: Richard Biener 
Date:   Thu Nov 19 09:06:50 2020 +0100

tree-optimization/97897 - complex lowering on abnormal edges

This fixes complex lowering to not put constants into abnormal
edge PHI values by making sure abnormally used SSA names are
VARYING in its propagation lattice.

2020-11-19  Richard Biener  

PR tree-optimization/97897
* tree-complex.c (complex_propagate::visit_stmt): Make sure
abnormally used SSA names are VARYING.
(complex_propagate::visit_phi): Likewise.

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

[Bug tree-optimization/98526] [10 Regression] Double-counting of reduction cost

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98526

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

https://gcc.gnu.org/g:4f0d8562af81709db39d783dd2bf98af28ec

commit r10-9406-g4f0d8562af81709db39d783dd2bf98af28ec
Author: Richard Biener 
Date:   Mon Jan 11 11:47:46 2021 +0100

tree-optimization/98526 - fix vectorizer reduction cost

This fixes a double-counting in the reduction cost when vectorizing
the reduction through the regular vectorizable_* functions.

2021-01-11  Richard Biener  

PR tree-optimization/98526
* tree-vect-loop.c (vect_model_reduction_cost): Remove costing
of the actual reduction op for the regular case.
(vectorizable_reduction): Cost the stmts
vect_transform_reduction produces here.

(cherry picked from commit 04bff1bbfc11a974342c0eb0c0d65d902e36e82e)

[Bug tree-optimization/98640] [10 Regression] GCC produces incorrect code with -O1 and higher since r10-2711-g3ed01d5408045d80

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98640

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

https://gcc.gnu.org/g:268b54382e5248ee1a5e3f4a0841358e03290d17

commit r10-9407-g268b54382e5248ee1a5e3f4a0841358e03290d17
Author: Richard Biener 
Date:   Wed Jan 13 09:43:52 2021 +0100

tree-optimization/98640 - fix bogus sign-extension with VN

VN tried to express a sign extension from int to long of
a trucated quantity with a plain conversion but that loses the
truncation.  Since there's no single operand doing truncate plus
sign extend (there was a proposed SEXT_EXPR to do that at some
point mapping to RTL sign_extract) don't bother to appropriately
model this with two ops (which the VN insert machinery doesn't
handle and which is unlikely to CSE fully).

2021-01-13  Richard Biener  

PR tree-optimization/98640
* tree-ssa-sccvn.c (visit_nary_op): Do not try to
handle plus or minus from a truncated operand to be
sign-extended.

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

(cherry picked from commit ffd28c265e6d611983cd27e9332dc799039a3f04)

[Bug tree-optimization/98758] [9/10 Regression] ice in lambda_matrix_right_hermite by r9-3927

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98758

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

https://gcc.gnu.org/g:85977f624a34eac309f9d77a58164553dfc82975

commit r10-9408-g85977f624a34eac309f9d77a58164553dfc82975
Author: Richard Biener 
Date:   Wed Jan 20 08:48:34 2021 +0100

tree-optimization/98758 - fix integer arithmetic in data-ref analysis

This fixes some int arithmetic issues and a bogus truncation.

2021-01-20  Richard Biener  

PR tree-optimization/98758
* tree-data-ref.c (int_divides_p): Use lambda_int arguments.
(lambda_matrix_right_hermite): Avoid undefinedness with
signed integer abs and multiplication.
(analyze_subscript_affine_affine): Use lambda_int.

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

(cherry picked from commit 34599780d0de72faf5719ea08d11a061722b9d19)

[Bug target/99234] [10/11 regression] wrong result for 1.0/3.0 with -O2 -fno-omit-frame-pointer -frounding-math

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99234

--- Comment #24 from CVS Commits  ---
The master branch has been updated by Eric Botcazou :

https://gcc.gnu.org/g:357c4350680bf29f0c7a115424e3da11c53b5582

commit r11-7475-g357c4350680bf29f0c7a115424e3da11c53b5582
Author: Eric Botcazou 
Date:   Wed Mar 3 12:25:03 2021 +0100

Fix ICE with pathologically large frames

gcc/
PR target/99234
* config/i386/i386.c (ix86_compute_frame_layout): For a SEH target,
point back the hard frame pointer to its default location when the
frame is larger than SEH_MAX_FRAME_SIZE.

[Bug target/99234] [10/11 regression] wrong result for 1.0/3.0 with -O2 -fno-omit-frame-pointer -frounding-math

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99234

--- Comment #25 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Eric Botcazou
:

https://gcc.gnu.org/g:2939b358936bb824330888def98ad848dea41483

commit r10-9409-g2939b358936bb824330888def98ad848dea41483
Author: Eric Botcazou 
Date:   Wed Mar 3 12:25:03 2021 +0100

Fix ICE with pathologically large frames

gcc/
PR target/99234
* config/i386/i386.c (ix86_compute_frame_layout): For a SEH target,
point back the hard frame pointer to its default location when the
frame is larger than SEH_MAX_FRAME_SIZE.

[Bug target/99234] [10/11 regression] wrong result for 1.0/3.0 with -O2 -fno-omit-frame-pointer -frounding-math

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99234

--- Comment #26 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Eric Botcazou
:

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

commit r9-9261-gd57d8bb5c528397e8fc21f82f098ad96568ea67f
Author: Eric Botcazou 
Date:   Wed Mar 3 12:25:03 2021 +0100

Fix ICE with pathologically large frames

gcc/
PR target/99234
* config/i386/i386.c (ix86_compute_frame_layout): For a SEH target,
point back the hard frame pointer to its default location when the
frame is larger than SEH_MAX_FRAME_SIZE.

[Bug c++/99344] [modules] import failure with intermediate namespace

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99344

--- Comment #1 from CVS Commits  ---
The master branch has been updated by Nathan Sidwell :

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

commit r11-7477-g8c4f0c0ceb346e7deb69a44688faab6103aa57da
Author: Nathan Sidwell 
Date:   Fri Feb 26 07:51:13 2021 -0800

c++: namespace reachability [PR 99344]

This reworks namespace serializing to avoid some issues I ran into
when working on 99170.  In modules, (non-anonymous) namespaces are
strange beasts, that always have external linkage, but may have
module-specific visibility.  I still don't get the latter 100%
correct, but this is in the right direction.

PR c++/99344
gcc/cp/
* module.cc (trees_out::decl_node): Small refactor.
(depset::hash::add_binding_entity): Return true on meeting an
import.  Set namespace's import here.
(module_state:write_namespaces): Inform of purview too.
(module_state:read_namespaces): Adjust.
* name-lookup.c (implicitly_export_namespace): Delete.
(do_pushdecl): Don't call it.
(push_namespace): Likewise, set purview.
(add_imported_namespace): Reorder parms.
* name-lookup.h (add_imported_namespace): Alter param ordering.
gcc/testsuite/
* g++.dg/modules/namespace-2_a.C
* g++.dg/modules/pr99344_a.C
* g++.dg/modules/pr99344_b.C

[Bug gcov-profile/97461] [11 Regression] allocate_gcov_kvp() deadlocks in firefox LTO+PGO build (overridden malloc() recursion)

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97461

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

https://gcc.gnu.org/g:00d79dc4be0b86ec564cfa2b32c47de6c07449e6

commit r11-7479-g00d79dc4be0b86ec564cfa2b32c47de6c07449e6
Author: Martin Liska 
Date:   Wed Jan 13 11:17:03 2021 +0100

gcov: use mmap pools for KVP.

gcc/ChangeLog:

PR gcov-profile/97461
* gcov-io.h (GCOV_PREALLOCATED_KVP): Remove.

libgcc/ChangeLog:

PR gcov-profile/97461
* config.in: Regenerate.
* configure: Likewise.
* configure.ac: Check sys/mman.h header file
* libgcov-driver.c (struct gcov_kvp): Remove static
pre-allocated pool and use a dynamic one.
* libgcov.h (MMAP_CHUNK_SIZE): New.
(gcov_counter_add): Use mmap to allocate pool for struct
gcov_kvp.

[Bug c++/95675] [8/9/10/11 Regression] internal compiler error: in build_over_call

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95675

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

https://gcc.gnu.org/g:74aee6d20872e8d87558eb5bf601042e3ed3fb2a

commit r11-7481-g74aee6d20872e8d87558eb5bf601042e3ed3fb2a
Author: Jason Merrill 
Date:   Tue Mar 2 23:59:00 2021 -0500

c++: C++17 and decltype of multi-operator expression [PR95675]

A call that is the immediate operand of decltype has special semantics: no
temporary is produced, so it's OK for the return type to be e.g.
incomplete.
But we were treating (e | f) the same way, which confused overload
resolution when we then tried to evaluate ... | g.

Fixed by making build_temp do what its name says, and force the C++17
temporary materialization conversion.

gcc/cp/ChangeLog:

PR c++/95675
* call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
if it didn't get one before.

gcc/testsuite/ChangeLog:

PR c++/95675
* g++.dg/cpp0x/decltype-call5.C: New test.
* g++.dg/cpp0x/decltype-call6.C: New test.

[Bug c++/99009] [9/10/11 Regression] ICE in type_dependent_expression_p, at cp/pt.c:27265

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99009

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Marek Polacek :

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

commit r11-7483-g1dabbfb0f4a9fbdc77e1ea4db7302586f00895e1
Author: Marek Polacek 
Date:   Fri Feb 12 12:21:15 2021 -0500

c++: ICE with deduction guide in checking type-dep [PR99009, PR97034]

We represent deduction guides with FUNCTION_DECLs, but they are built
without DECL_CONTEXT, leading to an ICE in type_dependent_expression_p
on the assert that the type of a function template with no dependent
(innermost!) template arguments must be non-dependent.  Consider the
attached class-deduction79.C: we create a deduction guide:

  template G(T)-> E::G

we deduce T and create a partial instantiation:

  G(T) -> E::G [with T = int]

And then do_class_deduction wants to create a CALL_EXPR from the above
using build_new_function_call -> build_over_call which calls mark_used
-> maybe_instantiate_noexcept -> type_dependent_expression_p.

There, the innermost template arguments are non-dependent (), but
the fntype is dependent -- the return type is a TYPENAME_TYPE, and
since we have no DECL_CONTEXT, this check holds:

  /* Otherwise, if the function decl isn't from a dependent scope, it can't
be
 type-dependent.  Checking this is important for functions with auto
return
 type, which looks like a dependent type.  */
  if (TREE_CODE (expression) == FUNCTION_DECL
  && !(DECL_CLASS_SCOPE_P (expression)
   && dependent_type_p (DECL_CONTEXT (expression)))

whereupon we ICE.

This patch fixes it by deferring the class deduction until the
enclosing scope is non-dependent.  build_deduction_guide and
maybe_aggr_guide
needed a little tweaking to make the deduction work in a member
template.

Co-Authored-By: Jason Merrill 

gcc/cp/ChangeLog:

PR c++/97034
PR c++/99009
* pt.c (build_deduction_guide): Use INNERMOST_TEMPLATE_ARGS.
(maybe_aggr_guide): Use the original template type where needed. 
In
a class member template, partially instantiate the result of
collect_ctor_idx_types.
(do_class_deduction): Defer the deduction until the enclosing
scope is non-dependent.

gcc/testsuite/ChangeLog:

PR c++/97034
PR c++/99009
* g++.dg/cpp1z/class-deduction81.C: New test.
* g++.dg/cpp1z/class-deduction82.C: New test.
* g++.dg/cpp2a/class-deduction-aggr8.C: New test.
* g++.dg/cpp2a/class-deduction-aggr9.C: New test.
* g++.dg/cpp2a/class-deduction-aggr10.C: New test.

[Bug c++/97034] [11 Regression] ICE on C++20 code: gcc_assert failure in return type deduction (gcc/cp/pt.c:26984 in type_dependent_expression_p(tree_node*))

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97034

--- Comment #9 from CVS Commits  ---
The master branch has been updated by Marek Polacek :

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

commit r11-7483-g1dabbfb0f4a9fbdc77e1ea4db7302586f00895e1
Author: Marek Polacek 
Date:   Fri Feb 12 12:21:15 2021 -0500

c++: ICE with deduction guide in checking type-dep [PR99009, PR97034]

We represent deduction guides with FUNCTION_DECLs, but they are built
without DECL_CONTEXT, leading to an ICE in type_dependent_expression_p
on the assert that the type of a function template with no dependent
(innermost!) template arguments must be non-dependent.  Consider the
attached class-deduction79.C: we create a deduction guide:

  template G(T)-> E::G

we deduce T and create a partial instantiation:

  G(T) -> E::G [with T = int]

And then do_class_deduction wants to create a CALL_EXPR from the above
using build_new_function_call -> build_over_call which calls mark_used
-> maybe_instantiate_noexcept -> type_dependent_expression_p.

There, the innermost template arguments are non-dependent (), but
the fntype is dependent -- the return type is a TYPENAME_TYPE, and
since we have no DECL_CONTEXT, this check holds:

  /* Otherwise, if the function decl isn't from a dependent scope, it can't
be
 type-dependent.  Checking this is important for functions with auto
return
 type, which looks like a dependent type.  */
  if (TREE_CODE (expression) == FUNCTION_DECL
  && !(DECL_CLASS_SCOPE_P (expression)
   && dependent_type_p (DECL_CONTEXT (expression)))

whereupon we ICE.

This patch fixes it by deferring the class deduction until the
enclosing scope is non-dependent.  build_deduction_guide and
maybe_aggr_guide
needed a little tweaking to make the deduction work in a member
template.

Co-Authored-By: Jason Merrill 

gcc/cp/ChangeLog:

PR c++/97034
PR c++/99009
* pt.c (build_deduction_guide): Use INNERMOST_TEMPLATE_ARGS.
(maybe_aggr_guide): Use the original template type where needed. 
In
a class member template, partially instantiate the result of
collect_ctor_idx_types.
(do_class_deduction): Defer the deduction until the enclosing
scope is non-dependent.

gcc/testsuite/ChangeLog:

PR c++/97034
PR c++/99009
* g++.dg/cpp1z/class-deduction81.C: New test.
* g++.dg/cpp1z/class-deduction82.C: New test.
* g++.dg/cpp2a/class-deduction-aggr8.C: New test.
* g++.dg/cpp2a/class-deduction-aggr9.C: New test.
* g++.dg/cpp2a/class-deduction-aggr10.C: New test.

[Bug bootstrap/92002] [10/11 regression] -Wuninitialized warning in gcc/wide-int.cc

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92002

--- Comment #16 from CVS Commits  ---
The master branch has been updated by Rainer Orth :

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

commit r11-7484-gfa6092d2cdc654d4b2e018929c0dbe13fbd4ea69
Author: Rainer Orth 
Date:   Wed Mar 3 16:01:50 2021 +0100

sparcv9: Disable -Wuninitialized warnings breaking bootstrap [PR92002]

sparcv9 bootstrap has been broken for 1 1/2 years now by spurious
-Wuninitialized warnings:

In function âwide_int wi::max_value(unsigned int, signop)â,
inlined from âwide_int wi::max_value(unsigned int, signop)â at
/vol/gcc/src/hg/master/local/gcc/wide-int.cc:330:1:
/vol/gcc/src/hg/master/local/gcc/wide-int.cc:335:31: error:
â.generic_wide_int::.wide_int_storage::val[1]â
may be used uninitialized [-Werror=maybe-uninitialized]
  335 | return shwi (-1, precision);
  |   ^
[...]
In function âwide_int get_nonzero_bits(const_tree)â,
inlined from âwide_int get_nonzero_bits(const_tree)â at
/vol/gcc/src/hg/master/local/gcc/tree-ssanames.c:531:1:
/vol/gcc/src/hg/master/local/gcc/tree-ssanames.c:544:67: error:
â.generic_wide_int::.wide_int_storage::val[1]â
may be used uninitialized [-Werror=maybe-uninitialized]
  544 |  | (HOST_WIDE_INT) pi->misalign,
precision);
  |   ^
[...]

Before we ship yet another release with this issue, I suggest to at
least include a workaround of demoting them to warnings.

Tested on sparcv9-sun-solaris2.11.


2021-03-03  Rainer Orth  

gcc:
PR bootstrap/92002
* config/sparc/t-sparc (tree-ssanames.o-warn): Don't error for
-Wuninitialized, -Wmaybe-uninitialized.
(wide-int.o-warn): Likewise.

[Bug c++/82959] g++ doesn't appreciate C++17 evaluation order rules for overloaded operators

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82959

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

https://gcc.gnu.org/g:0b8fa12015f717ac7e4fe2ffbad96a0cb0df2584

commit r11-7485-g0b8fa12015f717ac7e4fe2ffbad96a0cb0df2584
Author: Jakub Jelinek 
Date:   Wed Mar 3 16:12:23 2021 +0100

c++: Fix -fstrong-eval-order for operator &&, || and , [PR82959]

P0145R3 added
"However, the operands are sequenced in the order prescribed for the
built-in
operator" rule for overloaded operator calls when using the operator
syntax.
op_is_ordered follows that, but added just the overloaded operators
added in that paper.  &&, || and comma operators had rules that
lhs is sequenced before rhs already in C++98.
The following patch adds those cases to op_is_ordered.

2021-03-03  Jakub Jelinek  

PR c++/82959
* call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR
and COMPOUND_EXPR.

* g++.dg/cpp1z/eval-order10.C: New test.

[Bug d/99337] Sanitizer detect heap-buffer-overflow in checkModFileAlias

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99337

--- Comment #5 from CVS Commits  ---
The master branch has been updated by Iain Buclaw :

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

commit r11-7492-gd6177870dd2696501e3b8d3930fd5549d4acaeae
Author: Iain Buclaw 
Date:   Wed Mar 3 15:34:04 2021 +0100

d: Fix heap-buffer-overflow in checkModFileAlias [PR 99337]

The code wrongly assumed memcmp did not read past the mismatch.

Reviewed-on: https://github.com/dlang/dmd/pull/12247

gcc/d/ChangeLog:

PR d/99337
* dmd/MERGE: Merge upstream dmd a3c9bf422.

[Bug c++/99170] [modules] ICE in get_merge_kind with std::string NSDMI

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99170

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Nathan Sidwell :

https://gcc.gnu.org/g:499193a692efa33c9b2fe3ad8da0f4d5e5fd0e0c

commit r11-7493-g499193a692efa33c9b2fe3ad8da0f4d5e5fd0e0c
Author: Nathan Sidwell 
Date:   Wed Mar 3 11:22:56 2021 -0800

c++: Defer specialization registration [PR 99170]

This defers inserting specializations into the specialization table,
until we have completed their streaming.  When streaming a cluster we
ensure that all imports are populated before any of the cluster, so
they need no visibility of other specializations.  Further within the
same import, we've already partitioned the graph, so no earlier
cluster can be refering to a specialization in a later cluster.
Inserting them early causes problems when other specializations of the
same template are inserted.  (This doesn't fix 99170, but is a
necessary change for that PR).

Earlier on, I had less deferred processing, but it has become clearer
that deferred worklists are the right way of handling a few things.
This patch highlights a fixme, in that we're streaming a key twice,
and need not do that, but I wanted to get correctness first.  Besides
the second streaming will end up being a back reference, which is of
course much cheaper than a by-value stream.

PR c++/99170
gcc/cp/
* module.cc (trees_out::decl_value): Stream specialization keys
after decl.
(trees_in::decl_value): Stream them back and insert after
completing the decl.
(trees_out::key_mergeable): Drop some streaming here ...
(trees_in::key_mergeable): ... and here.  Don't insert into
specialization tables.

[Bug c++/96474] Internal compiler error with template struct inside template struct

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96474

--- Comment #5 from CVS Commits  ---
The master branch has been updated by Marek Polacek :

https://gcc.gnu.org/g:49df367b17995c54fabe5bca290eede7dfab05b3

commit r11-7494-g49df367b17995c54fabe5bca290eede7dfab05b3
Author: Marek Polacek 
Date:   Wed Mar 3 15:10:21 2021 -0500

c++: Add fixed test [PR96474]

Was happy to find out that my recent dguide fix (r11-7483) fixed
this test too.  In particular, the

+  /* Wait until the enclosing scope is non-dependent.  */
+  if (DECL_CLASS_SCOPE_P (tmpl)
+  && dependent_type_p (DECL_CONTEXT (tmpl)))
+return ptype;

bit.

gcc/testsuite/ChangeLog:

PR c++/96474
* g++.dg/cpp1z/class-deduction83.C: New test.

[Bug c++/99170] [modules] ICE in get_merge_kind with std::string NSDMI

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99170

--- Comment #4 from CVS Commits  ---
The master branch has been updated by Nathan Sidwell :

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

commit r11-7495-gc390c5df71bbc95627c8e5e649a3161091239fd9
Author: Nathan Sidwell 
Date:   Wed Mar 3 12:38:20 2021 -0800

c++: Defer cloning to post-loading [PR 99170]

It turns out that cloning can cause use to load things. Specifically when
checking paramter shadows (this is avoidable), and also the delete
operator of a deleting dtor (not avoidable).  Doing that in the middle of
loading is a bad thing.  This defers it to a post-load worklist.  If it
causes more loading at that point there is no problem, as we've completed
the first set of loads, bar this bit of cleanup.

Again, this doesn't fix 99170, but is a step towards a solution.

PR c++/99170
gcc/cp/
* module.cc (post_load_decls): New.
(lazy_snum, recursive_lazy): Move earlier.
(module_state::read_cluster): Push cloning onto post_load_decls.
(post_load_processing): New.  Do the cloning here.
(module_state::read_inits): Call post_load_processing.
(module_state::read_language): Likewise.
(lazy_load_binding, lazy_load_specializations): Likewise
(lazy_load_members): Likewise

[Bug d/99337] Sanitizer detect heap-buffer-overflow in checkModFileAlias

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99337

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

https://gcc.gnu.org/g:81bedd5e898d97b87358e26a087b25741eb2c713

commit r10-9410-g81bedd5e898d97b87358e26a087b25741eb2c713
Author: Iain Buclaw 
Date:   Wed Mar 3 15:34:04 2021 +0100

d: Fix heap-buffer-overflow in checkModFileAlias [PR 99337]

The code wrongly assumed memcmp did not read past the mismatch.

gcc/d/ChangeLog:

PR d/99337
* dmd/dmodule.c (checkModFileAlias): Don't read past buffer in
  comparison.

(cherry picked from commit d6177870dd2696501e3b8d3930fd5549d4acaeae)

[Bug d/99337] Sanitizer detect heap-buffer-overflow in checkModFileAlias

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99337

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

https://gcc.gnu.org/g:03d7b32e0ebf15047a97d3f27faf5771ecf79a03

commit r9-9262-g03d7b32e0ebf15047a97d3f27faf5771ecf79a03
Author: Iain Buclaw 
Date:   Wed Mar 3 15:34:04 2021 +0100

d: Fix heap-buffer-overflow in checkModFileAlias [PR 99337]

The code wrongly assumed memcmp did not read past the mismatch.

gcc/d/ChangeLog:

PR d/99337
* dmd/dmodule.c (checkModFileAlias): Don't read past buffer in
  comparison.

(cherry picked from commit d6177870dd2696501e3b8d3930fd5549d4acaeae)

[Bug tree-optimization/96963] [10/11 Regression] -Wstringop-overflow false positive on -O3 or -O2 -ftree-vectorize when assigning consecutive char struct members

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96963

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

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

commit r11-7497-g8d57bdadd2d9c2e5c95515ca7a583d7b407b55c4
Author: Martin Sebor 
Date:   Wed Mar 3 16:56:45 2021 -0700

Correct a workaround for vectorized stores.

Resolves:
PR middle-end/96963 - -Wstringop-overflow false positive with
-ftree-vectorize when assigning consecutive char struct members
PR middle-end/94655 - -Wstringop-overflow on implicit string assignment
with vectorized char store

gcc/ChangeLog:

PR middle-end/96963
PR middle-end/94655
* builtins.c (handle_array_ref): New helper.
(handle_mem_ref): New helper.
(compute_objsize_r): Factor out ARRAY_REF and MEM_REF handling
into new helper functions.  Correct a workaround for vectorized
assignments.

gcc/testsuite/ChangeLog:

PR middle-end/96963
PR middle-end/94655
* gcc.dg/Wstringop-overflow-47.c: Xfail tests.
* gcc.dg/Wstringop-overflow-65.c: New test.
* gcc.dg/Warray-bounds-69.c: Same.

[Bug tree-optimization/94655] [10/11 Regression] -Wstringop-overflow on implicit string assignment with vectorized char store

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94655

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

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

commit r11-7497-g8d57bdadd2d9c2e5c95515ca7a583d7b407b55c4
Author: Martin Sebor 
Date:   Wed Mar 3 16:56:45 2021 -0700

Correct a workaround for vectorized stores.

Resolves:
PR middle-end/96963 - -Wstringop-overflow false positive with
-ftree-vectorize when assigning consecutive char struct members
PR middle-end/94655 - -Wstringop-overflow on implicit string assignment
with vectorized char store

gcc/ChangeLog:

PR middle-end/96963
PR middle-end/94655
* builtins.c (handle_array_ref): New helper.
(handle_mem_ref): New helper.
(compute_objsize_r): Factor out ARRAY_REF and MEM_REF handling
into new helper functions.  Correct a workaround for vectorized
assignments.

gcc/testsuite/ChangeLog:

PR middle-end/96963
PR middle-end/94655
* gcc.dg/Wstringop-overflow-47.c: Xfail tests.
* gcc.dg/Wstringop-overflow-65.c: New test.
* gcc.dg/Warray-bounds-69.c: Same.

[Bug c++/98810] [9/10 Regression] [C++20] ICE in tsubst_copy, at cp/pt.c:16771

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98810

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

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

commit r10-9412-gbf49d83570ddb4df7893c3d605f7fc89db13792d
Author: Jason Merrill 
Date:   Thu Feb 25 16:47:53 2021 -0500

c++: Fix class NTTP constness handling [PR98810]

Here, when substituting still-dependent args into an alias template, we see
a non-const type because the default argument is non-const, and is not a
template parm object because it's still dependent.

gcc/cp/ChangeLog:

PR c++/98810
* pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const
to a class non-type template argument that needs it.

gcc/testsuite/ChangeLog:

PR c++/98810
* g++.dg/cpp2a/nontype-class-defarg1.C: New test.

[Bug c++/96078] [10 Regression] flatten attribute on constructor and destructor causes spurious warning

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96078

--- Comment #6 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Jason Merrill
:

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

commit r10-9413-gd455130553544ee838b5215e76ccad22304cde39
Author: Jason Merrill 
Date:   Thu Feb 11 22:01:19 2021 -0500

cgraph: flatten and same_body aliases [PR96078]

The patch for PR92372 made us start warning about a flatten attribute on an
alias.  But in the case of C++ 'tor base/complete variants, the user didn't
create the alias.  If the alias target also has the attribute, the alias
points to a flattened function, so we shouldn't warn.

gcc/ChangeLog:

PR c++/96078
* cgraphunit.c (process_function_and_variable_attributes): Don't
warn about flatten on an alias if the target also has it.
* cgraph.h (symtab_node::get_alias_target_tree): New.

gcc/testsuite/ChangeLog:

PR c++/96078
* g++.dg/ext/attr-flatten1.C: New test.

[Bug c++/95675] [8/9/10/11 Regression] internal compiler error: in build_over_call

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95675

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

https://gcc.gnu.org/g:371c7a82833df5d84392838cf2bf95b4da88655c

commit r10-9414-g371c7a82833df5d84392838cf2bf95b4da88655c
Author: Jason Merrill 
Date:   Tue Mar 2 23:59:00 2021 -0500

c++: C++17 and decltype of multi-operator expression [PR95675]

A call that is the immediate operand of decltype has special semantics: no
temporary is produced, so it's OK for the return type to be e.g.
incomplete.
But we were treating (e | f) the same way, which confused overload
resolution when we then tried to evaluate ... | g.

Fixed by making build_temp do what its name says, and force the C++17
temporary materialization conversion.

gcc/cp/ChangeLog:

PR c++/95675
* call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
if it didn't get one before.

gcc/testsuite/ChangeLog:

PR c++/95675
* g++.dg/cpp0x/decltype-call5.C: New test.
* g++.dg/cpp0x/decltype-call6.C: New test.

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

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

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

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

commit r10-9415-ga588c87ba309492b351c1a55b08d907b65913e2c
Author: Jason Merrill 
Date:   Wed Mar 3 17:38:55 2021 -0500

c++: Normalization and deduction guide rewriting [PR96199]

This is a subset of r11-2748; we don't want to rewrite all deduction guides
in GCC 10, but we do need the push_nested_class in normalization to avoid
breaking cmcstl2.

gcc/cp/ChangeLog:

PR c++/96199
* cp-tree.h (struct push_nested_class_guard): New.
* constraint.cc (get_normalized_constraints_from_decl): Use it.

[Bug c++/95675] [8/9/10/11 Regression] internal compiler error: in build_over_call

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95675

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

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

commit r9-9264-ge90b052caf74dcc7529e6b2cc0b0688eebf53c74
Author: Jason Merrill 
Date:   Tue Mar 2 23:59:00 2021 -0500

c++: C++17 and decltype of multi-operator expression [PR95675]

A call that is the immediate operand of decltype has special semantics: no
temporary is produced, so it's OK for the return type to be e.g.
incomplete.
But we were treating (e | f) the same way, which confused overload
resolution when we then tried to evaluate ... | g.

Fixed by making build_temp do what its name says, and force the C++17
temporary materialization conversion.

gcc/cp/ChangeLog:

PR c++/95675
* call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
if it didn't get one before.

gcc/testsuite/ChangeLog:

PR c++/95675
* g++.dg/cpp0x/decltype-call5.C: New test.
* g++.dg/cpp0x/decltype-call6.C: New test.

[Bug c++/98810] [9/10 Regression] [C++20] ICE in tsubst_copy, at cp/pt.c:16771

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98810

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

https://gcc.gnu.org/g:89896df2cbfa52940c81858d9c4111633b533d25

commit r9-9265-g89896df2cbfa52940c81858d9c4111633b533d25
Author: Jason Merrill 
Date:   Thu Feb 25 16:47:53 2021 -0500

c++: Fix class NTTP constness handling [PR98810]

Here, when substituting still-dependent args into an alias template, we see
a non-const type because the default argument is non-const, and is not a
template parm object because it's still dependent.

gcc/cp/ChangeLog:

PR c++/98810
* pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const
to a class non-type template argument that needs it.

gcc/testsuite/ChangeLog:

PR c++/98810
* g++.dg/cpp2a/nontype-class-defarg1.C: New test.

[Bug fortran/99355] -freal-X-real-Y -freal-Z-real-X promotes Z to Y

2021-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99355

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

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

commit r11-7501-gd259ab15761de2d938c24abfba9cdcd2fef91655
Author: Tobias Burnus 
Date:   Thu Mar 4 08:18:31 2021 +0100

Fortran: Fix -freal-{4,8}-real* handling [PR99355]

Avoid chain kind conversion for, e.g., -freal-4-real-8 -freal-8-real-10.
Note that gfc_default_double_kind/gfc_default_double_kind already
honors the -freal flags.

gcc/fortran/ChangeLog:

PR fortran/99355
* decl.c (gfc_match_old_kind_spec, gfc_match_kind_spec): Avoid
redoing kind conversions.
* primary.c (match_real_constant): Likewise.

gcc/testsuite/ChangeLog:

PR fortran/99355
* gfortran.dg/real4-10-real8-10.f90: New test.
* gfortran.dg/real4-10-real8-16.f90: New test.
* gfortran.dg/real4-10-real8-4.f90: New test.
* gfortran.dg/real4-10.f90: New test.
* gfortran.dg/real4-16-real8-10.f90: New test.
* gfortran.dg/real4-16-real8-16.f90: New test.
* gfortran.dg/real4-16-real8-4.f90: New test.
* gfortran.dg/real4-16.f90: New test.
* gfortran.dg/real4-8-real8-10.f90: New test.
* gfortran.dg/real4-8-real8-16.f90: New test.
* gfortran.dg/real4-8-real8-4.f90: New test.
* gfortran.dg/real4-8.f90: New test.
* gfortran.dg/real8-10.f90: New test.
* gfortran.dg/real8-16.f90: New test.
* gfortran.dg/real8-4.f90: New test.

[Bug libstdc++/99382] Address sanitizer detects stack-buffer-overflow in stl_construct.h

2021-03-04 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99382

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

https://gcc.gnu.org/g:905ce0ca30cb33cddf024b0aebf4ba0b2c86fe77

commit r11-7503-g905ce0ca30cb33cddf024b0aebf4ba0b2c86fe77
Author: Jonathan Wakely 
Date:   Thu Mar 4 10:28:38 2021 +

libstdc++: Fix buffer overflows in tests [PR 99382]

This seems to be a typo/thinko in the definition of the arrays used as
storage.

libstdc++-v3/ChangeLog:

PR libstdc++/99382
*
testsuite/20_util/specialized_algorithms/uninitialized_default_n/sizes.cc:
Make storage larger than required. Verify no write to the last
element.
*
testsuite/20_util/specialized_algorithms/uninitialized_value_construct_n/sizes.cc:
Likewise.

[Bug middle-end/97855] [11 regression] Bogus warning locations during lto-bootstrap

2021-03-04 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97855

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

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

commit r11-7504-gf232f782e6e4954370ac63ba6e40ad554c0cf942
Author: Richard Biener 
Date:   Thu Mar 4 09:00:55 2021 +0100

middle-end/97855 - avoid recursing into pp_printf

When diagnostic messages use pretty-printer formats like %D or %E
the pp_printf invocation can end up in tree pretty-printers which
then have to avoid using pp_printf themselves since this function
is not re-entrant.

The following removes all pp_printf uses from tree-pretty-print.c
fixing the observed malformed diagnostics.  It also poisons the
identifier so new uses are less likely to creep in.

2021-03-04  Richard Biener  

PR middle-end/97855
* tree-pretty-print.c: Poison pp_printf.
(dump_decl_name): Avoid use of pp_printf.
(dump_block_node): Likewise.
(dump_generic_node): Likewise.

[Bug gcov-profile/99385] [11 regression] gcc.dg/tree-prof/indir-call-prof-malloc.c etc. FAIL

2021-03-04 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99385

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

https://gcc.gnu.org/g:4c955b4ad37cf31c1d7cfa146c2b3ead2042869b

commit r11-7505-g4c955b4ad37cf31c1d7cfa146c2b3ead2042869b
Author: Martin Liska 
Date:   Thu Mar 4 11:45:47 2021 +0100

gcov: call mmap MAP_ANONYMOUS with fd equal to -1

libgcc/ChangeLog:

PR gcov-profile/99385
* libgcov.h (allocate_gcov_kvp): Call mmap with fd equal to -1.

[Bug c++/99170] [modules] ICE in get_merge_kind with std::string NSDMI

2021-03-04 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99170

--- Comment #5 from CVS Commits  ---
The master branch has been updated by Nathan Sidwell :

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

commit r11-7506-gc778a237c1c605c2c5606c212c1ace756739442b
Author: Nathan Sidwell 
Date:   Wed Mar 3 10:09:41 2021 -0800

c++: Redesign pending entity handling [PR 99170]

This patch addresses 99170.  with modules (and in particular header
units), one module can provide a (maybe nested) class or template and
another module can provide a definition or (maybe partial)
specialization of said entity, or member thereof.  when both are
imported into a 3rd TU, and that TU instantiates or uses the class, it
needs to stream in those entities (in general).  But how does it key
those entities to the original?  It can't /just/ use the entity index,
because, when header-units and/or partitions are in play, the entity
index /is not unique/.  I had two complicated schemes that tried to
unify that, but it failed.  Here's a simpler scheme.  Such pending
entities are keyed to the namespace and identifier of the
namespace-scope entity that contains them.  Thus the final TU needs to
find that entity and look in a hash table for lists of sections that
need loading just before instantiating a template or looking inside a
class.

I would like to make this more efficient, but given the complex scheme
failed, I'm shooting for correctness right now.  There will be a
follow up patch to complete the cleanup this enables.

PR c++/99170
gcc/cp/
* cp-tree.h
* lex.c (cxx_dup_lang_specific_decl): Adjust for module_attached_p
rename.
* module.cc (class pending_key): New.
(default_hash_traits): New specialization.
(pending_map_t): New typedef.
(pending_table): Replace old table.
(trees_out::lang_decl_bools): Adjust.
(trees_in::lang_decl_bools): Adjust.
(trees_in::install_entity): Drop pending member and specialization
handling.
(find_pending_key): New.
(depset::hash::fiund_dependencies): Use it.
(pendset_lazy_load): Delete.
(module_state::write_cluster): Don't count pendings here.  Bye
Duff's device-like thing.
(module_state::write_pendings): Reimplement.
(module_state::read_pendings): Reimplement.
(lazy_specializations_p): Delete.
(module_state::write): Adjust write_pendings call.
(lazy_load_pendings): New.
(lazy_load_specializations): Delete.
(lazy_load_members): Delete.
(init_modules): Adjust.
* name-lookup.c (maybe_lazily_declare): Call lazy_load_pendings
not lazy_load_members.
(note_pending_specializations): Delete.
(load_pending_specializations): Delete.
* name-lookup.h (BINDING_VECTR_PENDING_SPECIALIZATIONS_P): Delete.
(BINDING_VECTOR_PENDING_MEMBERS_P): Delete.
(BINDING_VECTR_PENDING_MEMBERS_P): Delete.
(note_pending_specializations): Delete.
(load_pending_specializations): Delete.
* pt.c (lookup_template_class_1): Call lazy_load_pendings not
lazy_load_specializations.
(instantiate_template_class_1): Likewise.
(instantiate_decl): Call lazy_load_pendings.
* typeck.c (complete_type): Likewise.
gcc/testsuite/
* g++.dg/modules/pr99170-1_a.H: New.
* g++.dg/modules/pr99170-1_b.C: New.
* g++.dg/modules/pr99170-2.h: New.
* g++.dg/modules/pr99170-2_a.C: New.
* g++.dg/modules/pr99170-2_b.C: New.
* g++.dg/modules/pr99170-3_a.H: New.
* g++.dg/modules/pr99170-3_b.C: New.
* g++.dg/modules/inst-2_b.C: Adjust scan.
* g++.dg/modules/inst-4_a.C: Adjust scan.
* g++.dg/modules/inst-4_b.C: Adjust scan.
* g++.dg/modules/member-def-1_b.C: Adjust scan.
* g++.dg/modules/member-def-1_c.C: Adjust scan.
* g++.dg/modules/tpl-spec-1_a.C: Adjust scan.
* g++.dg/modules/tpl-spec-1_b.C: Adjust scan.
* g++.dg/modules/tpl-spec-2_b.C: Adjust scan.
* g++.dg/modules/tpl-spec-2_c.C: Adjust scan.
* g++.dg/modules/tpl-spec-2_d.C: Adjust scan.
* g++.dg/modules/tpl-spec-3_a.C: Adjust scan.
* g++.dg/modules/tpl-spec-3_b.C: Adjust scan.
* g++.dg/modules/tpl-spec-4_a.C: Adjust scan.
* g++.dg/modules/tpl-spec-4_b.C: Adjust scan.
* g++.dg/modules/tpl-spec-5_a.C: Adjust scan.
* g++.dg/modules/tpl-spec-5_b.C: Adjust scan.

[Bug c++/99170] [modules] ICE in get_merge_kind with std::string NSDMI

2021-03-04 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99170

--- Comment #7 from CVS Commits  ---
The master branch has been updated by Nathan Sidwell :

https://gcc.gnu.org/g:9553c8a1b9dd2ca2f0f30d8b23fc6844c7e4a223

commit r11-7509-g9553c8a1b9dd2ca2f0f30d8b23fc6844c7e4a223
Author: Nathan Sidwell 
Date:   Wed Mar 3 12:30:45 2021 -0800

c++: Post-pending redesign cleanup [PR 99170]

With pending entities reimplemented, the remaining use of uintset can just
use a regular hash map -- I only used a uintset because it was there.
So one adhoc hash-table/vector structure goes away.

PR c++/99170
gcc/cp/
* module.cc (class uintset): Delete.
(typedef attached_map_t): A hash map.
(attached_table): Use attached_map_t.  Adjust uses ...
(trees_out::decl_value, trees_in::decl_value): ... here ...
(trees_out::key_mergeable): ... here ...
(trees_in::key_mergeable): ... here ...
(maybe_attach_decl): ... here ...
(direct_import): ... and here.

[Bug target/99381] SVE: ICE with ACLE intrinsics when missing -march=armv8.2-a+sve

2021-03-04 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99381

--- Comment #1 from CVS Commits  ---
The master branch has been updated by Alex Coplan :

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

commit r11-7510-ga6bc1680a493de356d6a381718021c6a44401201
Author: Alex Coplan 
Date:   Thu Mar 4 14:36:39 2021 +

aarch64: Add missing error_mark_node check [PR99381]

We were missing a check in function_resolver::require_vector_type to see
if the argument type was already invalid. This was causing us to attempt
to emit a diagnostic and subsequently ICE in print_type. Fixed thusly.

gcc/ChangeLog:

PR target/99381
* config/aarch64/aarch64-sve-builtins.cc
(function_resolver::require_vector_type): Handle error_mark_node.

gcc/testsuite/ChangeLog:

PR target/99381
* gcc.target/aarch64/pr99381.c: New test.

[Bug c/99325] [11 Regression] ICE in maybe_print_line_1, at c-family/c-ppoutput.c:454 since r11-5091

2021-03-04 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99325

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

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

commit r11-7511-ga1b56c3ef70036af6d171d61ea48ad4c368fcb5b
Author: Jakub Jelinek 
Date:   Thu Mar 4 16:02:07 2021 +0100

c-ppoutput: Fix preprocessing ICE on very large line number [PR99325]

In libcpp, lines are represented as linenum_type, which is unsigned int.
The following testcases ICE because maybe_print_line_1 is sometimes called
with UNKNOWN_LOCATION (e.g. at pragma eof) and while most of the time
the
&& src_line >= print.src_line
&& src_line < print.src_line + 8
check doesn't succeed for the src_line of 0 from UNKNOWN_LOCATION, when
print.src_line is from very large line numbers (UINT_MAX - 7 and above)
it succeeds (with UB on the compiler side) but src_file is NULL for
UNKNOWN_LOCATION and so the strcmp call ICEs.
As print.src_line can easily wrap around, this patch changes its type
to unsigned int to match libcpp, so that we don't invoke UB in the
compiler.
For print.src_line of UINT_MAX - 7 and above, src_line from
UNKNOWN_LOCATION
will not pass that test anymore, but when it wraps around to 0, it can,
so I've also added a check for src_loc != UNKNOWN_LOCATION (or, if
preferred, could be src_file != NULL).
Besides fixing the ICE and UB in the compiler, I believe worst case the
patch will cause printing a few more line directives in the preprocessed
source around the wrapping from lines UINT_MAX - 7 to 0 (but less
around the wrapping from INT_MAX to INT_MAX + 1U), but I think those
are exceptional cases (sources with > 2billion lines are rare and
we warn or error on #line > INT_MAX).

2021-03-04  Jakub Jelinek  

PR c/99325
* c-ppoutput.c (print): Change src_line type from int to unsigned.
(token_streamer::stream) Likewise.
(maybe_print_line_1): Likewise.  Don't strcmp src_file if src_loc
is
UNKNOWN_LOCATION.

* gcc.dg/cpp/line11.c: New test.
* gcc.dg/cpp/line12.c: New test.

[Bug c++/88146] ice in tsubst_copy, at cp/pt.c:16014

2021-03-04 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88146

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

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

commit r11-7512-gc9816196328a4f4b927f08cf2f66cf255849da0b
Author: Jakub Jelinek 
Date:   Thu Mar 4 16:04:48 2021 +0100

c++: Fix up [[nodiscard]] on ctors on targetm.cxx.cdtor_returns_this
targets [PR99362]

In the P1771R1 changes JeanHeyd reverted part of Alex' PR88146 fix,
but that seems to be incorrect to me.
Where P1771R1 suggests warnings for [[nodiscard]] on constructors is
handled in a different place - in particular the TARGET_EXPR handling
of convert_to_void.  When we have CALL_EXPR of a ctor, on most arches
that call has void return type and so returns early, and on arm where
the ctor returns the this pointer it is undesirable to warn as it warns
about all ctor calls, not just the ones where it should warn.

The P1771R1 changes added a test for this, but as it was given *.c
extension rather than *.C, the test was never run and so this didn't get
spotted immediately.  The test also had a bug, (?n) can't be used
in dg-warning/dg-error because those are implemented by prepending
some regexp before the user provided one and (?n) must come at the start
of the regexp.  Furthermore, while -ftrack-macro-expansion=0 is useful
in one nodiscard test which uses macros, I don't see how it would be
relevant to all the other cpp2a/nodiscard* tests which don't use any
macros.

2021-03-04  Jakub Jelinek  

PR c++/88146
PR c++/99362
gcc/cp/
* cvt.c (convert_to_void): Revert 2019-10-17 changes.  Clarify
comment.
gcc/testsuite/
* g++.dg/cpp2a/nodiscard-constructor.c: Renamed to ...
* g++.dg/cpp2a/nodiscard-constructor1.C: ... this.  Remove
-ftrack-macro-expansion=0 from dg-options.  Don't use (?n) in
dg-warning regexps, instead replace .* with \[^\n\r]*.
* g++.dg/cpp2a/nodiscard-constructor2.C: New test.
* g++.dg/cpp2a/nodiscard-reason-only-one.C: Remove
-ftrack-macro-expansion=0 from dg-options.
* g++.dg/cpp2a/nodiscard-reason-nonstring.C: Likewise.
* g++.dg/cpp2a/nodiscard-once.C: Likewise.

[Bug c++/99362] [10/11 Regression] invalid unused result

2021-03-04 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99362

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

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

commit r11-7512-gc9816196328a4f4b927f08cf2f66cf255849da0b
Author: Jakub Jelinek 
Date:   Thu Mar 4 16:04:48 2021 +0100

c++: Fix up [[nodiscard]] on ctors on targetm.cxx.cdtor_returns_this
targets [PR99362]

In the P1771R1 changes JeanHeyd reverted part of Alex' PR88146 fix,
but that seems to be incorrect to me.
Where P1771R1 suggests warnings for [[nodiscard]] on constructors is
handled in a different place - in particular the TARGET_EXPR handling
of convert_to_void.  When we have CALL_EXPR of a ctor, on most arches
that call has void return type and so returns early, and on arm where
the ctor returns the this pointer it is undesirable to warn as it warns
about all ctor calls, not just the ones where it should warn.

The P1771R1 changes added a test for this, but as it was given *.c
extension rather than *.C, the test was never run and so this didn't get
spotted immediately.  The test also had a bug, (?n) can't be used
in dg-warning/dg-error because those are implemented by prepending
some regexp before the user provided one and (?n) must come at the start
of the regexp.  Furthermore, while -ftrack-macro-expansion=0 is useful
in one nodiscard test which uses macros, I don't see how it would be
relevant to all the other cpp2a/nodiscard* tests which don't use any
macros.

2021-03-04  Jakub Jelinek  

PR c++/88146
PR c++/99362
gcc/cp/
* cvt.c (convert_to_void): Revert 2019-10-17 changes.  Clarify
comment.
gcc/testsuite/
* g++.dg/cpp2a/nodiscard-constructor.c: Renamed to ...
* g++.dg/cpp2a/nodiscard-constructor1.C: ... this.  Remove
-ftrack-macro-expansion=0 from dg-options.  Don't use (?n) in
dg-warning regexps, instead replace .* with \[^\n\r]*.
* g++.dg/cpp2a/nodiscard-constructor2.C: New test.
* g++.dg/cpp2a/nodiscard-reason-only-one.C: Remove
-ftrack-macro-expansion=0 from dg-options.
* g++.dg/cpp2a/nodiscard-reason-nonstring.C: Likewise.
* g++.dg/cpp2a/nodiscard-once.C: Likewise.

[Bug gcov-profile/99105] [11 regression] profile streaming scales poorly to projects with many source files

2021-03-04 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99105

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

https://gcc.gnu.org/g:6a8fc0c31a9ae759fe9bf59b5418abf2af938f91

commit r11-7513-g6a8fc0c31a9ae759fe9bf59b5418abf2af938f91
Author: Martin Liska 
Date:   Tue Feb 16 16:28:06 2021 +0100

profiling: fix streaming of TOPN counters

libgcc/ChangeLog:

PR gcov-profile/99105
* libgcov-driver.c (write_top_counters): Rename to ...
(write_topn_counters): ... this.
(write_one_data): Pre-allocate buffer for number of items
in the corresponding linked lists.
* libgcov.h (malloc_mmap): New function.
(allocate_gcov_kvp): Use it.

gcc/testsuite/ChangeLog:

PR gcov-profile/99105
* gcc.dg/tree-prof/indir-call-prof-malloc.c: Use profile
correction as the wrapped malloc is called one more time
from libgcov.
* gcc.dg/tree-prof/pr97461.c: Likewise.

[Bug middle-end/93235] [AArch64] ICE with __fp16 in a struct

2021-03-04 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93235

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

https://gcc.gnu.org/g:0ad6de3883a1641f7ec0bd9cf56d41fa5b313dae

commit r11-7515-g0ad6de3883a1641f7ec0bd9cf56d41fa5b313dae
Author: Jakub Jelinek 
Date:   Thu Mar 4 19:38:08 2021 +0100

expand: Fix ICE in store_bit_field_using_insv [PR93235]

The following testcase ICEs on aarch64.  The problem is that
op0 is (subreg:HI (reg:HF ...) 0) and because we can't create a SUBREG of a
SUBREG and aarch64 doesn't have HImode insv, only SImode insv,
store_bit_field_using_insv tries to create (subreg:SI (reg:HF ...) 0)
which is not valid for the target and so gen_rtx_SUBREG ICEs.

The following patch fixes it by punting if the to be created SUBREG
doesn't validate, callers of store_bit_field_using_insv can handle
the fallback.

2021-03-04  Jakub Jelinek  

PR middle-end/93235
* expmed.c (store_bit_field_using_insv): Return false of xop0 is a
SUBREG and a SUBREG to op_mode can't be created.

* gcc.target/aarch64/pr93235.c: New test.

[Bug debug/66668] [6 regression] FAIL: gcc.dg/debug/dwarf2/stacked-qualified-types-3.c scan-assembler-times DIE \\([^\n]*\\) DW_TAG_(?:const|volatile|atomic|restrict)_type 8

2021-03-04 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=8

--- Comment #15 from CVS Commits  ---
The master branch has been updated by Hans-Peter Nilsson :

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

commit r11-7518-g8d240b3f0615a890d8bdd9319842601a48292522
Author: Hans-Peter Nilsson 
Date:   Fri Mar 5 01:44:05 2021 +0100

gcc.dg/debug/dwarf2/stacked-qualified-types-3.c: xfail for cris

The test is still failing and is a regression on master for
cris-elf: the remedy for (all) other targets wasn't
sufficient.  I'm not myself going to put any effort into it
(debug-information being different enough for a test to
fail, is not a priority) and apparently not anyone else in
the last 5 years, so I'm just going to xfail it.

gcc/testsuite:
PR debug/8
* gcc.dg/debug/dwarf2/stacked-qualified-types-3.c: xfail for
cris-*-*

[Bug fortran/99355] -freal-X-real-Y -freal-Z-real-X promotes Z to Y

2021-03-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99355

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

https://gcc.gnu.org/g:80cf2facbbdafed159b326d83f7cf3999c3df8d0

commit r11-7519-g80cf2facbbdafed159b326d83f7cf3999c3df8d0
Author: Tobias Burnus 
Date:   Fri Mar 5 10:43:11 2021 +0100

Fortran: Follow fixes to -freal-{4,8}-real* handling [PR99355,PR57871]

gcc/fortran/ChangeLog:

PR fortran/99355
PR fortran/57871
* invoke.texi (-freal{4,8}-real-*): Extend description.
* primary.c (match_real_constant): Also promote real literals
with '_kind' number.

gcc/testsuite/ChangeLog:

* gfortran.dg/real4-10-real8-10.f90: Add check for real literals
with '_kind' number.
* gfortran.dg/real4-10-real8-16.f90: Likewise.
* gfortran.dg/real4-10-real8-4.f90: Likewise.
* gfortran.dg/real4-10.f90: Likewise.
* gfortran.dg/real4-16-real8-10.f90: Likewise.
* gfortran.dg/real4-16-real8-16.f90: Likewise.
* gfortran.dg/real4-16-real8-4.f90: Likewise.
* gfortran.dg/real4-16.f90: Likewise.
* gfortran.dg/real4-8-real8-10.f90: Likewise.
* gfortran.dg/real4-8-real8-16.f90: Likewise.
* gfortran.dg/real4-8-real8-4.f90: Likewise.
* gfortran.dg/real4-8.f90: Likewise.
* gfortran.dg/real8-10.f90: Likewise.
* gfortran.dg/real8-16.f90: Likewise.
* gfortran.dg/real8-4.f90: Likewise.

[Bug fortran/57871] gfortran -freal-4-real-16 gives wrong result for selected_real_kind(1)

2021-03-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57871

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

https://gcc.gnu.org/g:80cf2facbbdafed159b326d83f7cf3999c3df8d0

commit r11-7519-g80cf2facbbdafed159b326d83f7cf3999c3df8d0
Author: Tobias Burnus 
Date:   Fri Mar 5 10:43:11 2021 +0100

Fortran: Follow fixes to -freal-{4,8}-real* handling [PR99355,PR57871]

gcc/fortran/ChangeLog:

PR fortran/99355
PR fortran/57871
* invoke.texi (-freal{4,8}-real-*): Extend description.
* primary.c (match_real_constant): Also promote real literals
with '_kind' number.

gcc/testsuite/ChangeLog:

* gfortran.dg/real4-10-real8-10.f90: Add check for real literals
with '_kind' number.
* gfortran.dg/real4-10-real8-16.f90: Likewise.
* gfortran.dg/real4-10-real8-4.f90: Likewise.
* gfortran.dg/real4-10.f90: Likewise.
* gfortran.dg/real4-16-real8-10.f90: Likewise.
* gfortran.dg/real4-16-real8-16.f90: Likewise.
* gfortran.dg/real4-16-real8-4.f90: Likewise.
* gfortran.dg/real4-16.f90: Likewise.
* gfortran.dg/real4-8-real8-10.f90: Likewise.
* gfortran.dg/real4-8-real8-16.f90: Likewise.
* gfortran.dg/real4-8-real8-4.f90: Likewise.
* gfortran.dg/real4-8.f90: Likewise.
* gfortran.dg/real8-10.f90: Likewise.
* gfortran.dg/real8-16.f90: Likewise.
* gfortran.dg/real8-4.f90: Likewise.

[Bug c/99137] ICE in gimplify_scan_omp_clauses, at gimplify.c:9833

2021-03-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99137

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

https://gcc.gnu.org/g:6ddedd3efa3fe482f76a4037521a06b3ac9f2a8b

commit r11-7520-g6ddedd3efa3fe482f76a4037521a06b3ac9f2a8b
Author: Tobias Burnus 
Date:   Fri Mar 5 11:41:44 2021 +0100

OpenACC: C/C++ - fix async parsing [PR99137]

gcc/c/ChangeLog:

PR c/99137
* c-parser.c (c_parser_oacc_clause_async): Reject comma
expressions.

gcc/cp/ChangeLog:

PR c/99137
* parser.c (cp_parser_oacc_clause_async): Reject comma expressions.

gcc/testsuite/ChangeLog:

PR c/99137
* c-c++-common/goacc/asyncwait-1.c: Update dg-error; add
additional test.

[Bug rtl-optimization/99376] sanitizer detects undefined behaviour in rtlanal.c

2021-03-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99376

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Eric Botcazou :

https://gcc.gnu.org/g:28354bc22bd66648891a875ee08ca2b27debf2a2

commit r11-7521-g28354bc22bd66648891a875ee08ca2b27debf2a2
Author: Eric Botcazou 
Date:   Fri Mar 5 12:38:49 2021 +0100

Fix undefined behavior spotted by the sanitizer

gcc/
PR rtl-optimization/99376
* rtlanal.c (nonzero_bits1) : If the number
of low-order zero bits is too large, set the result to 0 directly.

[Bug ada/99264] latest glibc release breaks Ada build on Linux

2021-03-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99264

--- Comment #7 from CVS Commits  ---
The master branch has been updated by Eric Botcazou :

https://gcc.gnu.org/g:331763de7d4850702a0f67298f36017c73cdb103

commit r11-7523-g331763de7d4850702a0f67298f36017c73cdb103
Author: Eric Botcazou 
Date:   Fri Mar 5 12:45:41 2021 +0100

Fix build breakage with latest glibc release

gcc/ada/
PR ada/99264
* init.c (__gnat_alternate_sta) [Linux]: Remove preprocessor test
on
MINSIGSTKSZ and bump size to 32KB.
* libgnarl/s-osinte__linux.ads (Alternate_Stack_Size): Bump to
32KB.

[Bug ada/99264] latest glibc release breaks Ada build on Linux

2021-03-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99264

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

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

commit r10-9417-gc85c24099b28f7af907466af2c1b73da9455368c
Author: Eric Botcazou 
Date:   Fri Mar 5 12:45:41 2021 +0100

Fix build breakage with latest glibc release

gcc/ada/
PR ada/99264
* init.c (__gnat_alternate_sta) [Linux]: Remove preprocessor test
on
MINSIGSTKSZ and bump size to 32KB.
* libgnarl/s-osinte__linux.ads (Alternate_Stack_Size): Bump to
32KB.

[Bug ada/99264] latest glibc release breaks Ada build on Linux

2021-03-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99264

--- Comment #9 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Eric Botcazou
:

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

commit r9-9267-ga5a7cdcaa0c29ee547c41d24f495e9694a6fe7f1
Author: Eric Botcazou 
Date:   Fri Mar 5 12:45:41 2021 +0100

Fix build breakage with latest glibc release

gcc/ada/
PR ada/99264
* init.c (__gnat_alternate_sta) [Linux]: Remove preprocessor test
on
MINSIGSTKSZ and bump size to 32KB.
* libgnarl/s-osinte__linux.ads (Alternate_Stack_Size): Bump to
32KB.

[Bug c++/99389] [modules] bad serialization of data

2021-03-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99389

--- Comment #1 from CVS Commits  ---
The master branch has been updated by Nathan Sidwell :

https://gcc.gnu.org/g:4d66685e49d20e0c7a87c5fa0757c7eb63ffcdaa

commit r11-7524-g4d66685e49d20e0c7a87c5fa0757c7eb63ffcdaa
Author: Nathan Sidwell 
Date:   Fri Mar 5 05:25:54 2021 -0800

c++: instantiating imported specializations [PR 99389]

When an incomplete class specialization is imported, and is completed
by instantiation, we were failing to mark the instantiation, and thus
didn't stream it out.  Leading to errors in importing as we had
members of an incomplete type.

PR c++/99389
gcc/cp/
* pt.c (instantiate_class_template_1): Set instantiating module
here.
gcc/testsuite/
* g++.dg/modules/pr99389_a.H: New.
* g++.dg/modules/pr99389_b.C: New.
* g++.dg/modules/pr99389_c.C: New.

[Bug ipa/98078] ICE in cgraph_add_edge_to_call_site_hash, at cgraph.c:698 since r6-1705-gd88511aec7338a93

2021-03-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98078

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

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

commit r11-7525-gb8188b7d7382e4a74af5dd6a125e76e8d43a68a5
Author: Martin Jambor 
Date:   Fri Mar 5 17:25:20 2021 +0100

ipa: Fix resolving speculations through cgraph_edge::set_call_stmt

In the PR 98078 testcase, speculative call-graph edges which were
created by IPA-CP are confirmed during inlining but
cgraph_edge::set_call_stmt does not take it very well.

The function enters the update_speculative branch and updates the
edges in the speculation bundle separately (by a recursive call), but
when it processes the first direct edge, most of the bundle actually
ceases to exist because it is devirtualized.  It nevertheless goes on
to attempt to update the indirect edge (that has just been removed),
which surprisingly gets as far as adding the edge to the
call_site_hash, the same devirtualized edge for the second time, and
that triggers an assert.

Fixed by this patch which makes the function aware that it is about to
resolve a speculation and do so instead of updating components of
speculation.  Also, it does so before dealing with the hash because
the speculation resolution code needs the hash to point to the first
speculative direct edge and also cleans the hash up by calling
update_call_stmt_hash_for_removing_direct_edge.

Bootstrapped and tested on x86_64-linux, also profile-LTO-bootstrapped
on the same system.

gcc/ChangeLog:

2021-01-20  Martin Jambor  

PR ipa/98078
* cgraph.c (cgraph_edge::set_call_stmt): Do not update all
corresponding speculative edges if we are about to resolve
sepculation.  Make edge direct (and so resolve speculations) before
removing it from call_site_hash.
(cgraph_edge::make_direct): Relax the initial assert to allow
calling
the function on speculative direct edges.

[Bug target/99378] [8/9/10/11 Regression] ICE in decompose_normal_address, at rtlanal.c:6710

2021-03-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99378

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Vladimir Makarov :

https://gcc.gnu.org/g:9105757a59b890194ebf5b4fcbacd58db34ef332

commit r11-7526-g9105757a59b890194ebf5b4fcbacd58db34ef332
Author: Vladimir N. Makarov 
Date:   Fri Mar 5 11:41:25 2021 -0500

[PR99378] LRA: Skip decomposing address for asm insn operand with unknown
constraint.

  Function get_constraint_type returns CT__UNKNOWN for empty constraint
and CT_FIXED_FORM for "X".  So process_address_1 skipped
decompose_mem_address only for "X" constraint.  To do the same for empty
constraint, skip decompose_mem_address for CT__UNKNOWN.

gcc/ChangeLog:

PR target/99378
* lra-constraints.c (process_address_1): Skip decomposing address
for asm insn operand with unknown constraint.

gcc/testsuite/ChangeLog:

PR target/99378
* gcc.target/i386/pr99123-2.c: New.

[Bug c++/95615] [coroutines] Coroutine frame and promise is leaked if exception thrown from promise.initial_suspend()

2021-03-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95615

--- Comment #5 from CVS Commits  ---
The master branch has been updated by Iain D Sandoe :

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

commit r11-7527-gfe55086547c9360b530e040a6673dae10ac77847
Author: Iain Sandoe 
Date:   Mon Feb 15 15:09:27 2021 +

coroutines : Handle exceptions throw before the first await_resume()
[PR95615].

The coroutine body is wrapped in a try-catch block which is responsible for
handling any exceptions thrown by the original function body.  Originally,
the
initial suspend expression was outside this, but an amendement to the
standard
places the await_resume call inside and eveything else outside.

This means that any exception thrown prior to the initial suspend
expression
await_resume() will propagate to the ramp function.  However, some portion
of
the coroutine state will exist at that point (how much depends on where the
exception is thrown from).  For example, we might have some frame parameter
copies, or the promise object or the return object any of which might have
a
non-trivial DTOR.  Also the frame itself needs to be deallocated. This
patch
fixes the handling of these cases.

gcc/cp/ChangeLog:

PR c++/95615
* coroutines.cc (struct param_info): Track parameter copies that
need
a DTOR.
(coro_get_frame_dtor): New helper function factored from
build_actor().
(build_actor_fn): Use coro_get_frame_dtor().
(morph_fn_to_coro): Track parameters that need DTORs on exception,
likewise the frame promise and the return object.  On exception,
run the
DTORs for these, destroy the frame and then rethrow the exception.

gcc/testsuite/ChangeLog:

PR c++/95615
* g++.dg/coroutines/torture/pr95615-01.C: New test.
* g++.dg/coroutines/torture/pr95615-02.C: New test.
* g++.dg/coroutines/torture/pr95615-03.C: New test.
* g++.dg/coroutines/torture/pr95615-04.C: New test.
* g++.dg/coroutines/torture/pr95615-05.C: New test.

[Bug c++/95616] [coroutines] coroutines with potentially-throwing 'co_await promise.final_suspend()' expressions should be ill-formed

2021-03-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95616

--- Comment #4 from CVS Commits  ---
The master branch has been updated by Iain D Sandoe :

https://gcc.gnu.org/g:9ee91079fd5879cba046e452ab5593372166b2ab

commit r11-7528-g9ee91079fd5879cba046e452ab5593372166b2ab
Author: Iain Sandoe 
Date:   Mon Feb 15 17:11:31 2021 +

coroutines : Do not accept throwing final await expressions [PR95616].

From the PR:

The wording of [dcl.fct.def.coroutine]/15 states:
 * The expression co_await promise.final_suspend() shall not be
   potentially-throwing ([except.spec]).

See http://eel.is/c++draft/dcl.fct.def.coroutine#15
and http://eel.is/c++draft/except.spec#6

ie. all of the following must be declared noexcept (if they form part of
the await-expression):
- promise_type::final_suspend()
- finalSuspendObj.operator co_await()
- finalSuspendAwaiter.await_ready()
- finalSuspendAwaiter.await_suspend()
- finalSuspendAwaiter.await_resume()
- finalSuspedObj destructor
- finalSuspendAwaiter destructor

This implements the checks for these cases and rejects such code with
a diagnostic if exceptions are enabled.

gcc/cp/ChangeLog:

PR c++/95616
* coroutines.cc (coro_diagnose_throwing_fn): New helper.
(coro_diagnose_throwing_final_aw_expr): New helper.
(build_co_await): Diagnose throwing final await expression
components.
(build_init_or_final_await): Diagnose a throwing promise
final_suspend() call.

gcc/testsuite/ChangeLog:

PR c++/95616
* g++.dg/coroutines/pr95616-0-no-exceptions.C: New test.
* g++.dg/coroutines/pr95616-0.C: New test.
* g++.dg/coroutines/pr95616-1-no-exceptions.C: New test.
* g++.dg/coroutines/pr95616-1.C: New test.
* g++.dg/coroutines/pr95616-2.C: New test.
* g++.dg/coroutines/pr95616-3-no-exceptions.C: New test.
* g++.dg/coroutines/pr95616-3.C: New test.
* g++.dg/coroutines/pr95616-4.C: New test.
* g++.dg/coroutines/pr95616-5.C: New test.
* g++.dg/coroutines/pr95616-6.C: New test.

[Bug c++/98118] [coroutines] ICE with coroutine with parameter with non-trivial destructor since r10-6876-gdc192bbdd0442f75

2021-03-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98118

--- Comment #5 from CVS Commits  ---
The master branch has been updated by Iain D Sandoe :

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

commit r11-7529-g3d9577c254003f2d18185015b75ce6e3e4af9ca2
Author: Iain Sandoe 
Date:   Wed Feb 17 15:13:57 2021 +

coroutines : Adjust constraints on when to build ctors [PR98118].

PR98118 shows that TYPE_NEEDS_CONSTRUCTING is necessary but not
sufficient.  Use type_build_ctor_call() instead.

gcc/cp/ChangeLog:

PR c++/98118
* coroutines.cc (build_co_await): Use type_build_ctor_call()
to determine cases when a CTOR needs to be built.
(flatten_await_stmt): Likewise.
(morph_fn_to_coro): Likewise.

gcc/testsuite/ChangeLog:

PR c++/98118
* g++.dg/coroutines/pr98118.C: New test.

[Bug c++/99377] [modules] undefined std::string_view::empty() if referenced in inline exported function

2021-03-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99377

--- Comment #2 from CVS Commits  ---
The master branch has been updated by Nathan Sidwell :

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

commit r11-7530-g1e5cdb9f896fb220b26fd2080406504c4badf5af
Author: Nathan Sidwell 
Date:   Fri Mar 5 10:34:23 2021 -0800

c++: Local instantiations of imported specializations [PR 99377]

This turned out to be the function version of the previous fix.  We
can import an implicit specialization declaration that we need to
instantiate.  We must mark the instantiation so we remember to stream
it.

PR c++/99377
gcc/cp/
* pt.c (instantiate_decl): Call set_instantiating_module.
gcc/testsuite/
* g++.dg/modules/pr99377_a.H: New.
* g++.dg/modules/pr99377_b.C: New.
* g++.dg/modules/pr99377_c.C: New.

[Bug libfortran/99218] [8/9/10/11 Regression] matmul on temporary array accesses invalid memory (segfault)

2021-03-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99218

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

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

commit r11-7531-gb1bee29167df6b0fbc9a4c8d06e2acbf3367af47
Author: Harald Anlauf 
Date:   Fri Mar 5 20:57:54 2021 +0100

PR libfortran/99218 - matmul on temporary array accesses invalid memory

Do not invoke tuned rank-2 times rank-2 matmul if rank(b) == 1.

libgfortran/ChangeLog:

PR libfortran/99218
* m4/matmul_internal.m4: Invoke tuned matmul only for rank(b)>1.
* generated/matmul_c10.c: Regenerated.
* generated/matmul_c16.c: Likewise.
* generated/matmul_c4.c: Likewise.
* generated/matmul_c8.c: Likewise.
* generated/matmul_i1.c: Likewise.
* generated/matmul_i16.c: Likewise.
* generated/matmul_i2.c: Likewise.
* generated/matmul_i4.c: Likewise.
* generated/matmul_i8.c: Likewise.
* generated/matmul_r10.c: Likewise.
* generated/matmul_r16.c: Likewise.
* generated/matmul_r4.c: Likewise.
* generated/matmul_r8.c: Likewise.
* generated/matmulavx128_c10.c: Likewise.
* generated/matmulavx128_c16.c: Likewise.
* generated/matmulavx128_c4.c: Likewise.
* generated/matmulavx128_c8.c: Likewise.
* generated/matmulavx128_i1.c: Likewise.
* generated/matmulavx128_i16.c: Likewise.
* generated/matmulavx128_i2.c: Likewise.
* generated/matmulavx128_i4.c: Likewise.
* generated/matmulavx128_i8.c: Likewise.
* generated/matmulavx128_r10.c: Likewise.
* generated/matmulavx128_r16.c: Likewise.
* generated/matmulavx128_r4.c: Likewise.
* generated/matmulavx128_r8.c: Likewise.

gcc/testsuite/ChangeLog:

PR libfortran/99218
* gfortran.dg/matmul_21.f90: New test.

[Bug c++/99245] [modules] ICE in write_cluster, at cp/module.cc:14600

2021-03-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99245

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Nathan Sidwell :

https://gcc.gnu.org/g:9e64dd6b3f6706de571c6ed3c4b7a8c8b67f22b7

commit r11-7532-g9e64dd6b3f6706de571c6ed3c4b7a8c8b67f22b7
Author: Nathan Sidwell 
Date:   Fri Mar 5 12:49:34 2021 -0800

c++: Duplicate namespace bindings [PR 99245]

Header units can declare the same entity, and this can lead to one of
them containing a (non-using) binding to an import.  If one gets the
cluster ordering just right, an assert will trigger.  Relax that assert.

PR c++/99245
gcc/cp/
* module.cc (module_state::write_cluster): Relax binding assert.
gcc/testsuite/
* g++.dg/modules/pr99245_a.H: New.
* g++.dg/modules/pr99245_b.H: New.

[Bug middle-end/99322] [11 Regression] ICE in change_scope, at final.c:1480

2021-03-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99322

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

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

commit r11-7533-ga3ad6489d38982434faef3bc5f33e3c28c5f7c74
Author: Jakub Jelinek 
Date:   Fri Mar 5 21:52:35 2021 +0100

openmp: Avoid ICEs due to orphaned labels in OpenMP regions [PR99322]

When performing cfg cleanup at the end of cfg pass, if there are any OpenMP
regions and some basic blocks are unreachable and contain forced labels,
remove_bb moves the labels to previous bb, but if the two bb belong to
different
OpenMP regions, that means it will end up in a different function from
where
it was assumed to be and checked e.g. during gimplification or OpenMP
region
SESE checking.

The following patch will place the labels to some bb from the right OpenMP
region if the previous bb is not that.  I think it should happen very
rarely,
normally the bbs from each OpenMP region should be from the before-cfg pass
adjacent and the problems will usually be only if the OpenMP regions are
no-return, so I hope it isn't fatal that it searches through all bbs on the
miss.
If it turns out to be a problem, it can always lazily create some better
data
structure and maintain it through bb removals when it reaches that case the
first time.

2021-03-05  Jakub Jelinek  

PR middle-end/99322
* tree-cfg.c (bb_to_omp_idx): New variable.
(execute_build_cfg): Release the bb_to_omp_idx vector after
cleanup_tree_cfg returns.
(handle_abnormal_edges): Remove bb_to_omp_idx argument, adjust
for bb_to_omp_idx being a vec instead of pointer to array
of ints.
(make_edges): Remove bb_to_omp_idx local variable, don't pass
it to handle_abnormal_edges, adjust for bb_to_omp_idx being a
vec instead of pointer to array of ints and don't free/release
it at the end.
(remove_bb): When removing a bb and placing forced label somewhere
else, ensure it is put into the same OpenMP region during cfg
pass if possible or to entry successor as fallback.  Unregister
bb from bb_to_omp_idx.

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

[Bug c/99363] [11 regression] gcc.dg/attr-flatten-1.c fails starting with r11-7469

2021-03-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99363

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

https://gcc.gnu.org/g:812230c63c3efcf2cb36965fe178420b5f1892a6

commit r11-7534-g812230c63c3efcf2cb36965fe178420b5f1892a6
Author: Jason Merrill 
Date:   Fri Mar 5 17:07:25 2021 -0500

testsuite: Update testcase for PR96078 fix [PR99363]

My fix for PR96078 made us stop warning about flatten on an alias if the
target has the alias, which is exactly the case tested here.  So let's
remove the expected warning and add a similar case which does warn.

gcc/testsuite/ChangeLog:

PR c/99363
* gcc.dg/attr-flatten-1.c: Adjust.

[Bug c++/99120] [8/9/10/11 Regression] ICE in -Wshadow in templated member function

2021-03-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99120

--- Comment #2 from CVS Commits  ---
The master branch has been updated by Marek Polacek :

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

commit r11-7535-gc2e64c33d9d903f0a52565ad98300feea0ffc580
Author: Marek Polacek 
Date:   Fri Mar 5 10:41:41 2021 -0500

c++: ICE with -Wshadow and enumerator in template [PR99120]

We crash here, because in a template, an enumerator doesn't have
a type until we've called finish_enum_value_list.  But our -Wshadow
implementation, check_local_shadow, is called when we pushdecl in
build_enumerator, which takes place before finish_enum_value_list.

gcc/cp/ChangeLog:

PR c++/99120
* name-lookup.c (check_local_shadow): Check if the type of decl
is non-null before checking TYPE_PTR*.

gcc/testsuite/ChangeLog:

PR c++/99120
* g++.dg/warn/Wshadow-17.C: New test.

[Bug c++/99374] [8/9/10/11 Regression] C++17/20 mode fails to recognise pointer-to-member functions of incomplete types in conditional expression

2021-03-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99374

--- Comment #5 from CVS Commits  ---
The master branch has been updated by Marek Polacek :

https://gcc.gnu.org/g:02a3554879001e8f1405d17e096ed68fc3f76975

commit r11-7536-g02a3554879001e8f1405d17e096ed68fc3f76975
Author: Marek Polacek 
Date:   Thu Mar 4 14:25:01 2021 -0500

c++: Pointer-to-member fn conversion with noexcept [PR99374]

The issue in this PR is that we wrongly reject converting pointers to
member function of incomplete types, one of which has noexcept.  Recall
that pointers (including pointers to member functions) to non-throwing
functions can be implicitly converted to potentially-throwing functions
(but not vice versa).

We reject the conversion when called from can_convert_arg_bad because
standard_conversion can't create such a conversion.  It comes down to
the DERIVED_FROM_P check in the TYPE_PTRMEMFUNC_P block.  It considers
every class derived from itself, but not when the class is incomplete.
But surely we want to reach fnptr_conv_p when tbase is fbase (one of
them could be an alias to the other so use same_type_p instead of ==).

Another approach would be to not perform DERIVED_FROM_P at all when
either tbase or fbase are incomplete (so perhaps something like at the
end of ptr_reasonably_similar).

gcc/cp/ChangeLog:

PR c++/99374
* call.c (standard_conversion): When converting pointers to
member, don't return NULL when the bases are equivalent but
incomplete.

gcc/testsuite/ChangeLog:

PR c++/99374
* g++.dg/cpp1z/noexcept-type23.C: New test.

[Bug c++/99365] [11 Regression] ICE on partial specialization with constrained placeholder NTTP

2021-03-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99365

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

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

commit r11-7540-gb49d23f3e238c08bdbc5b892b2ed0a57b5f5caf9
Author: Patrick Palka 
Date:   Sat Mar 6 00:07:35 2021 -0500

c++: adc_unify deduction with constrained auto [PR99365]

My recent r11-7454 changed the way do_auto_deduction handles constrained
placeholders during template argument deduction (context == adc_unify)
when processing_template_decl != 0.  Before the patch, we would just
ignore the constraints on the placeholder, and return the deduced type.
After the patch, we now punt and return the original placeholder type

While this change fixed instances where we'd prematurely resolve a
constrained placeholder return or variable type with non-dependent
initializer at template parse time (such as PR96444), it broke the
adc_unify callers that rely on the previous behavior.

This patch restores the previous behavior during adc_unify deduction
while retaining the new behavior only during adc_variable_type or
adc_return_type deduction.

We additionally now need to pass the outer template arguments to
do_auto_deduction during unify, for sake of constraint checking.
But we want to avoid substituting these outer arguments into type
when the caller has already done so, so this patch adds a
TEMPLATE_TYPE_LEVEL check to do_auto_deduction to that effect.

This above is enough to fix partial specialization of non-nested
templates with constrained 'auto' template parameters, but it doesn't
fix the nested template case, ultimately because
most_specialized_partial_spec passes only the innermost template
arguments to get_partial_spec_bindings, and so outer_targs during
do_auto_deduction (called from unify) contains only the innermost
template arguments, and this breaks satisfaction.  Fixing this properly
is perhaps too risky at this stage, so this patch adds a hack to
do_auto_deduction to compensate for callers that don't supply all outer
template arguments.  The goal of this hack is to ensure placeholder type
constraint checking continues to work whenever it worked before
r11-7454, namely whenever the constraint is non-dependent.

Finally, this patch allows do_auto_deduction to resolve a constrained
placeholder type ahead of time (at template parse time), as long as the
constraint is non-dependent.

gcc/cp/ChangeLog:

PR c++/99365
* pt.c (unify) : Pass targs as
outer_targs to do_auto_deduction.
(placeholder_type_constraint_dependent_p): Define.
(do_auto_deduction): When processing_template_decl != 0
and context is adc_unify and we have constraints, pretend the
constraints are satisfied instead of punting.  Otherwise don't
punt unless placeholder_type_constraint_dependent_p holds.
Add some clarifying sanity checks.  Add a hack to add missing
outermost template levels to outer_args before checking
satisfaction.  Don't substitute outer_targs into type if it's
already been done.

gcc/testsuite/ChangeLog:

PR c++/99365
* g++.dg/cpp2a/concepts-partial-spec9.C: New test.
* g++.dg/cpp2a/concepts-placeholder4.C: New test.

[Bug c++/96330] Constexpr variables cannot be used in the template context.

2021-03-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96330

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

https://gcc.gnu.org/g:574e7601829733d7cae20b5dc7034b876cc76b30

commit r11-7541-g574e7601829733d7cae20b5dc7034b876cc76b30
Author: Patrick Palka 
Date:   Sat Mar 6 00:07:43 2021 -0500

c++: Fix tsubsting member variable template-id [PR96330]

This makes tsubst_copy appropriately handle a variable template-id, which
in turn fixes tsubsting a COMPONENT_REF whose member operand is known at
parse time to be a variable template-id, as in the initialization of 'x'
in the first testcase.  Previously, we rejected this testcase with the
error "foo_t::bar is not a function template", issued from
lookup_template_fuction.

We were already properly handling the analagous case where the object
operand of the COMPONENT_REF is dependent (and so the member operand is
a dependent template name), but there doesn't seems to be existing test
coverage for this, hence the second testcase below.

gcc/cp/ChangeLog:

PR c++/96330
* pt.c (tsubst_copy) : Rename local
variable 'fn' to 'tmpl'.  Handle a variable template-id by
calling lookup_template_variable.

gcc/testsuite/ChangeLog:

PR c++/96330
* g++.dg/cpp1y/var-templ68.C: New test.
* g++.dg/cpp1y/var-templ68a.C: New test.

Co-authored-by: Jakub Jelinek 

[Bug tree-optimization/99396] std::rotl and std::rotr Does not convert into ROTATE on the gimple level

2021-03-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99396

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

https://gcc.gnu.org/g:84185598dc7470bad4e7f8c22b64e3c944efb670

commit r11-7542-g84185598dc7470bad4e7f8c22b64e3c944efb670
Author: Jakub Jelinek 
Date:   Sat Mar 6 11:11:30 2021 +0100

libstdc++: Improve std::rot[lr] [PR99396]

As can be seen on:

unsigned char f1 (unsigned char x, int y) { return std::rotl (x, y); }
unsigned char f2 (unsigned char x, int y) { return std::rotr (x, y); }
unsigned short f3 (unsigned short x, int y) { return std::rotl (x, y); }
unsigned short f4 (unsigned short x, int y) { return std::rotr (x, y); }
unsigned int f5 (unsigned int x, int y) { return std::rotl (x, y); }
unsigned int f6 (unsigned int x, int y) { return std::rotr (x, y); }
unsigned long int f7 (unsigned long int x, int y) { return std::rotl (x,
y); }
unsigned long int f8 (unsigned long int x, int y) { return std::rotr (x,
y); }
unsigned long long int f9 (unsigned long long int x, int y) { return
std::rotl (x, y); }
unsigned long long int f10 (unsigned long long int x, int y) { return
std::rotr (x, y); }
//unsigned __int128 f11 (unsigned __int128 x, int y) { return std::rotl (x,
y); }
//unsigned __int128 f12 (unsigned __int128 x, int y) { return std::rotr (x,
y); }

constexpr auto a = std::rotl (1234U, 0);
constexpr auto b = std::rotl (1234U, 5);
constexpr auto c = std::rotl (1234U, -5);
constexpr auto d = std::rotl (1234U, -__INT_MAX__ - 1);
the current  definitions of std::__rot[lr] aren't pattern recognized
as rotates, they are too long/complex for that, starting with signed
modulo,
special case for 0 and different cases for positive and negative.

For types with power of two bits the following patch adds definitions that
the compiler can pattern recognize and turn e.g. on x86_64 into
ro[lr][bwlq]
instructions.  For weirdo types like unsigned __int20 etc. it keeps the
current definitions.

2021-03-06  Jakub Jelinek  

PR libstdc++/99396
* include/std/bit (__rotl, __rotr): Add optimized variants for
power of
two _Nd which the compiler can pattern match the rotates.

[Bug c/99137] ICE in gimplify_scan_omp_clauses, at gimplify.c:9833

2021-03-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99137

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

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

commit r10-9419-ged8fede89a705b031d3123c502717d7bc8b29320
Author: Tobias Burnus 
Date:   Fri Mar 5 11:41:44 2021 +0100

OpenACC: C/C++ - fix async parsing [PR99137]

gcc/c/ChangeLog:

PR c/99137
* c-parser.c (c_parser_oacc_clause_async): Reject comma
expressions.

gcc/cp/ChangeLog:

PR c/99137
* parser.c (cp_parser_oacc_clause_async): Reject comma expressions.

gcc/testsuite/ChangeLog:

PR c/99137
* c-c++-common/goacc/asyncwait-1.c: Update dg-error; add
additional test.

(cherry picked from commit 6ddedd3efa3fe482f76a4037521a06b3ac9f2a8b)

[Bug c/99137] ICE in gimplify_scan_omp_clauses, at gimplify.c:9833

2021-03-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99137

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

https://gcc.gnu.org/g:47a0284fe7d4c996cc054c13e196ee3983025fb3

commit r9-9270-g47a0284fe7d4c996cc054c13e196ee3983025fb3
Author: Tobias Burnus 
Date:   Fri Mar 5 11:41:44 2021 +0100

OpenACC: C/C++ - fix async parsing [PR99137]

gcc/c/ChangeLog:

PR c/99137
* c-parser.c (c_parser_oacc_clause_async): Reject comma
expressions.

gcc/cp/ChangeLog:

PR c/99137
* parser.c (cp_parser_oacc_clause_async): Reject comma expressions.

gcc/testsuite/ChangeLog:

PR c/99137
* c-c++-common/goacc/asyncwait-1.c: Update dg-error; add
additional test.

(cherry picked from commit 6ddedd3efa3fe482f76a4037521a06b3ac9f2a8b)

[Bug gcov-profile/99406] [11 regression] MAP_ANONYMOUS undeclared in libgcov.h

2021-03-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99406

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

https://gcc.gnu.org/g:73a9216b8a47889234c94e3aaec193391ee6604d

commit r11-7543-g73a9216b8a47889234c94e3aaec193391ee6604d
Author: Jakub Jelinek 
Date:   Sat Mar 6 16:22:27 2021 +0100

libgcov: Fix build on Darwin [PR99406]

As reported, bootstrap currently fails on older Darwin because
MAP_ANONYMOUS
is not defined.

The following is what gcc/system.h does, so I think it should work for
libgcov.

2021-03-06  Jakub Jelinek  

PR gcov-profile/99406
* libgcov.h (MAP_FAILED, MAP_ANONYMOUS): If HAVE_SYS_MMAN_H is
defined, define these macros if not defined already.

[Bug libfortran/99218] [8/9/10/11 Regression] matmul on temporary array accesses invalid memory (segfault)

2021-03-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99218

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

https://gcc.gnu.org/g:4fbef612ca1adb71c90eab0d6a682ec6af5b7c93

commit r10-9420-g4fbef612ca1adb71c90eab0d6a682ec6af5b7c93
Author: Harald Anlauf 
Date:   Fri Mar 5 20:57:54 2021 +0100

PR libfortran/99218 - matmul on temporary array accesses invalid memory

Do not invoke tuned rank-2 times rank-2 matmul if rank(b) == 1.

libgfortran/ChangeLog:

PR libfortran/99218
* m4/matmul_internal.m4: Invoke tuned matmul only for rank(b)>1.
* generated/matmul_c10.c: Regenerated.
* generated/matmul_c16.c: Likewise.
* generated/matmul_c4.c: Likewise.
* generated/matmul_c8.c: Likewise.
* generated/matmul_i1.c: Likewise.
* generated/matmul_i16.c: Likewise.
* generated/matmul_i2.c: Likewise.
* generated/matmul_i4.c: Likewise.
* generated/matmul_i8.c: Likewise.
* generated/matmul_r10.c: Likewise.
* generated/matmul_r16.c: Likewise.
* generated/matmul_r4.c: Likewise.
* generated/matmul_r8.c: Likewise.
* generated/matmulavx128_c10.c: Likewise.
* generated/matmulavx128_c16.c: Likewise.
* generated/matmulavx128_c4.c: Likewise.
* generated/matmulavx128_c8.c: Likewise.
* generated/matmulavx128_i1.c: Likewise.
* generated/matmulavx128_i16.c: Likewise.
* generated/matmulavx128_i2.c: Likewise.
* generated/matmulavx128_i4.c: Likewise.
* generated/matmulavx128_i8.c: Likewise.
* generated/matmulavx128_r10.c: Likewise.
* generated/matmulavx128_r16.c: Likewise.
* generated/matmulavx128_r4.c: Likewise.
* generated/matmulavx128_r8.c: Likewise.

gcc/testsuite/ChangeLog:

PR libfortran/99218
* gfortran.dg/matmul_21.f90: New test.

(cherry picked from commit b1bee29167df6b0fbc9a4c8d06e2acbf3367af47)

[Bug c++/99287] std::source_location::function_name breaks constexpr

2021-03-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99287

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

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

commit r11-7546-gd1bba463bd0d5692b7fa58ee37a61a55b2517456
Author: Patrick Palka 
Date:   Sat Mar 6 17:09:07 2021 -0500

c++: Fix constexpr evaluation of pre-increment when !lval [PR99287]

Here, during cxx_eval_increment_expression (with lval=false) of
++__first where __first is &"mystr"[0], we correctly update __first
to &"mystr"[1] but we end up returning &"mystr"[0] + 1 instead of
&"mystr"[1].  This unreduced return value inhibits other pointer
arithmetic folding during later constexpr evaluation, which ultimately
causes the constexpr evaluation to fail.

It turns out the simplification of &"mystr"[0] + 1 to &"mystr"[1]
is performed by cxx_fold_pointer_plus_expression, not by fold_build2.
So we perform this simplification during constexpr evaluation of
the temporary MODIFY_EXPR (during which we assign to __first the
simplified value), but then we return 'mod' which has only been folded
via fold_build2 and hasn't gone through cxx_fold_pointer_plus_expression.

This patch fixes this by updating 'mod' with the result of the
MODIFY_EXPR evaluation appropriately, so that it captures any additional
folding of the expression when !lval.  We now need to be wary of this
evaluation failing and returning e.g. the MODIFY_EXPR or NULL_TREE; it
seems checking *non_constant_p should cover our bases here and is
generally prudent.

gcc/cp/ChangeLog:

PR c++/99287
* constexpr.c (cxx_eval_increment_expression): Pass lval when
evaluating the MODIFY_EXPR, and update 'mod' with the result of
this evaluation.  Check *non_constant_p afterwards.  For prefix
ops, just return 'mod'.

gcc/testsuite/ChangeLog:

PR c++/99287
* g++.dg/cpp2a/constexpr-99287.C: New test.

Co-authored-by: Jakub Jelinek 

[Bug target/99321] [11 Regression] ICE: in extract_constrain_insn, at recog.c:2670: insn does not satisfy its constraints: {*uminv16qi3} since r11-7121-g37876976b0511ec9

2021-03-07 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99321

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

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

commit r11-7548-ga18ebd6c439227b048a91fbfa66f5983f884c157
Author: Jakub Jelinek 
Date:   Sun Mar 7 10:27:28 2021 +0100

i386: Fix some -mavx512vl -mno-avx512bw bugs [PR99321]

As I wrote in the mail with the previous PR99321 fix, we have various
bugs where we emit instructions that need avx512bw and avx512vl
ISAs when compiling with -mavx512vl -mno-avx512bw.

Without the following patch, the attached testcase fails with:
/tmp/ccW4PsfG.s: Assembler messages:
/tmp/ccW4PsfG.s:9: Error: unsupported instruction `vpaddb'
/tmp/ccW4PsfG.s:20: Error: unsupported instruction `vpaddb'
/tmp/ccW4PsfG.s:31: Error: unsupported instruction `vpaddw'
/tmp/ccW4PsfG.s:42: Error: unsupported instruction `vpaddw'
/tmp/ccW4PsfG.s:53: Error: unsupported instruction `vpsubb'
/tmp/ccW4PsfG.s:64: Error: unsupported instruction `vpsubb'
/tmp/ccW4PsfG.s:75: Error: unsupported instruction `vpsubw'
/tmp/ccW4PsfG.s:86: Error: unsupported instruction `vpsubw'
/tmp/ccW4PsfG.s:97: Error: unsupported instruction `vpmullw'
/tmp/ccW4PsfG.s:108: Error: unsupported instruction `vpmullw'
/tmp/ccW4PsfG.s:133: Error: unsupported instruction `vpminub'
/tmp/ccW4PsfG.s:144: Error: unsupported instruction `vpminuw'
/tmp/ccW4PsfG.s:155: Error: unsupported instruction `vpminuw'
/tmp/ccW4PsfG.s:166: Error: unsupported instruction `vpminsb'
/tmp/ccW4PsfG.s:177: Error: unsupported instruction `vpminsb'
/tmp/ccW4PsfG.s:202: Error: unsupported instruction `vpminsw'
/tmp/ccW4PsfG.s:227: Error: unsupported instruction `vpmaxub'
/tmp/ccW4PsfG.s:238: Error: unsupported instruction `vpmaxuw'
/tmp/ccW4PsfG.s:249: Error: unsupported instruction `vpmaxuw'
/tmp/ccW4PsfG.s:260: Error: unsupported instruction `vpmaxsb'
/tmp/ccW4PsfG.s:271: Error: unsupported instruction `vpmaxsb'
/tmp/ccW4PsfG.s:296: Error: unsupported instruction `vpmaxsw'

We already have Yw constraint which is equivalent to v for
-mavx512bw -mavx512vl and to nothing otherwise, per discussions
this patch changes it to stand for x otherwise.  As it is an
undocumented internal constraint, hopefully it won't affect
any inline asm in the wild.
For the instructions that need both we need to use Yw and
v for modes that don't need that.

2021-03-07  Jakub Jelinek  

PR target/99321
* config/i386/constraints.md (Yw): Use SSE_REGS if TARGET_SSE
but TARGET_AVX512BW or TARGET_AVX512VL is not set.  Adjust
description
and comment.
* config/i386/sse.md (v_Yw): New define_mode_attr.
(*3, *mul3, *avx2_3,
*sse4_1_3): Use  instead of v
in constraints.
* config/i386/mmx.md (mmx_pshufw_1, *vec_dupv4hi): Use Yw instead
of
xYw in constraints.

* lib/target-supports.exp
(check_effective_target_assembler_march_noavx512bw): New effective
target.
* gcc.target/i386/avx512vl-pr99321-1.c: New test.

[Bug target/85074] FAIL: g++.dg/torture/pr81812.C (test for excess errors)

2021-03-07 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85074

--- Comment #6 from CVS Commits  ---
The releases/gcc-9 branch has been updated by John David Anglin
:

https://gcc.gnu.org/g:4f01123ca27e648611016d00c3ed95945f27ab30

commit r9-9272-g4f01123ca27e648611016d00c3ed95945f27ab30
Author: John David Anglin 
Date:   Sun Mar 7 17:44:49 2021 +

Add mi_thunk support for vcalls on hppa.

gcc/ChangeLog:

PR target/85074
* config/pa/pa.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): Define as
hook_bool_const_tree_hwi_hwi_const_tree_true.
(pa_asm_output_mi_thunk): Add support for nonzero vcall_offset.

  1   2   3   4   5   6   7   8   9   10   >