We were deferring access checks while parsing B<int>{}, didn't adjust that
when we went to instantiate the default member initializer for B::c,
deferred access checking for C::C, and then checked it after parsing
B<int>{}, back in the main() context which has no access. We need to do the
access checks in the class context of the DMI.
I tried fixing this in push_to/pop_from_top_level, but that caused several
regressions.
gcc/cp/ChangeLog:
PR c++/96673
* init.c (get_nsdmi): Don't defer access checking.
gcc/testsuite/ChangeLog:
PR c++/96673
* g++.dg/cpp1y/nsdmi-aggr13.C: New test.
C++17 makes constexpr static data members implicitly inline variables. In
C++14, a subsequent out-of-class declaration is the definition. We want to
continue emitting a symbol for such a declaration in C++17 mode, for ABI
compatibility with C++14 code that wants to refer to it.
Normally I'd distinguish in- and out-of-class declarations by looking at
DECL_IN_AGGR_P, but we never set DECL_IN_AGGR_P on inline variables. I
think that's wrong, but don't want to mess with it so close to release.
Conveniently, we already have a test for in-class declaration earlier in the
function.
gcc/cp/ChangeLog:
PR c++/99901
* decl.c (cp_finish_decl): mark_needed an implicitly inline
static data member with an out-of-class redeclaration.
gcc/testsuite/ChangeLog:
PR c++/99901
* g++.dg/cpp1z/inline-var9.C: New test.
Add [[nodiscard]] to functions that are effectively just a static_cast,
as per P2351. Also add it to std::addressof.
libstdc++-v3/ChangeLog:
* include/bits/move.h (forward, move, move_if_noexcept)
(addressof): Add _GLIBCXX_NODISCARD.
* include/bits/ranges_cmp.h (identity::operator()): Add
nodiscard attribute.
* include/c_global/cstddef (to_integer): Likewise.
* include/std/bit (bit_cast): Likewise.
* include/std/utility (as_const, to_underlying): Likewise.
libstdc++-v3/ChangeLog:
* include/bits/move.h (forward): Change static_assert message
to be unambiguous about what must be true.
* testsuite/20_util/forward/c_neg.cc: Adjust dg-error.
* testsuite/20_util/forward/f_neg.cc: Likewise.
libstdc++-v3/ChangeLog:
* include/bits/alloc_traits.h: Use markdown for code font.
* include/bits/basic_string.h: Fix @param names.
* include/bits/max_size_type.h: Remove period after @file.
* include/bits/regex.h: Fix duplicate @retval names, and rename.
* include/ext/pb_ds/detail/priority_queue_base_dispatch.hpp: Add
group open to match existing group close.
* include/ext/pb_ds/priority_queue.hpp: Add blank line before group
open.
The PR is about incorrect use of partial_subreg_p for unordered modes.
I found 2 places of dangerous comparing unordered modes in LRA. The
patch removes dangerous use of paradoxical_subreg_p and
partial_subreg_p in split_reg and process_bb_lives. The both places
used them to solve PR77761 long time ago. But the problem was also
fixed by later patches too (if there is no hard reg explicitly, it
have VOIDmode and we use natural mode to split hard reg live,
otherwise we use the biggest explicitly used mode for hard reg
splitting). The PR also says about inaccurate update of reg notes in
LRA. It happens for reg notes which refer for multi-registers. The
patch also fixes this issue.
gcc/ChangeLog:
PR target/99781
* lra-constraints.c (split_reg): Don't check paradoxical_subreg_p.
* lra-lives.c (clear_sparseset_regnos, regnos_in_sparseset_p): New
functions.
(process_bb_lives): Don't update biggest mode of hard reg for
implicit in multi-register group. Use the new functions for
updating dead_set and unused_set by register notes.
gcc/testsuite/ChangeLog:
PR target/99781
* g++.target/aarch64/sve/pr99781.C: New.
Simply memcpy and memset inline strategies to avoid branches for
Skylake family CPUs:
1. With MOVE_RATIO and CLEAR_RATIO == 17, GCC will use integer/vector
load and store for up to 16 * 16 (256) bytes when the data size is
fixed and known.
2. Inline only if data size is known to be <= 256.
a. Use "rep movsb/stosb" with simple code sequence if the data size
is a constant.
b. Use loop if data size is not a constant.
3. Use memcpy/memset libray function if data size is unknown or > 256.
On Cascadelake processor with -march=native -Ofast -flto,
1. Performance impacts of SPEC CPU 2017 rate are:
500.perlbench_r 0.17%
502.gcc_r -0.36%
505.mcf_r 0.00%
520.omnetpp_r 0.08%
523.xalancbmk_r -0.62%
525.x264_r 1.04%
531.deepsjeng_r 0.11%
541.leela_r -1.09%
548.exchange2_r -0.25%
557.xz_r 0.17%
Geomean -0.08%
503.bwaves_r 0.00%
507.cactuBSSN_r 0.69%
508.namd_r -0.07%
510.parest_r 1.12%
511.povray_r 1.82%
519.lbm_r 0.00%
521.wrf_r -1.32%
526.blender_r -0.47%
527.cam4_r 0.23%
538.imagick_r -1.72%
544.nab_r -0.56%
549.fotonik3d_r 0.12%
554.roms_r 0.43%
Geomean 0.02%
2. Significant impacts on eembc benchmarks are:
eembc/idctrn01 9.23%
eembc/nnet_test 29.26%
gcc/
* config/i386/x86-tune-costs.h (skylake_memcpy): Updated.
(skylake_memset): Likewise.
(skylake_cost): Change CLEAR_RATIO to 17.
* config/i386/x86-tune.def (X86_TUNE_PREFER_KNOWN_REP_MOVSB_STOSB):
Replace m_CANNONLAKE, m_ICELAKE_CLIENT, m_ICELAKE_SERVER,
m_TIGERLAKE and m_SAPPHIRERAPIDS with m_SKYLAKE and m_CORE_AVX512.
gcc/testsuite/
* gcc.target/i386/memcpy-strategy-9.c: New test.
* gcc.target/i386/memcpy-strategy-10.c: Likewise.
* gcc.target/i386/memcpy-strategy-11.c: Likewise.
* gcc.target/i386/memset-strategy-7.c: Likewise.
* gcc.target/i386/memset-strategy-8.c: Likewise.
* gcc.target/i386/memset-strategy-9.c: Likewise.
This adds a relevancy check before trying to set the vector def of
a backedge in an unvectorized PHI.
2021-04-06 Richard Biener <rguenther@suse.de>
PR tree-optimization/99880
* tree-vect-loop.c (maybe_set_vectorized_backedge_value): Only
set vectorized defs of relevant PHIs.
* gcc.dg/torture/pr99880.c: New testcase.
The va_arg scans are just too brittle. Let's not be that picky. We
have other tested builtins that are less brittle now anyway.
gcc/testsuite/
* g++.dg/modules/builtin-3_a.C: Remove dump scans.
* g++.dg/modules/builtin-3_b.C: Remove dump scans.
On Thu, Apr 01, 2021 at 02:16:55PM +0100, Alex Coplan via Gcc-patches wrote:
> FYI, I'm seeing the new test failing on aarch64:
>
> PASS: gcc.dg/pr96573.c (test for excess errors)
> FAIL: gcc.dg/pr96573.c scan-tree-dump optimized "__builtin_bswap"
The vectorizer in the aarch64 case manages to emit a VEC_PERM_EXPR instead
(which is just as efficient).
So, do we want to go for the following (and/or perhaps also restrict the test to
a couple of targets where it works? In my last distro build it failed only
on aarch64-linux, while armv7hl-linux-gnueabi and
{i686,x86_64,powerpc64le,s390x}-linux were fine)?
2021-04-06 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/96573
* gcc.dg/pr96573.c: Instead of __builtin_bswap accept also
VEC_PERM_EXPR with bswapping permutation.
Since SLP graph partitioning works on scalar stmts (because it's done
for costing) we have to make sure to visit permute nodes multiple
times since they will not pull partitions together.
2021-04-06 Richard Biener <rguenther@suse.de>
PR tree-optimization/99924
* tree-vect-slp.c (vect_bb_partition_graph_r): Do not mark
nodes w/o scalar stmts as visited.
* gfortran.dg/vect/pr99924.f90: New testcase.
The test FAILs on i686-linux due to -Wpsabi diagnostics.
2021-04-06 Jakub Jelinek <jakub@redhat.com>
PR c++/97900
* g++.dg/ext/vector40.C: Add -Wno-psabi -w to dg-options.
This patch fixes PR99748 which shows us trying to pass the argument to
__aeabi_f2iz in the VFP register s0 when the library function is
expecting to use the GPR r0. It also fixes the __aeabi_f2uiz case which
was broken in the same way.
For the testcase in the PR, here is the code we generate before the
patch (with -mfloat-abi=hard -march=armv8.1-m.main+mve -O0):
main:
push {r7, lr}
sub sp, sp, #8
add r7, sp, #0
mov r3, #1065353216
str r3, [r7, #4] @ float
vldr.32 s0, [r7, #4]
bl __aeabi_f2iz
mov r3, r0
cmp r3, #1
[...]
This becomes:
main:
push {r7, lr}
sub sp, sp, #8
add r7, sp, #0
mov r3, #1065353216
str r3, [r7, #4] @ float
ldr r0, [r7, #4] @ float
bl __aeabi_f2iz
mov r3, r0
cmp r3, #1
[...]
after the patch. We see a similar change for the same testcase with a
cast to unsigned instead of int.
gcc/ChangeLog:
PR target/99748
* config/arm/arm.c (arm_libcall_uses_aapcs_base): Also use base
PCS for [su]fix_optab.
In this testcase, the parms remembered in LAMBDA_EXPR_EXTRA_SCOPE are no
longer the parms of the FUNCTION_DECL they have as their DECL_CONTEXT, so we
were mangling both lambdas as parm #0. But since the parms are numbered
from right to left we don't need to need to find them in the FUNCTION_DECL,
we can measure their own DECL_CHAIN.
gcc/cp/ChangeLog:
PR c++/91241
* mangle.c (write_compact_number): Add sanity check.
(write_local_name): Use list_length for parm number.
gcc/testsuite/ChangeLog:
PR c++/91241
* g++.dg/abi/lambda-defarg1.C: New test.
In this PR, we're crashing because the constraint handling inside
do_auto_deduction doesn't expect to see an adc_decomp_type context.
This patch fixes this by treating adc_decomp_type like adc_variable_type
or adc_return_type during placeholder type constraint checking.
Meanwhile, I noticed we weren't checking constraints at all when binding
an array via a structured binding, since do_auto_deduction would exit
early and bypass the constraint check. This patch fixes this by
replacing the early exit with an appropriate setup of the 'targs'
vector.
gcc/cp/ChangeLog:
PR c++/99899
* pt.c (do_auto_deduction): Don't exit early when deducing the
array type of a structured binding. Also handle adc_decomp_type
during constraint checking.
gcc/testsuite/ChangeLog:
PR c++/99899
* g++.dg/cpp2a/concepts-placeholder7.C: New test.
* g++.dg/cpp2a/concepts-placeholder8.C: New test.
We never called mark_use for a return value in a function with dependent
return type. In that situation we don't know if the use is as an rvalue or
lvalue, but we can use mark_exp_read instead.
gcc/cp/ChangeLog:
PR c++/96311
* typeck.c (check_return_expr): Call mark_exp_read in dependent
case.
gcc/testsuite/ChangeLog:
PR c++/96311
* g++.dg/cpp1y/lambda-generic-Wunused.C: New test.
In r260622 I allowed this under the general principle that [basic.lval]
"Whenever a prvalue appears as an operand of an operator that expects a
glvalue for that operand, the temporary materialization conversion (7.3.4)
is applied to convert the expression to an xvalue." But
[expr.reinterpret.cast] specifically excludes creating a temporary in this
case.
gcc/cp/ChangeLog:
PR c++/98440
* typeck.c (build_reinterpret_cast_1): Don't perform
temporary materialization.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/rv-cast6.C: Expect reinterpret_cast error.
* g++.dg/cpp0x/reinterpret_cast2.C: Adjust message.
* g++.old-deja/g++.jason/rvalue3.C: Likewise.
Here we weren't instantiating the enumerators because the arglist still had
the template parameter for the generic lambda, so looking one up failed. We
need to instantiate if the non-lambda enclosing scope is non-dependent.
gcc/cp/ChangeLog:
PR c++/95317
* pt.c (lookup_template_class_1): Do tsubst_enum when
tsubsting a generic lambda.
gcc/testsuite/ChangeLog:
PR c++/95317
* g++.dg/cpp1y/lambda-generic-enum1.C: New test.
Here enclosing_instantiation_of was failing to find a match because otctx is
struct S<T> and current_function_decl is S<int>::S(), so the latter has more
function contexts, and we end up trying to compare S() to NULL_TREE.
After spending a bit of time working on establishing the correspondence in
this case (class <=> constructor), it occurred to me that we could just use
DECL_SOURCE_LOCATION, which is unique for lambdas, since they cannot be
redeclared. Since we're so close to release, for now I'm only doing this
for the case that was failing before.
gcc/cp/ChangeLog:
PR c++/95870
* pt.c (enclosing_instantiation_of): Compare DECL_SOURCE_LOCATION if
there is no enclosing non-lambda function.
gcc/testsuite/ChangeLog:
PR c++/95870
* g++.dg/cpp0x/lambda/lambda-nsdmi10.C: New test.
When the enumeration constants of an enumeration type are defined by
explicit values, the binding generated by -fdump-ada-spec does not use
an enumeration type on the Ada side, because the set of allowed values
in C/C++ is larger than the set of allowed values in Ada, but instead
use an integer subtype and defines a set of explicit constants, which
used to be of this subtype but were changed to the base type at some
point. This reinstates the subtype for them.
gcc/c-family/
* c-ada-spec.c (is_simple_enum): Minor tweaks.
(dump_ada_enum_type): Add TYPE and PARENT parameters. For non-simple
enumeral types use again the type name for the enumeration constants.
(dump_ada_node): Adjust call to dump_ada_enum_type.
(dump_nested_type): Likewise.
This patch fixes the problem that the Decimal <-> Float128 conversions
were built even if the user configured GCC with --disable-decimal-float.
libgcc/
2021-04-05 Florian Weimer <fweimer@redhat.com>
* config/rs6000/t-float128 (fp128_ppc_funcs): Add decimal floating
point functions for $(decimal_float) only.
Co-Authored-By: Michael Meissner <meissner@linux.ibm.com>
This problem got introduced fixing a module numbering problem. When
preprocessing a header unit, we don't need to send an EXPORT query
unless we're also determining dependencies, or the mapper asked us
to. Sadly the testsuite isn't set up to test this kind of subtlety.
I manually did that with stdin/stdout.
PR c++/99380
gcc/cp/
* module.cc (name_pending_imports): Drop 'atend' parm. Don't
query export when not needed.
(preprocess_module, preprocessed_module): Adjust.
gcc/analyzer/ChangeLog:
PR analyzer/99906
* analyzer.cc (maybe_reconstruct_from_def_stmt): Fix NULL
dereference on calls with zero arguments.
* sm-malloc.cc (malloc_state_machine::on_stmt): When handling
__attribute__((nonnull)), only call get_diagnostic_tree if the
result will be used.
gcc/testsuite/ChangeLog:
PR analyzer/99906
* gcc.dg/analyzer/pr99906.c: New test.
The analyzer appeared to enter an infinite loop on malloc-1.c
when -fanalyzer-verbosity=0 was used. In fact, it was slowly
counting from 0 to 0xffffffff.
Root cause is looping up to effectively ((unsigned)0) - 1 in
diagnostic_manager::consolidate_conditions when there are no events
in the path.
Fixed by the following, which uses signed integers when subtracting
from path->num_events () when simplifying checker_paths.
gcc/analyzer/ChangeLog:
PR analyzer/99886
* diagnostic-manager.cc
(diagnostic_manager::prune_interproc_events): Use signed integers
when subtracting one from path->num_events ().
(diagnostic_manager::consolidate_conditions): Likewise. Convert
next_idx to a signed int.
gcc/testsuite/ChangeLog:
PR analyzer/99886
* gcc.dg/analyzer/pr99886.c: New test.
'extern template' should mean that the relevant symbols are never emitted.
But in this case we were assuming that DECL_EXTERNAL was already set on the
variable, so we just needed to clear DECL_NOT_REALLY_EXTERN. Since
DECL_EXTERNAL was not set, we emitted a definition of npos.
gcc/cp/ChangeLog:
PR c++/99066
* pt.c (mark_decl_instantiated): Set DECL_EXTERNAL.
gcc/testsuite/ChangeLog:
PR c++/99066
* g++.dg/cpp0x/extern_template-6.C: New test.
When building up *_EXTRA_ARGS for a constexpr if or pack expansion, we need
to walk into the body of a lambda to find all the local_specializations that
we need to remember, like we do in find_parameter_packs_r.
gcc/cp/ChangeLog:
PR c++/99201
* pt.c (class el_data): Add visited field.
(extract_local_specs): Pass it to cp_walk_tree.
(extract_locals_r): Walk into the body of a lambda.
gcc/testsuite/ChangeLog:
PR c++/99201
* g++.dg/cpp1z/constexpr-if-lambda4.C: New test.
The if allows TEMPLATE_DECL, but then checking DECL_MODULE_IMPORT_P crashes
on TEMPLATE_DECL. Fixed by stripping TEMPLATE_DECL first.
gcc/cp/ChangeLog:
* ptree.c (cxx_print_decl): Check DECL_MODULE_IMPORT_P on
template result.
The default linkage of templates in the D language is now DECL_WEAK
instead of DECL_ONE_ONLY, if supported. This better matches the
expected override semantics of template symbols compiled to object code.
For example:
module rt.config;
template rt_flag()
{
pragma(mangle, "rt_flag") __gshared bool rt_flag = true;
}
module main;
extern(C) __gshared bool rt_flag = false;
The above currently does not succeed in linking due to there being
multiple definitions of `rt_flag' in different sections that aren't
considered mergeable.
The compiler flag enabling toggling of this has been given a clearer
named `-fweak-templates', which distinguishes itself from G++ `-fweak',
which is intended only for testing.
gcc/d/ChangeLog:
PR d/99914
* d-lang.cc (d_init): Disable flag_weak_templates if no support for
weak or one-only symbols.
* d-tree.h (VAR_OR_FUNCTION_DECL_CHECK): New macro.
(DECL_INSTANTIATED): New macro.
(d_comdat_linkage): Remove declaration.
(d_linkonce_linkage): Remove declaration.
(set_linkage_for_decl): New declaration.
* decl.cc (DeclVisitor::visit (StructDeclaration *)): Replace call to
d_linkonce_linkage with setting DECL_INSTANTIATED.
(DeclVisitor::visit (ClassDeclaration *)): Likewise.
(DeclVisitor::visit (EnumDeclaration *)): Likewise.
(DeclVisitor::visit (InterfaceDeclaration *)): Remove call to
d_linkonce_linkage.
(get_symbol_decl): Call set_linkage_for_decl instead of
d_linkonce_linkage.
(d_finish_decl): Call set_linkage_for_decl.
(d_comdat_linkage): Made function static. Only set DECL_COMDAT for
DECL_INSTANTIATED decls.
(d_linkonce_linkage): Remove function.
(d_weak_linkage): New function.
(set_linkage_for_decl): New function.
* gdc.texi (Runtime Options): Rename -fno-weak to -fno-weak-templates,
update documentation of option.
* lang.opt (fweak): Rename option to ...
(fweak-templates): ... this. Update help string.
* modules.cc (get_internal_fn): Add Prot parameter. Set generated
function flag.
(build_internal_fn): Update call to get_internal_fn.
(build_dso_cdtor_fn): Likewise.
(register_moduleinfo): Call d_finish_decl on dso_slot_node and
dso_initialized_node.
* typeinfo.cc (TypeInfoVisitor::internal_reference): Call
set_linkage_for_decl instead of d_comdat_linkage.
(TypeInfoDeclVisitor::visit (TypeInfoDeclaration *)): Remove calls to
d_linkonce_linkage and d_comdat_linkage.
(get_cpp_typeinfo_decl): Likewise.
gcc/testsuite/ChangeLog:
PR d/99914
* gdc.dg/pr99914.d: New test.
nios2-elf defaults to -fno-delete-null-pointer-checks, which causes
failures in tests that assume the option is enabled. Make the
dependence explicit.
2021-04-04 Sandra Loosemore <sandra@codesourcery.com>
gcc/testsuite/
* gcc.dg/ipa/propmalloc-4.c: Add -fdelete-null-pointer-checks.
* gcc.dg/tree-ssa/evrp11.c: Likewise.
Here the get_foo() call results in a TARGET_EXPR, which we strip in
massage_init_elt, but then when build_vec_init tries to use it to initialize
the array element we crash because build_aggr_init expects a class rvalue to
have a TARGET_EXPR. So don't strip it.
The stripping was added in r206639 for PR59659, so I checked that removing
it didn't significantly increase compile time or memory usage for that
testcase; compile time was unaffected, memory usage increased by 0.00004%.
gcc/cp/ChangeLog:
PR c++/99643
* typeck2.c (massage_init_elt): Don't strip TARGET_EXPR.
gcc/testsuite/ChangeLog:
PR c++/99643
* g++.dg/cpp0x/initlist-new5.C: New test.
D front-end changes:
- Explicit package visibility attribute is now always applied to
introducing scopes.
- Added `__traits(totype, string)' to convert mangled type string to an
existing type.
- Printf-like and scanf-like functions are now detected by prefixing
them with `pragma(printf)' for printf-like functions or
`pragma(scanf)' for scanf-like functions.
- Added `__c_wchar_t', `__c_complex_float', `__c_complex_double', and
`__c_complex_real' types for interfacing with C and C++.
- Template alias parameters can now be instantiated with basic types,
such as `int` or `void function()`.
- Mixins can now be used as types in the form `mixin(string) var'.
- Mixin expressions can take an argument list, same as `pragma(msg)'.
- Implement DIP1034, add `typeof(*null)' types to represent `noreturn'.
- `pragma(msg)' can print expressions of type `void'.
- It is now an error to use private variables selectively imported from
other modules. Due to a bug, some imported private members were
visible from other modules, violating the specification.
- Added new syntax to declare an alias to a function type using the
`alias' syntax based on the assignment operator.
- Function literals can now return a value by reference.
Phobos changes:
- Synchronize C bindings with the latest port fixes in upstream druntime.
- Added alias for a `noreturn' type in object.d
- Make use of the new `pragma(printf)' and `pragma(scanf)' pragmas, fix
all code that got flagged as being incorrect.
- Fixed code that relied on bugs in the D import package system.
Reviewed-on: https://github.com/dlang/dmd/pull/12339https://github.com/dlang/druntime/pull/3422https://github.com/dlang/phobos/pull/7932
gcc/d/ChangeLog:
* dmd/MERGE: Merge upstream dmd 3b808e838.
* Make-lang.in (D_FRONTEND_OBJS): Add d/chkformat.o.
* d-codegen.cc (build_struct_literal): Handle special enums.
* d-convert.cc (convert_expr): Handle noreturn type.
(convert_for_condition): Likewise.
* d-target.cc (Target::_init): Set type for wchar_t.
(TargetCPP::derivedClassOffset): New method.
(Target::libraryObjectMonitors): New method.
* decl.cc (get_symbol_decl): Set TREE_THIS_VOLATILE for functions of
type noreturn.
* toir.cc (IRVisitor::visit (ReturnStatement *)): Handle returning
noreturn types.
* types.cc (TypeVisitor::visit (TypeNoreturn *)): New method.
(TypeVisitor::visit (TypeEnum *)): Handle special enums.
libphobos/ChangeLog:
* libdruntime/MERGE: Merge upstream druntime 483bc129.
* libdruntime/Makefile.am (DRUNTIME_DSOURCES_DARWIN): Add
core/sys/darwin/fcntl.d.
(DRUNTIME_DSOURCES_OPENBSD): Add core/sys/openbsd/unistd.d.
(DRUNTIME_DSOURCES_WINDOWS): Add core/sys/windows/stdc/malloc.d.
* libdruntime/Makefile.in: Regenerate.
* src/MERGE: Merge upstream phobos f89dc217a.
* src/Makefile.am (PHOBOS_DSOURCES): Add std/regex/internal/tests2.d.
* src/Makefile.in: Regenerate.
* testsuite/libphobos.exceptions/chain.d: Fix format arguments.
* testsuite/libphobos.exceptions/line_trace.d: Likewise.
The int counter in the main loop was uninitialized, so we might end up
looping a very large number of times before completing successfully.
I suspect that was unintended, so I'm adding a zero initializer.
for gcc/testsuite/ChangeLog
* g++.dg/pr94314-3.C: Zero-initialize main loop counter.
The default CPU for our ppc-vx7r2 toolchain has no support for altivec
or vsx, so an ABI without vector support is selected. The selected
calling conventions do not cover passing or returning vector types, so
-Wpsabi warns about such uses.
powerpc-ibm-aix* already silences these warnings with -Wno-psabi;
this patch extends that to powerpc-wrs-vxworks* too.
for gcc/testsuite/ChangeLog
* gcc.dg/ipa/ipa-sra-19.c: Extend -Wno-psabi to ppc-vx7r2.
Coming back to
<https://gcc.gnu.org/pipermail/gcc-patches/2019-August/527699.html>:
This is a crash that points to a GC problem. Consider this test:
__attribute__ ((unused)) struct S {
S() { }
} s;
We're parsing a simple-declaration. While parsing the decl specs, we parse
the attribute, which means creating a TREE_LIST using ggc_alloc_*.
A function body is a complete-class context so when parsing the
member-specification of this class-specifier, we parse the bodies of the
functions we'd queued in cp_parser_late_parsing_for_member. This then
leads to this call chain:
cp_parser_function_definition_after_declarator -> expand_or_defer_fn ->
expand_or_defer_fn_1 -> maybe_clone_body -> expand_or_defer_fn ->
cgraph_node::finalize_function -> ggc_collect.
In this test, the ggc_collect call collects the TREE_LIST we had
allocated, and a crash duly ensues.
I couldn't do what Richard suggested, that is, attach the attribute list
to struct S, because we don't pass decl_specs from cp_parser_type_specifier
down to cp_parser_class_specifier. Therefore I've attempted to do "push the
decl_specifiers onto a vec that is a GC root", except I couldn't really push
the decl_specifiers, because first I'd have to mark cp_decl_specifier_seq with
GTY(()) and even that wouldn't be enough for me to be able to create
static GTY(()) vec<cp_decl_specifier_seq *, va_gc>
But here we only care about cp_decl_specifier_seq::attributes, so the
patch is just this. I've also extended the test so now we test a nested
class too.
gcc/cp/ChangeLog:
PR c++/91416
* parser.c: Create a GC root for attributes in a decl specifier.
(cp_parser_type_specifier): Push/pop ->attributes onto/from it.
gcc/testsuite/ChangeLog:
PR c++/91416
* g++.dg/other/gc7.C: New test.
During changes made for LRA (or, perhaps, even before) we omitted
a check that the current register we are working on is a hard reg
before we tried to note its liveness.
A stage 1 built with fsanitize=address catches this, as does any
attempt to build master with clang and -std=c++11.
gcc/ChangeLog:
* config/darwin.c (machopic_legitimize_pic_address): Check
that the current pic register is one of the hard reg set
before setting liveness.
Fix some incorrect indenting and remove two cases where we had
code '#if 0'-d out.
gcc/ChangeLog:
* config/darwin.c (machopic_legitimize_pic_address): Fix
whitespace, remove unused code.
2021-04-03 Paul Thomas <pault@gcc.gnu.org>
gcc/fortran/ChangeLog
PR fortran/99818
* interface.c (compare_parameter): The codimension attribute is
applied to the _data field of class formal arguments.
gcc/testsuite/ChangeLog
PR fortran/99818
* gfortran.dg/coarray_48.f90: New test.