aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2021-10-12i386: Improve workaround for PR82524 LRA limitation [PR85730]Uros Bizjak2-55/+242
As explained in PR82524, LRA is not able to reload strict_low_part inout operand with matched input operand. The patch introduces a workaround, where we allow LRA to generate an instruction with non-matched input operand which is split post reload to an instruction that inserts non-matched input operand to an inout operand and the instruction that uses matched operand. The generated code improves from: movsbl %dil, %edx movl %edi, %eax sall $3, %edx movb %dl, %al to: movl %edi, %eax movb %dil, %al salb $3, %al which is still not optimal, but the code is one instruction shorter and does not use a temporary register. 2021-10-12 Uroš Bizjak <ubizjak@gmail.com> gcc/ PR target/85730 PR target/82524 * config/i386/i386.md (*add<mode>_1_slp): Rewrite as define_insn_and_split pattern. Add alternative 1 and split it post reload to insert operand 1 into the low part of operand 0. (*sub<mode>_1_slp): Ditto. (*and<mode>_1_slp): Ditto. (*<any_or:code><mode>_1_slp): Ditto. (*ashl<mode>3_1_slp): Ditto. (*<any_shiftrt:insn><mode>3_1_slp): Ditto. (*<any_rotate:insn><mode>3_1_slp): Ditto. (*neg<mode>_1_slp): New insn_and_split pattern. (*one_cmpl<mode>_1_slp): Ditto. gcc/testsuite/ PR target/85730 PR target/82524 * gcc.target/i386/pr85730.c: New test.
2021-10-12doc: Update MinGW and mingw-64 download links.David Edelsohn1-2/+2
gcc/ChangeLog: * doc/install.texi: Update MinGW and mingw-64 Binaries download links.
2021-10-12doc: Fix typos in alloc_size documentationDaniel Le Duc Khoi Nguyen1-2/+2
gcc/ * doc/extend.texi (Common Variable Attributes): Fix typos in alloc_size documentation.
2021-10-12tree-optimization/102696 - fix SLP discovery for failed BIT_FIELD_REFRichard Biener2-0/+17
This fixes a forgotten adjustment of matches[] when we fail SLP discovery. 2021-10-12 Richard Biener <rguenther@suse.de> PR tree-optimization/102696 * tree-vect-slp.c (vect_build_slp_tree_2): Properly mark the tree fatally failed when we reject a BIT_FIELD_REF. * g++.dg/vect/pr102696.cc: New testcase.
2021-10-12tree-optimization/102572 - fix gathers with invariant maskRichard Biener2-1/+15
This fixes the vector def gathering for invariant masks which failed to pass in the desired vector type resulting in a non-mask type to be generate. 2021-10-12 Richard Biener <rguenther@suse.de> PR tree-optimization/102572 * tree-vect-stmts.c (vect_build_gather_load_calls): When gathering the vectorized defs for the mask pass in the desired mask vector type so invariants will be handled correctly. * g++.dg/vect/pr102572.cc: New testcase.
2021-10-12sve: combine inverted masks into NOTsTamar Christina5-0/+235
The following example void f10(double * restrict z, double * restrict w, double * restrict x, double * restrict y, int n) { for (int i = 0; i < n; i++) { z[i] = (w[i] > 0) ? x[i] + w[i] : y[i] - w[i]; } } generates currently: ld1d z1.d, p1/z, [x1, x5, lsl 3] fcmgt p2.d, p1/z, z1.d, #0.0 fcmgt p0.d, p3/z, z1.d, #0.0 ld1d z2.d, p2/z, [x2, x5, lsl 3] bic p0.b, p3/z, p1.b, p0.b ld1d z0.d, p0/z, [x3, x5, lsl 3] where a BIC is generated between p1 and p0 where a NOT would be better here since we won't require the use of p3 and opens the pattern up to being CSEd. After this patch using a 2 -> 2 split we generate: ld1d z1.d, p0/z, [x1, x5, lsl 3] fcmgt p2.d, p0/z, z1.d, #0.0 not p1.b, p0/z, p2.b The additional scratch is needed such that we can CSE the two operations. If both statements wrote to the same register then CSE won't be able to CSE the values if there are other statements in between that use the register. A second pattern is needed to capture the nor case as combine will match the longest sequence first. So without this pattern we end up de-optimizing nor and instead emit two nots. I did not find a better way to do this. gcc/ChangeLog: * config/aarch64/aarch64-sve.md (*fcm<cmp_op><mode>_bic_combine, *fcm<cmp_op><mode>_nor_combine, *fcmuo<mode>_bic_combine, *fcmuo<mode>_nor_combine): New. gcc/testsuite/ChangeLog: * gcc.target/aarch64/sve/pred-not-gen-1.c: New test. * gcc.target/aarch64/sve/pred-not-gen-2.c: New test. * gcc.target/aarch64/sve/pred-not-gen-3.c: New test. * gcc.target/aarch64/sve/pred-not-gen-4.c: New test.
2021-10-12Fix PR target/102588Eric Botcazou1-0/+3
We need a 32-byte wide integer mode (OImode) in order to handle structure returns in the 64-bit ABI. gcc/ PR target/102588 * config/sparc/sparc-modes.def (OI): New integer mode.
2021-10-12Fortran: Various CLASS + assumed-rank fixed [PR102541]Tobias Burnus8-48/+209
Starting point was PR102541, were a previous patch caused an invalid e->ref access for class. When testing, it turned out that for CLASS to CLASS the code was never executed - additionally, issues appeared for optional and a bogus error for -fcheck=all. In particular: There were a bunch of issues related to optional CLASS, can have the 'attr.dummy' set in CLASS_DATA (sym) - but sometimes also in 'sym'!?! Additionally, gfc_variable_attr could return pointer = 1 for nonpointers when the expr is no longer "var" but "var%_data". PR fortran/102541 gcc/fortran/ChangeLog: * check.c (gfc_check_present): Handle optional CLASS. * interface.c (gfc_compare_actual_formal): Likewise. * trans-array.c (gfc_trans_g77_array): Likewise. * trans-decl.c (gfc_build_dummy_array_decl): Likewise. * trans-types.c (gfc_sym_type): Likewise. * primary.c (gfc_variable_attr): Fixes for dummy and pointer when 'class%_data' is passed. * trans-expr.c (set_dtype_for_unallocated, gfc_conv_procedure_call): For assumed-rank dummy, fix setting rank for dealloc/notassoc actual and setting ubound to -1 for assumed-size actuals. gcc/testsuite/ChangeLog: * gfortran.dg/assumed_rank_24.f90: New test.
2021-10-12openmp: Avoid calling clear_type_padding_in_mask in the common case where ↵Jakub Jelinek3-2/+5
there can't be any padding We can use the clear_padding_type_may_have_padding_p function, which is conservative for e.g. RECORD_TYPE/UNION_TYPE, but for the floating and complex floating types is accurate. clear_type_padding_in_mask is more expensive because we need to allocate memory, fill it, call the function which itself is more expensive and then analyze the memory, so for the common case of float/double atomics or even long double on most targets we can avoid that. 2021-10-12 Jakub Jelinek <jakub@redhat.com> gcc/ * gimple-fold.h (clear_padding_type_may_have_padding_p): Declare. * gimple-fold.c (clear_padding_type_may_have_padding_p): No longer static. gcc/c-family/ * c-omp.c (c_finish_omp_atomic): Use clear_padding_type_may_have_padding_p.
2021-10-12vectorizer: Fix up -fsimd-cost-model= handlingJakub Jelinek5-12/+22
> * testsuite/libgomp.c++/scan-10.C: Add option -fvect-cost-model=cheap. I don't think this is the right thing to do. This just means that at some point between 2013 when -fsimd-cost-model has been introduced and now -fsimd-cost-model= option at least partially stopped working properly. As documented, -fsimd-cost-model= overrides the -fvect-cost-model= setting for OpenMP simd loops (loop->force_vectorize is true) if specified differently from default. In tree-vectorizer.h we have: static inline bool unlimited_cost_model (loop_p loop) { if (loop != NULL && loop->force_vectorize && flag_simd_cost_model != VECT_COST_MODEL_DEFAULT) return flag_simd_cost_model == VECT_COST_MODEL_UNLIMITED; return (flag_vect_cost_model == VECT_COST_MODEL_UNLIMITED); } and use it in various places, but we also just use flag_vect_cost_model in lots of places (and in one spot use flag_simd_cost_model, not sure if we are sure it is a force_vectorize loop or what). So, IMHO we should change the above inline function to loop_cost_model and let it return the cost model and then just reimplement unlimited_cost_model as return loop_cost_model (loop) == VECT_COST_MODEL_UNLIMITED; and then adjust the direct uses of the flag and revert these changes. 2021-10-12 Jakub Jelinek <jakub@redhat.com> gcc/ * tree-vectorizer.h (loop_cost_model): New function. (unlimited_cost_model): Use it. * tree-vect-loop.c (vect_analyze_loop_costing): Use loop_cost_model call instead of flag_vect_cost_model. * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Likewise. (vect_prune_runtime_alias_test_list): Likewise. Also use it instead of flag_simd_cost_model. gcc/testsuite/ * gcc.dg/gomp/simd-2.c: Remove option -fvect-cost-model=cheap. * gcc.dg/gomp/simd-3.c: Likewise. libgomp/ * testsuite/libgomp.c/scan-11.c: Remove option -fvect-cost-model=cheap. * testsuite/libgomp.c/scan-12.c: Likewise. * testsuite/libgomp.c/scan-13.c: Likewise. * testsuite/libgomp.c/scan-14.c: Likewise. * testsuite/libgomp.c/scan-15.c: Likewise. * testsuite/libgomp.c/scan-16.c: Likewise. * testsuite/libgomp.c/scan-17.c: Likewise. * testsuite/libgomp.c/scan-18.c: Likewise. * testsuite/libgomp.c/scan-19.c: Likewise. * testsuite/libgomp.c/scan-20.c: Likewise. * testsuite/libgomp.c/scan-21.c: Likewise. * testsuite/libgomp.c/scan-22.c: Likewise. * testsuite/libgomp.c++/scan-9.C: Likewise. * testsuite/libgomp.c++/scan-10.C: Likewise. * testsuite/libgomp.c++/scan-11.C: Likewise. * testsuite/libgomp.c++/scan-12.C: Likewise. * testsuite/libgomp.c++/scan-13.C: Likewise. * testsuite/libgomp.c++/scan-14.C: Likewise. * testsuite/libgomp.c++/scan-15.C: Likewise. * testsuite/libgomp.c++/scan-16.C: Likewise.
2021-10-12Support reduc_{plus,smax,smin,umax,umin}_scal_v4qi.liuhongt4-0/+134
gcc/ChangeLog PR target/102483 * config/i386/i386-expand.c (emit_reduc_half): Handle V4QImode. * config/i386/mmx.md (reduc_<code>_scal_v4qi): New expander. (reduc_plus_scal_v4qi): Ditto. gcc/testsuite/ChangeLog * gcc.target/i386/pr102483.c: New test. * gcc.target/i386/pr102483-2.c: New test.
2021-10-11rs6000: Correct several errant dg-require-effective-targetPaul A. Clarke22-22/+22
I misspelled the dg-require-effective-target attribute "vsx_hw" in recent commits, causing the effected tests to fail. Correct the spelling. 2021-10-11 Paul A. Clarke <pc@us.ibm.com> gcc/testsuite * gcc.target/powerpc/pr78102.c: Fix dg-require-effective-target. * gcc.target/powerpc/sse4_1-packusdw.c: Likewise. * gcc.target/powerpc/sse4_1-pmaxsb.c: Likewise. * gcc.target/powerpc/sse4_1-pmaxsd.c: Likewise. * gcc.target/powerpc/sse4_1-pmaxud.c: Likewise. * gcc.target/powerpc/sse4_1-pmaxuw.c: Likewise. * gcc.target/powerpc/sse4_1-pminsb.c: Likewise. * gcc.target/powerpc/sse4_1-pminsd.c: Likewise. * gcc.target/powerpc/sse4_1-pminud.c: Likewise. * gcc.target/powerpc/sse4_1-pminuw.c: Likewise. * gcc.target/powerpc/sse4_1-pmovsxbd.c: Likewise. * gcc.target/powerpc/sse4_1-pmovsxbw.c: Likewise. * gcc.target/powerpc/sse4_1-pmovsxwd.c: Likewise. * gcc.target/powerpc/sse4_1-pmovzxbd.c: Likewise. * gcc.target/powerpc/sse4_1-pmovzxbq.c: Likewise. * gcc.target/powerpc/sse4_1-pmovzxbw.c: Likewise. * gcc.target/powerpc/sse4_1-pmovzxdq.c: Likewise. * gcc.target/powerpc/sse4_1-pmovzxwd.c: Likewise. * gcc.target/powerpc/sse4_1-pmovzxwq.c: Likewise. * gcc.target/powerpc/sse4_1-pmulld.c: Likewise. * gcc.target/powerpc/sse4_2-pcmpgtq.c: Likewise. * gcc.target/powerpc/sse4_1-phminposuw.c: Use correct dg-require-effective-target.
2021-10-11rs6000: Support more SSE4 "cmp", "mul", "pack" intrinsicsPaul A. Clarke9-0/+384
Function signatures and decorations match gcc/config/i386/smmintrin.h. Also, copy tests for: - _mm_cmpeq_epi64 - _mm_mullo_epi32, _mm_mul_epi32 - _mm_packus_epi32 - _mm_cmpgt_epi64 (SSE4.2) from gcc/testsuite/gcc.target/i386. 2021-10-11 Paul A. Clarke <pc@us.ibm.com> gcc * config/rs6000/smmintrin.h (_mm_cmpeq_epi64, _mm_cmpgt_epi64, _mm_mullo_epi32, _mm_mul_epi32, _mm_packus_epi32): New. * config/rs6000/nmmintrin.h: Copy from i386, tweak to suit. gcc/testsuite * gcc.target/powerpc/pr78102.c: Copy from gcc.target/i386, adjust dg directives to suit. * gcc.target/powerpc/sse4_1-packusdw.c: Same. * gcc.target/powerpc/sse4_1-pcmpeqq.c: Same. * gcc.target/powerpc/sse4_1-pmuldq.c: Same. * gcc.target/powerpc/sse4_1-pmulld.c: Same. * gcc.target/powerpc/sse4_2-pcmpgtq.c: Same. * gcc.target/powerpc/sse4_2-check.h: Copy from gcc.target/i386, tweak to suit.
2021-10-11rs6000: Support SSE4.1 "cvt" intrinsicsPaul A. Clarke13-0/+648
Function signatures and decorations match gcc/config/i386/smmintrin.h. Also, copy tests for: - _mm_cvtepi8_epi16, _mm_cvtepi8_epi32, _mm_cvtepi8_epi64 - _mm_cvtepi16_epi32, _mm_cvtepi16_epi64 - _mm_cvtepi32_epi64, - _mm_cvtepu8_epi16, _mm_cvtepu8_epi32, _mm_cvtepu8_epi64 - _mm_cvtepu16_epi32, _mm_cvtepu16_epi64 - _mm_cvtepu32_epi64 from gcc/testsuite/gcc.target/i386. sse4_1-pmovsxbd.c, sse4_1-pmovsxbq.c, and sse4_1-pmovsxbw.c were modified from using "char" types to "signed char" types, because the default is unsigned on powerpc. 2021-10-11 Paul A. Clarke <pc@us.ibm.com> gcc * config/rs6000/smmintrin.h (_mm_cvtepi8_epi16, _mm_cvtepi8_epi32, _mm_cvtepi8_epi64, _mm_cvtepi16_epi32, _mm_cvtepi16_epi64, _mm_cvtepi32_epi64, _mm_cvtepu8_epi16, _mm_cvtepu8_epi32, _mm_cvtepu8_epi64, _mm_cvtepu16_epi32, _mm_cvtepu16_epi64, _mm_cvtepu32_epi64): New. gcc/testsuite * gcc.target/powerpc/sse4_1-pmovsxbd.c: Copy from gcc.target/i386, adjust dg directives to suit. * gcc.target/powerpc/sse4_1-pmovsxbq.c: Same. * gcc.target/powerpc/sse4_1-pmovsxbw.c: Same. * gcc.target/powerpc/sse4_1-pmovsxdq.c: Same. * gcc.target/powerpc/sse4_1-pmovsxwd.c: Same. * gcc.target/powerpc/sse4_1-pmovsxwq.c: Same. * gcc.target/powerpc/sse4_1-pmovzxbd.c: Same. * gcc.target/powerpc/sse4_1-pmovzxbq.c: Same. * gcc.target/powerpc/sse4_1-pmovzxbw.c: Same. * gcc.target/powerpc/sse4_1-pmovzxdq.c: Same. * gcc.target/powerpc/sse4_1-pmovzxwd.c: Same. * gcc.target/powerpc/sse4_1-pmovzxwq.c: Same.
2021-10-11rs6000: Simplify some SSE4.1 "test" intrinsicsPaul A. Clarke1-26/+4
Copy some simple redirections from i386 <smmintrin.h>, for: - _mm_test_all_zeros - _mm_test_all_ones - _mm_test_mix_ones_zeros 2021-10-11 Paul A. Clarke <pc@us.ibm.com> gcc * config/rs6000/smmintrin.h (_mm_test_all_zeros, _mm_test_all_ones, _mm_test_mix_ones_zeros): Rewrite as macro.
2021-10-11rs6000: Support SSE4.1 "min" and "max" intrinsicsPaul A. Clarke9-0/+428
Function signatures and decorations match gcc/config/i386/smmintrin.h. Also, copy tests for _mm_min_epi8, _mm_min_epu16, _mm_min_epi32, _mm_min_epu32, _mm_max_epi8, _mm_max_epu16, _mm_max_epi32, _mm_max_epu32 from gcc/testsuite/gcc.target/i386. sse4_1-pmaxsb.c and sse4_1-pminsb.c were modified from using "char" types to "signed char" types, because the default is unsigned on powerpc. 2021-10-11 Paul A. Clarke <pc@us.ibm.com> gcc * config/rs6000/smmintrin.h (_mm_min_epi8, _mm_min_epu16, _mm_min_epi32, _mm_min_epu32, _mm_max_epi8, _mm_max_epu16, _mm_max_epi32, _mm_max_epu32): New. gcc/testsuite * gcc.target/powerpc/sse4_1-pmaxsb.c: Copy from gcc.target/i386. * gcc.target/powerpc/sse4_1-pmaxsd.c: Same. * gcc.target/powerpc/sse4_1-pmaxud.c: Same. * gcc.target/powerpc/sse4_1-pmaxuw.c: Same. * gcc.target/powerpc/sse4_1-pminsb.c: Same. * gcc.target/powerpc/sse4_1-pminsd.c: Same. * gcc.target/powerpc/sse4_1-pminud.c: Same. * gcc.target/powerpc/sse4_1-pminuw.c: Same.
2021-10-12Daily bump.GCC Administrator5-1/+431
2021-10-11Add obj-c++.srcman target to gcc/objcp/Makefile.Eric Gallager1-0/+1
Closes #56604 Signed-off-by: Eric Gallager <egallager@gcc.gnu.org> gcc/objcp/ChangeLog: PR objc++/56604 * Make-lang.in: Add obj-c++.srcman: line.
2021-10-11Revert accidental change in ipa-modref-tree.hJan Hubicka1-6/+1
* ipa-modref-tree.h (struct modref_access_node): Revert accidental change. (struct modref_ref_node): Likewise.
2021-10-11Commonize ipa-pta constraint generation for callsJan Hubicka6-295/+317
Commonize the three paths to produce constraints for function call and makes it more flexible, so we can implement new features more easily. Main idea is to not special case pure and const since we can now describe all of pure/const via their EAF flags (implicit_const_eaf_flags and implicit_pure_eaf_flags) and info on existence of global memory loads/stores in function which is readily available in the modref tree. While rewriting the function, I dropped some of optimizations in the way we generate constraints. Some of them we may want to add back, but I think the constraint solver should be fast to get rid of them quickly, so it looks like bit of premature optimization. We now always produce one additional PTA variable (callescape) for things that escape into function call and thus can be stored to parameters or global memory (if modified). This is no longer the same as global escape in case function is not reading global memory. It is also not same as call use, since we now understand the fact that interposable functions may use parameter in a way that is not releavnt for PTA (so we can not optimize out stores initializing the memory, but we can be safe about fact that pointers stored does not escape). Compared to previous code we now handle correctly EAF_NOT_RETURNED in all cases (previously we did so only when all parameters had the flag) and also handle NOCLOBBER in more cases (since we make difference between global escape and call escape). Because I commonized code handling args and static chains, we could now easily extend modref to also track flags for static chain and return slot which I plan to do next. Otherwise I put some effort into producing constraints that produce similar solutions as before (so it is harder to debug differences). For example if global memory is written one can simply move callescape to escape rather then making everything escape by its own constraints, but it affects ipa-pta testcases. gcc/ChangeLog: * ipa-modref-tree.h (modref_tree::global_access_p): New member function. * ipa-modref.c: (implicint_const_eaf_flags,implicit_pure_eaf_flags, ignore_stores_eaf_flags): Move to ipa-modref.h (remove_useless_eaf_flags): Remove early exit on NOCLOBBER. (modref_summary::global_memory_read_p): New member function. (modref_summary::global_memory_written_p): New member function. * ipa-modref.h (modref_summary::global_memory_read_p, modref_summary::global_memory_written_p): Declare. (implicint_const_eaf_flags,implicit_pure_eaf_flags, ignore_stores_eaf_flags): move here. * tree-ssa-structalias.c: Include ipa-modref-tree.h, ipa-modref.h and attr-fnspec.h. (handle_rhs_call): Rewrite. (handle_call_arg): New function. (determine_global_memory_access): New function. (handle_const_call): Remove (handle_pure_call): Remove (find_func_aliases_for_call): Update use of handle_rhs_call. (compute_points_to_sets): Handle global memory acccesses selectively gcc/testsuite/ChangeLog: * gcc.dg/torture/ssa-pta-fn-1.c: Fix template; add noipa. * gcc.dg/tree-ssa/pta-callused.c: Fix template.
2021-10-11c++: Add testcase for already-fixed PR [PR102643]Patrick Palka1-0/+12
Fixed with r12-1744. PR c++/102643 gcc/testsuite/ChangeLog: * g++.dg/cpp2a/class-deduction-alias11.C: New test.
2021-10-11doc: improve -fsanitize=undefined descriptionDiane Meirowitz1-1/+2
gcc/ChangeLog: * doc/invoke.texi: Add link to UndefinedBehaviorSanitizer documentation, mention UBSAN_OPTIONS, similar to what is done for AddressSanitizer.
2021-10-11middle-end/102683 - fix .DEFERRED_INIT expansionRichard Biener1-1/+3
This avoids using an integer type for which we don't have an approprate mode when expanding .DEFERRED_INIT to a non-memory entity. 2021-10-11 Richard Biener <rguenther@suse.de> PR middle-end/102683 * internal-fn.c (expand_DEFERRED_INIT): Check for mode availability before building an integer type for storage purposes.
2021-10-11middle-end/101480 - overloaded global new/deleteRichard Biener2-2/+54
The following fixes the issue of ignoring side-effects on memory from overloaded global new/delete operators by not marking them as effectively 'const' apart from other explicitely specified side-effects. This will cause FAIL: g++.dg/warn/Warray-bounds-16.C -std=gnu++1? (test for excess errors) because we now no longer statically see the initialization loop never executes because the call to operator new can now clobber 'a.m'. This seems to be an issue with the warning code and/or ranger so I'm leaving this FAIL to be addressed as followup. 2021-10-11 Richard Biener <rguenther@suse.de> PR middle-end/101480 * gimple.c (gimple_call_fnspec): Do not mark operator new/delete as const. * g++.dg/torture/pr10148.C: New testcase.
2021-10-11[Ada] Fix problematic import of type-generic GCC atomic builtinEric Botcazou3-10/+142
gcc/ada/ * gcc-interface/gigi.h (resolve_atomic_size): Declare. (list_third): New inline function. * gcc-interface/decl.c (type_for_atomic_builtin_p): New function. (resolve_atomic_builtin): Likewise. (gnat_to_gnu_subprog_type): Perform type resolution for most of type-generic GCC atomic builtins and give an error for the rest. * gcc-interface/utils2.c (resolve_atomic_size): Make public.
2021-10-11[Ada] Tweak the warning about missing local raisesEric Botcazou1-3/+6
gcc/ada/ * gcc-interface/trans.c (gnat_to_gnu) <N_Pop_Constraint_Error_Label>: Given the warning only if No_Exception_Propagation is active. <N_Pop_Storage_Error_Label>: Likewise. <N_Pop_Program_Error_Label>: Likewise.
2021-10-11[Ada] Fix for atomic wrongly rejected on object of discriminated typeEric Botcazou1-12/+16
gcc/ada/ * gcc-interface/decl.c (promote_object_alignment): Add GNU_SIZE parameter and use it for the size of the object if not null. (gnat_to_gnu_entity) <E_Variable>: Perform the automatic alignment promotion for objects whose nominal subtype is of variable size. (gnat_to_gnu_field): Adjust call to promote_object_alignment.
2021-10-11[Ada] Fix incorrect size for pathological pass-by-copy parametersEric Botcazou1-8/+10
gcc/ada/ * gcc-interface/decl.c (gnat_to_gnu_param): Strip padding types only if the size does not change in the process. Rename local variable and add bypass for initialization procedures.
2021-10-11[Ada] Runtime transition: System.ThreadsDoug Rupp2-78/+14
gcc/ada/ * libgnat/s-thread.ads: Fix comments. Remove unused package imports. (Thread_Body_Exception_Exit): Remove Exception_Occurrence parameter. (ATSD): Declare type locally. * libgnat/s-thread__ae653.adb: Fix comments. Remove unused package imports. Remove package references to Stack_Limit checking. (Install_Handler): Remove. (Set_Sec_Stack): Likewise. (Thread_Body_Enter): Remove calls to Install_Handler and Stack_Limit checking. (Thread_Body_Exception_Exit): Remove Exception_Occurrence parameter. (Init_RTS): Call local Get_Sec_Stack. Remove call to Install_Handler. Remove references to accessors for Get_Sec_Stack and Set_Sec_Stack. Remove OS check. (Set_Sec_Stack): Remove.
2021-10-11[Ada] Remove redundant guard in expansion of dispatching callsPiotr Trojanek1-6/+2
gcc/ada/ * exp_ch3.adb (Make_Predefined_Primitive_Specs, Predefined_Primitive_Bodies): Remove guard with restriction No_Dispatching_Calls.
2021-10-11[Ada] Valid postconditions incorrectly rejected.Steve Baird2-2/+30
gcc/ada/ * sem_attr.adb (Analyze_Attribute_Old_Result): Permit an attribute reference inside a compiler-generated _Postconditions procedure. In this case, Subp_Decl is assigned the declaration of the enclosing subprogram. * exp_util.adb (Insert_Actions): When climbing up the tree looking for an insertion point, do not climb past an N_Iterated_Component/Element_Association, since this could result in inserting a reference to a loop parameter at a location outside of the scope of that loop parameter. On the other hand, be careful to preserve existing behavior in the case of an N_Component_Association node.
2021-10-11[Ada] Incorrect Dynamic_Predicate results for static argumentsSteve Baird2-1/+44
gcc/ada/ * exp_ch6.adb (Can_Fold_Predicate_Call): Do not attempt folding if there is more than one predicate involved. Recall that predicate aspect specification are additive, not overriding, and that there are three different predicate aspects (Dynamic_Predicate, Static_Predicate, and the GNAT-defined Predicate aspect). These various ways of introducing multiple predicates are all checked for. A new nested function, Augments_Other_Dynamic_Predicate, is introduced. * sem_ch4.adb (Analyze_Indexed_Component_Form.Process_Function_Call): When determining whether a name like "X (Some_Discrete_Type)" might be interpreted as a slice, the answer should be "no" if the type/subtype name denotes the current instance of type/subtype.
2021-10-11[Ada] sigset_t is an unsigned long on RTEMSPatrick Bernardi1-1/+1
gcc/ada/ * libgnarl/s-osinte__rtems.ads: Change sigset_t to an unsigned long.
2021-10-11[Ada] RTEMS: use regular RTEMS API for minimum stack size calculationPatrick Bernardi1-7/+12
gcc/ada/ * libgnat/s-parame__rtems.adb: use _POSIX_Threads_Minimum_stack_size instead of ada_pthread_minimum_stack_size.
2021-10-11[Ada] Export No_Exception_Propagation_Active for use by gigiEric Botcazou2-0/+5
gcc/ada/ * fe.h (No_Exception_Propagation_Active): Declare. * restrict.ads (No_Exception_Propagation_Active): Add WARNING line.
2021-10-11[Ada] Warn about conversion with any predefined time typesPiotr Trojanek1-26/+36
gcc/ada/ * sem_ch13.adb (Validate_Unchecked_Conversion): Simplify code for detecting conversions with Ada.Calendar.Time type and extend it to similar types in the Ada.Real_Time package.
2021-10-11[Ada] Simplify membership tests with N_Generic_DeclarationPiotr Trojanek3-19/+7
gcc/ada/ * sem_ch10.adb, sem_prag.adb, sem_util.adb: Use N_Generic_Declaration in membership tests.
2021-10-11[Ada] Remove constant argumentsEtienne Servais12-248/+160
gcc/ada/ * ali.adb (Get_Name): Ignore_Spaces is always False. * bindo-graphs.adb (Set_Is_Existing_Source_Target_Relation): Val is always True. * cstand.adb (New_Standard_Entity): New_Node_Kind is always N_Defininig_Identifier. * exp_ch3.adb (Predef_Stream_Attr_Spec): For_Body is always False. * exp_dist.adb (Add_Parameter_To_NVList): RACW_Ctrl is always False. * gnatls.adb (Add_Directories): Prepend is always False. * sem_ch10.adb, sem_ch10.ads (Load_Needed_Body): Do_Analyze is always True. * sem_ch3.adb, sem_ch3.ads (Process_Range_Expr_In_Decl): R_Check_Off is always False. * sem_elab.adb: (Info_Variable_Reference): Info_Msg is always False, In_SPARK is always True. (Set_Is_Traversed_Body, Set_Is_Saved_Construct, Set_Is_Saved_Relation): Val is always True. * treepr.adb (Visit_Descendant): No_Indent is always False. (Print_Node): Fmt does not need such a big scope.
2021-10-11[Ada] Find an interpretation for membership test with a singleton valueEtienne Servais1-9/+33
gcc/ada/ * sem_ch4.adb (Analyze_Membership_Op): Finds interpretation for the case of a membership test with a singleton value in case of overloading.
2021-10-11[Ada] RTEMS: use hardware interrupts instead of signals for interrupt handlingPatrick Bernardi9-152/+1732
gcc/ada/ * Makefile.rtl (VxWorks): Rename s-inmaop__vxworks.adb to s-inmaop__hwint.adb. (RTEMS): Use s-inmaop__hwint.adb, s-intman__rtems.adb/s, s-taprop__rtems.adb. * libgnarl/a-intnam__rtems.ads: Remove signals definitions and replace with Hardware_Interrupts. * libgnarl/s-inmaop__vxworks.adb: Rename as... * libgnarl/s-inmaop__hwint.adb: ... this. * libgnarl/s-interr__hwint.adb: Remove unnecessary comments. * libgnarl/s-intman__rtems.ads, libgnarl/s-intman__rtems.adb: New files. * libgnarl/s-osinte__rtems.adb: Add RTEMS API bindings. (Binary_Semaphore_Create, Binary_Semaphore_Delete, Binary_Semaphore_Obtain, Binary_Semaphore_Release, Binary_Semaphore_Flush, Interrupt_Connect, Interrupt_Number_To_Vector): New functions. * libgnarl/s-osinte__rtems.ads (Num_HW_Interrupts, Signal): Removed. (NSIG, Interrupt_Range): New. (Binary_Semaphore_Create, Binary_Semaphore_Delete, Binary_Semaphore_Obtain, Binary_Semaphore_Release, Binary_Semaphore_Flush, Interrupt_Connect, Interrupt_Number_To_Vector): Remove Import pragma. * libgnarl/s-taprop__rtems.adb: New file.
2021-10-11[Ada] Fix internal error on fixed-point divide, multiply and scalingEric Botcazou1-79/+92
gcc/ada/ * exp_fixd.adb (Get_Size_For_Value): New function returning a size suitable for a non-negative integer value. (Get_Type_For_Size): New function returning a standard type suitable for a size. (Build_Divide): Call both functions to compute the result type, but make sure to pass a non-negative value to the first. (Build_Multiply): Likewise. (Do_Multiply_Fixed_Universal): Minor consistency tweak. (Integer_Literal): Call both functions to compute the type.
2021-10-11[Ada] Reorder subprogram spec and bodies in alphabetical orderEtienne Servais1-35/+35
gcc/ada/ * sem_ch4.adb (Analyze_Membership_Op): Reorder subprogram spec and bodies in alphabetical order.
2021-10-11[Ada] Rewrite extended names in derived class-wide expressionsPiotr Trojanek1-1/+1
gcc/ada/ * exp_util.adb (Build_Class_Wide_Expression): Replace entities of both simple and extended names.
2021-10-11[Ada] Import binder globals as constantGhjuvan Lacambre29-53/+44
gcc/ada/ * libgnarl/s-intman__android.adb, libgnarl/s-intman__lynxos.adb, libgnarl/s-intman__posix.adb, libgnarl/s-intman__qnx.adb, libgnarl/s-intman__solaris.adb, libgnarl/s-intman__susv3.adb, libgnarl/s-taprob.adb, libgnarl/s-taprop__hpux-dce.adb, libgnarl/s-taprop__linux.adb, libgnarl/s-taprop__mingw.adb, libgnarl/s-taprop__posix.adb, libgnarl/s-taprop__qnx.adb, libgnarl/s-taprop__solaris.adb, libgnarl/s-taprop__vxworks.adb, libgnarl/s-taskin.adb, libgnarl/s-tasque.adb, libgnarl/s-tpoben.adb, libgnat/a-calend.adb, libgnat/a-excach.adb, libgnat/a-except.adb, libgnat/a-tags.adb, libgnat/a-textio.adb, libgnat/a-witeio.adb, libgnat/a-ztexio.adb, libgnat/g-binenv.adb, libgnat/s-parame.adb, libgnat/s-parame__vxworks.adb, libgnat/s-stratt.adb, libgnat/s-trasym__dwarf.adb: Mark imported binder globals as constant.
2021-10-11[Ada] Move rewriting of boxes in aggregates from resolution to expansionPiotr Trojanek3-69/+29
gcc/ada/ * exp_aggr.adb (Initialize_Record_Component): Add assertion about one of the parameters, so that illegal attempts to initialize record components with Empty node are detected early on. (Build_Record_Aggr_Code): Handle boxes in aggregate component associations just the components with no initialization in Build_Record_Init_Proc. * sem_aggr.adb (Resolve_Record_Aggregate): For components that require simple initialization carry boxes from resolution to expansion. * sem_util.adb (Needs_Simple_Initialization): Remove redundant paren.
2021-10-11[Ada] Simplify initialization of concurrent componentsPiotr Trojanek1-5/+2
gcc/ada/ * exp_ch3.adb (Build_Init_Statements): Simplify detection of concurrent record types.
2021-10-11[Ada] Simplify detection of delayed aggregatesPiotr Trojanek1-5/+2
gcc/ada/ * exp_aggr.adb (Is_Delayed_Aggregate): Simplify.
2021-10-11[Ada] Simplify detection of record components with default initializationPiotr Trojanek1-24/+19
gcc/ada/ * exp_aggr.adb (Has_Default_Init_Comps): Simplify.
2021-10-11[Ada] Remove redundant guard against an empty component listPiotr Trojanek1-4/+0
gcc/ada/ * exp_aggr.adb (Component_OK_For_Backend): Remove redundant guard.
2021-10-11[Ada] RTEMS: use default stack checking emulation packagePatrick Bernardi2-114/+2
gcc/ada/ * Makefile.rtl (RTEMS): Add s-stchop.o to EXTRA_GNATRTL_NONTASKING_OBJS, remove s-stchop__rtems.adb. * libgnat/s-stchop__rtems.adb: Removed.