aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-11-28Generate correct fn specs for some Fortran library functions.Thomas Koenig5-10/+98
This patch works by generating the correct fn spec from the actual arguments in specific_intrinsic_symbol, and by passing this down via gfc_get_extern_function_decl to gfc_get_function_type. CSHIFT remains to be done. gcc/fortran/ChangeLog: PR fortran/97454 * trans-decl.c (gfc_get_extern_function_decl): Add argument fnspec. * trans-intrinsic.c (MAX_SPEC_ARG): Define. (intrinsic_fnspec): New function. (ADD_CHAR): Define. (specific_intrinsic_symbol): Adjust comment. Pass fn spec to gfc_get_extern_function_decl. (gfc_conv_intrinsic_funcall): Add ANY, ALL, NORM2, PRODUCT and SUM intrnisic. Add FIXME for cshift et al. * trans-types.c (gfc_get_function_type): Add fnspec argument, handle it. * trans-types.h (gfc_get_function_type): Add optinal fnspec argument. * trans.h (gfc_get_extern_function_decl): Likewise.
2020-11-28Daily bump.GCC Administrator10-1/+605
2020-11-27Revert previous change and use pragma to suppress -Wformat-diag.Martin Sebor1-10/+8
gcc/cp/ChangeLog: * error.c (add_quotes): Revert previous change and use pragma to suppress -Wformat-diag.
2020-11-27preprocessor: Fix #line overflow check [PR97602]Joseph Myers3-5/+15
The preprocessor check for overflow (of linenum_type = unsigned int) when reading the line number in a #line directive is incomplete; it checks "reg < reg_prev" which doesn't cover all cases where multiplying by 10 overflowed. Fix this by checking for overflow before rather than after it occurs (using essentially the same logic as used by e.g. glibc printf when reading width and precision values from strings). Bootstrapped with no regressions for x86_64-pc-linux-gnu. libcpp/ 2020-11-27 Joseph Myers <joseph@codesourcery.com> PR preprocessor/97602 * directives.c (strtolinenum): Check for overflow before it occurs. Correct comment. gcc/testsuite/ 2020-11-27 Joseph Myers <joseph@codesourcery.com> PR preprocessor/97602 * gcc.dg/cpp/line9.c, gcc.dg/cpp/line10.c: New tests.
2020-11-27libphobos: Fix segfault at run-time when using custom Fibers (PR 98025)Iain Buclaw10-9/+43
When libphobos is configured with --enable-cet, this adds extra fields to the Fiber class to support the ucontext_t fallback implementation. These fields get omitted when compiling user code unless they also used `-fversion=CET' to build their project, which resulted in data being overwritten from within swapcontext(). On reviewing the ucontext_t definitions, it was found that the shadow stack fields were missing, and the struct size didn't match up on X32. This has been fixed in upstream druntime and merged down here. Reviewed-on: https://github.com/dlang/druntime/pull/3293 libphobos/ChangeLog: PR d/98025 * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac (DCFG_ENABLE_CET): Substitute. * libdruntime/MERGE: Merge upstream druntime 0fe7974c. * libdruntime/Makefile.in: Regenerate. * libdruntime/core/thread.d: Import gcc.config. (class Fiber): Add ucontext_t fields when GNU_Enable_CET is true. * libdruntime/gcc/config.d.in (GNU_Enable_CET): Define. * src/Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate.
2020-11-27d: Merge upstream dmd db0df3f7e.Iain Buclaw14-986/+4
Removes all support code and tests for the extern(Pascal) calling convention. Reviewed-on: https://github.com/dlang/dmd/pull/11994 gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd db0df3f7e. * types.cc (TypeVisitor::visit (TypeFunction *)): Remove LINKpascal.
2020-11-27libphobos: Merge upstream druntime d37ef985.Iain Buclaw13-99/+214
Adds support for FreeBSD/x86 53-bit precision reals, updates bindings for FreeBSD 12.x, and removes all support code and tests for the extern(Pascal) calling convention. Reviewed-on: https://github.com/dlang/druntime/pull/3286 https://github.com/dlang/druntime/pull/3287 libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime d37ef985. * libdruntime/Makefile.am (DRUNTIME_DSOURCES_FREEBSD): Add core/sys/freebsd/config.d * libdruntime/Makefile.in: Regenerate.
2020-11-27libphobos: Merge upstream phobos 38873fe6e.Iain Buclaw6-41/+92
Adds support for FreeBSD/x86 53-bit precision reals, and removes all support code and tests for the extern(Pascal) calling convention. Reviewed-on: https://github.com/dlang/phobos/pull/7704 https://github.com/dlang/phobos/pull/7705 libphobos/ChangeLog: * src/MERGE: Merge upstream phobos 38873fe6e.
2020-11-27d: Add float and double overloads for all core.math intrinsicsIain Buclaw5-88/+151
For the math intrinsics: cos, fabs, ldexp, rint, rndtol, and sin, new overloads have been added to the core.math module for matching float and double types. These have been implemented in the compiler. A recent change to dump_function_to_file started triggering some scan-tree-dump tests to FAIL, these have been adjusted as well when updating the test. gcc/d/ChangeLog: * intrinsics.cc (maybe_expand_intrinsic): Handle new intrinsics. * intrinsics.def (INTRINSIC_COS): Add float and double overloads. (INTRINSIC_FABS): Likewise. (INTRINSIC_LDEXP): Likewise. (INTRINSIC_RINT): Likewise. (INTRINSIC_RNDTOL): Likewise. (INTRINSIC_SIN): Likewise. (INTRINSIC_TOPREC): Adjust signature. libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime 5e4492c4. gcc/testsuite/ChangeLog: * gdc.dg/intrinsics.d: Adjust patterns in scan-tree-dump.
2020-11-27testsuite/i386: Fix XOP and FMA4 checking functions [PR98036].Uros Bizjak11-71/+57
Add missing returns and remove unnecessary postfix increments. 2020-11-27 Uroš Bizjak <ubizjak@gmail.com> PR testsuite/98036 gcc/testsuite/ * gcc.target/i386/fma4-256-maccXX.c (check_maccps): Remove unnecessary postfix increment on a returned variable. (check_maccpd): Ditto. * gcc.target/i386/fma4-256-msubXX.c (check_msubps): Ditto. (check_msubpd): Ditto. * gcc.target/i386/fma4-256-nmaccXX.c (check_nmaccps): Ditto. (check_nmaccpd): Ditto. * gcc.target/i386/fma4-256-nmsubXX.c (check_nmsubps): Ditto. (check_nmsubpd): Ditto. * gcc.target/i386/fma4-maccXX.c (check_maccps): Ditto. (check_maccpd): Ditto. (check_maccss): Ditto. (check_maccsd): Ditto. * gcc.target/i386/fma4-msubXX.c (check_msubps): Ditto. (check_msubpd): Ditto. (check_msubss): Ditto. (check_msubsd): Ditto. * gcc.target/i386/fma4-nmaccXX.c (check_nmaccps): Ditto. (check_nmaccpd): Ditto. (check_nmaccss): Ditto. (check_nmaccsd): Ditto. * gcc.target/i386/fma4-nmsubXX.c (check_nmsubps): Ditto. (check_nmsubpd): Ditto. (check_nmsubss): Ditto. (check_nmsubsd): Ditto. * gcc.target/i386/xop-haddX.c (check_sbyte2word): Add missing return. (check_sbyte2dword): Remove unnecessary postfix increment on a returned value. (check_sbyte2qword): Ditto. (check_sword2dword): Add missing return. (check_sword2qword): Remove unnecessary postfix increment on a returned value. (check_dword2qword): Add missing return. * gcc.target/i386/xop-hadduX.c (check_byte2word): Add missing return. (check_byte2dword): Remove unnecessary postfix increment on a returned value. (check_byte2qword): Ditto. (check_word2dword): Add missing return. (check_word2qword): Remove unnecessary postfix increment on a returned value. (check_word2qword): Add missing return. * gcc.target/i386/xop-hsubX.c (check_sbyte2word): Add missing return. (check_sword2dword): Ditto. (check_sword2qword): Ditto.
2020-11-27libstdc++: Refactor dejagnu effective-target checksJonathan Wakely1-477/+145
This introduces two new procs to replace boilerplate in the effective-target checks. libstdc++-v3/ChangeLog: * testsuite/lib/libstdc++.exp (v3_try_preprocess): Define new proc to preprocess a chunk of code. (v3_check_preprocessor_condition): Define new proc to test a preprocessor condition depending on GCC or libstdc++ macros. (check_v3_target_debug_mode, check_v3_target_normal_mode): Use v3_try_preprocess. (check_v3_target_normal_namespace) (check_v3_target_parallel_mode, check_v3_target_cstdint) (check_v3_target_cmath, check_v3_target_atomic_builtins) (check_v3_target_gthreads, check_v3_target_gthreads_timed) (check_v3_target_sleep, check_v3_target_sched_yield) (check_v3_target_string_conversions, check_v3_target_swprintf) (check_v3_target_binary_io, check_v3_target_nprocs): Use v3_check_preprocessor_condition. (check_effective_target_cxx11): Likewise. (check_effective_target_random_device): Likewise. (check_effective_target_tbb-backend): Likewise. (check_effective_target_futex): Likewise. (check_v3_target_little_endian) Call check_effective_target_le. (check_effective_target_atomic-builtins): New proc to define new effective-target keyword. (check_effective_target_gthreads-timed): Likewise.
2020-11-27INSTALL: Default to --enable-cet=autoH.J. Lu1-5/+4
PR other/98027 * doc/install.texi: Default to --enable-cet=auto.
2020-11-27In 'gcc/omp-oacc-kernels-decompose.cc:flatten_binds', don't choke on empty ↵Thomas Schwinge3-3/+13
GIMPLE sequence Also, instead of just examining the first statement of inner 'GIMPLE_BIND' (via 'inner_sequence' being a 'typedef gimple *gimple_seq'), in fact examine all statements contained therein, which I suppose must've been the intention here. This "fixes" the testcase 'c-c++-common/goacc/kernels-decompose-ice-2.c' (which now runs into the same ICE as 'c-c++-common/goacc/kernels-decompose-ice-1.c', etc.). gcc/ * omp-oacc-kernels-decompose.cc (flatten_binds): Don't choke on empty GIMPLE sequence, and examine all statements contained in inner 'GIMPLE_BIND'. gcc/testsuite/ * c-c++-common/goacc/kernels-decompose-ice-1.c: Adjust. * c-c++-common/goacc/kernels-decompose-ice-2.c: Likewise.
2020-11-27libstdc++: Fix -Wrange-loop-construct warnings in filesystem testsJonathan Wakely52-58/+58
Many tests do `for (const path& p : test_paths)` where test_paths is an array of strings. To avoid -Wrange-loop-construct warnings the loop variable should be an object, not a reference bound to a temporary. libstdc++-v3/ChangeLog: * testsuite/27_io/filesystem/operations/absolute.cc: Avoid -Wrange-loop-construct warning. * testsuite/27_io/filesystem/path/append/source.cc: Likewise. * testsuite/27_io/filesystem/path/assign/copy.cc: Likewise. * testsuite/27_io/filesystem/path/compare/path.cc: Likewise. * testsuite/27_io/filesystem/path/construct/copy.cc: Likewise. * testsuite/27_io/filesystem/path/decompose/extension.cc: Likewise. * testsuite/27_io/filesystem/path/decompose/filename.cc: Likewise. * testsuite/27_io/filesystem/path/decompose/parent_path.cc: Likewise. * testsuite/27_io/filesystem/path/decompose/relative_path.cc: Likewise. * testsuite/27_io/filesystem/path/decompose/root_directory.cc: Likewise. * testsuite/27_io/filesystem/path/decompose/root_path.cc: Likewise. * testsuite/27_io/filesystem/path/itr/traversal.cc: Likewise. * testsuite/27_io/filesystem/path/modifiers/remove_filename.cc: Likewise. * testsuite/27_io/filesystem/path/modifiers/replace_extension.cc: Likewise. * testsuite/27_io/filesystem/path/modifiers/replace_filename.cc: Likewise. * testsuite/27_io/filesystem/path/nonmember/append.cc: Likewise. * testsuite/27_io/filesystem/path/nonmember/cmp.cc: Likewise. * testsuite/27_io/filesystem/path/nonmember/cmp_c++20.cc: Likewise. * testsuite/27_io/filesystem/path/nonmember/hash_value.cc: Likewise. * testsuite/27_io/filesystem/path/query/has_extension.cc: Likewise. * testsuite/27_io/filesystem/path/query/has_filename.cc: Likewise. * testsuite/27_io/filesystem/path/query/has_parent_path.cc: Likewise. * testsuite/27_io/filesystem/path/query/has_relative_path.cc: Likewise. * testsuite/27_io/filesystem/path/query/has_root_directory.cc: Likewise. * testsuite/27_io/filesystem/path/query/has_root_name.cc: Likewise. * testsuite/27_io/filesystem/path/query/has_root_path.cc: Likewise. * testsuite/27_io/filesystem/path/query/has_stem.cc: Likewise. * testsuite/27_io/filesystem/path/query/is_relative.cc: Likewise. * testsuite/experimental/filesystem/operations/absolute.cc: Likewise. * testsuite/experimental/filesystem/path/assign/copy.cc: Likewise. * testsuite/experimental/filesystem/path/compare/path.cc: Likewise. * testsuite/experimental/filesystem/path/construct/copy.cc: Likewise. * testsuite/experimental/filesystem/path/decompose/extension.cc: Likewise. * testsuite/experimental/filesystem/path/decompose/filename.cc: Likewise. * testsuite/experimental/filesystem/path/decompose/parent_path.cc: Likewise. * testsuite/experimental/filesystem/path/decompose/relative_path.cc: Likewise. * testsuite/experimental/filesystem/path/decompose/root_directory.cc: Likewise. * testsuite/experimental/filesystem/path/decompose/root_path.cc: Likewise. * testsuite/experimental/filesystem/path/itr/traversal.cc: Likewise. * testsuite/experimental/filesystem/path/modifiers/remove_filename.cc: Likewise. * testsuite/experimental/filesystem/path/modifiers/replace_extension.cc: Likewise. * testsuite/experimental/filesystem/path/modifiers/replace_filename.cc: Likewise. * testsuite/experimental/filesystem/path/nonmember/hash_value.cc: Likewise. * testsuite/experimental/filesystem/path/query/has_extension.cc: Likewise. * testsuite/experimental/filesystem/path/query/has_filename.cc: Likewise. * testsuite/experimental/filesystem/path/query/has_parent_path.cc: Likewise. * testsuite/experimental/filesystem/path/query/has_relative_path.cc: Likewise. * testsuite/experimental/filesystem/path/query/has_root_directory.cc: Likewise. * testsuite/experimental/filesystem/path/query/has_root_name.cc: Likewise. * testsuite/experimental/filesystem/path/query/has_root_path.cc: Likewise. * testsuite/experimental/filesystem/path/query/has_stem.cc: Likewise. * testsuite/experimental/filesystem/path/query/is_relative.cc: Likewise.
2020-11-27changelog: allow flexible "cherry picked" format.Martin Liska3-10/+14
It handles the following: (cherry picked from commit c0c7270cc4efd896fe99f8ad5409dbef089a407f (testsuite changes only)) contrib/ChangeLog: * gcc-changelog/git_commit.py: Use regex for cherry pick prefix. * gcc-changelog/test_email.py: Test it. * gcc-changelog/test_patches.txt: Likewise.
2020-11-27libstdc++: Partially revert r11-5314Jonathan Wakely2-2/+2
The changes in r11-5314 are broken, because it means we don't use __gthread_once for the first few initializations, but after the program becomes multi-threaded we will repeat the initialization, using __gthread_once once this time. This leads to memory errors. The use of __is_single_threaded() in locale::id::_M_id() is OK, because the side effects are the same either way. libstdc++-v3/ChangeLog: * src/c++98/locale.cc (locale::facet::_S_get_c_locale()): Revert change to use __is_single_threaded. * src/c++98/locale_init.cc (locale::_S_initialize()): Likewise.
2020-11-27tree-optimization/98024 - fix rnflow regressionRichard Biener1-2/+4
The change to make PRE insertion iterate less had a typo in checking successors RPO state. Fixing this exposes that regular PRE insertion when facing a value that is the same on all edges inserts an assignment in place of a PHI node but fails to set up things so that this insertion is not repeated (it correctly does not return 'new_stuff'). But with the new iteration scheme this causes us to repeatedly insert such assignment and change AVAIL_OUT over to the newly inserted expression. The fix is to treat this as PHI and insert into PHI_GEN, avoiding repetitive insertion. 2020-11-27 Richard Biener <rguenther@suse.de> PR tree-optimization/98024 * tree-ssa-pre.c (insert): Fix successor RPO order check. (do_pre_regular_insertion): When inserting an assignment in place of an all-same-value PHI still record that into PHI_GEN.
2020-11-27gfortran.dg/gomp/requires-4.f90: Fix !$omp clauseTobias Burnus1-1/+1
gcc/testsuite/ * gfortran.dg/gomp/requires-4.f90: Fix typo in '!$omp' clause.
2020-11-27gfortran.dg/gomp/requires-4.f90: Fix !$omp syntaxTobias Burnus1-2/+2
gcc/testsuite/ * gfortran.dg/gomp/requires-4.f90: Fix '!$omp' syntax.
2020-11-27tree-ssanames: Allow non-SSA_NAME arguments to get_range_infoJakub Jelinek4-76/+56
My recent match.pd change required quite a lot of code due to the separate need to handle INTEGER_CSTs and SSA_NAMEs, and after all, I didn't even handle one case there, when in x * y / y the x is INTEGER_CST and y is SSA_NAME. The following patch allows to simplify it, by allowing non-SSA_NAME argument to get_range_info, for INTEGER_CSTs it will return VR_RANGE with *min == *max equal to the constnat, and for non-INTEGER_CST/SSA_NAMEs it will just return VR_VARYING. This allows not to simplify just the match.pd, but some other spots too. 2020-11-27 Jakub Jelinek <jakub@redhat.com> * tree-ssanames.c (get_range_info): Handle INTEGER_CST by returning VR_RANGE with both *min and *max set to the wide_int value of the INTEGER_CST. Return VR_VARYING for non-SSA_NAMEs. * match.pd ((t * 2) / 2) -> t): Handle also @0 being INTEGER_CST. Simplify by calling get_range_info on everything. * tree-ssa-strlen.c (maybe_diag_stxncpy_trunc): Simplify by calling get_range_info on everything. * tree-scalar-evolution.c (iv_can_overflow_p): Likewise.
2020-11-27gimple-fold: Fix another __builtin_clear_padding ICEJakub Jelinek2-0/+26
When playing with __builtin_bit_cast, I have noticed __builtin_clear_padding ICE on the G class below. The artificial field with D type has offset 0 and size 8 bytes, but the following artificial field with E type has offset 0 and size 0, so it triggers the asserts that we don't move current position backwards. Fixed by ignoring is_empty_type (TREE_TYPE (field)) fields, all of their bits are padding which is what is added when skipping over to next field anyway. 2020-11-27 Jakub Jelinek <jakub@redhat.com> PR libstdc++/88101 * gimple-fold.c (clear_padding_type): Ignore fields with is_empty_type types. * g++.dg/torture/builtin-clear-padding-3.C: New test.
2020-11-27OpenACC: Fix integer-type issue with collapse/tile [PR97880]Tobias Burnus2-13/+25
gcc/ChangeLog: PR c/97880 * omp-expand.c (expand_oacc_collapse_init, expand_oacc_collapse_vars): Use now passed diff_type. (expand_oacc_for): Take largest type for diff_type, taking tiling and collapsing into account. gcc/testsuite/ChangeLog: PR c/97880 * gcc.dg/goacc/tile-1.c: New test.
2020-11-27aarch64: Introduce --param=aarch64-autovec-preference to select autovec ↵Kyrylo Tkachov3-6/+91
preference in backend This is a patch that introduces the aarch64-autovec-preference that can take values from 0 - 4, 0 being the default. It can be used to override the autovectorisation preferences in the backend: 0 - use default scheme 1 - only use Advanced SIMD 2 - only use SVE 3 - use Advanced SIMD and SVE, prefer Advanced SIMD in the event of a tie (as determined by costs) 4 - use Advanced SIMD and SVE, prefer SVE in the event of a tie (as determined by costs) It can valuable for experimentation when comparing SVE and Advanced SIMD autovectorisation strategies. It achieves this adjusting the order of the interleaved SVE and Advanced SIMD modes in aarch64_autovectorize_vector_modes. It also adjusts aarch64_preferred_simd_mode to use the new comparison function to pick Advanced SIMD or SVE to start with. Bootstrapped and tested on aarch64-none-linux-gnu. gcc/ * config/aarch64/aarch64.opt (-param=aarch64-autovec-preference): Define. * config/aarch64/aarch64.c (aarch64_override_options_internal): Set aarch64_sve_compare_costs to 0 when preferring only Advanced SIMD. (aarch64_cmp_autovec_modes): Define. (aarch64_preferred_simd_mode): Adjust to use the above. (aarch64_autovectorize_vector_modes): Likewise. * doc/invoke.texi: Document aarch64-autovec-preference param.
2020-11-27[Ada] Small tweaks to couple of Value routinesEric Botcazou2-9/+14
gcc/ada/ * libgnat/s-valuef.adb (Integer_To_Fixed): Take into account the extra digit when scaling up the input. * libgnat/s-valuer.adb (Scan_Decimal_Digits): Restrict previous change to fixed-point types. (Scan_Integral_Digits): Likewise.
2020-11-27[Ada] Simplify Parent_Is_Boolean with subtype membershipsPiotr Trojanek1-26/+8
gcc/ada/ * sem_res.adb (Parent_Is_Boolean): Simplify. (Resolve_Op_Not): Reduce scope of a local variable.
2020-11-27[Ada] Reuse Append_New_Elmt where possiblePiotr Trojanek2-15/+3
gcc/ada/ * cstand.adb: Simplify with Append_New_Elmt. * sem_util.adb: Likewise.
2020-11-27[Ada] Wrong compile time evaluation of Shift_RightArnaud Charlet1-6/+23
gcc/ada/ * sem_eval.adb (Fold_Shift): Fix evaluation of Shift_Right on negative values.
2020-11-27[Ada] Reference before declaration on C392015Arnaud Charlet1-1/+2
gcc/ada/ * exp_ch6.adb (Expand_Call): Properly split Transform_Function_Array and Modify_Tree_For_C.
2020-11-27[Ada] Restore access type instead of mode out parameterPiotr Trojanek3-24/+24
gcc/ada/ * sem_eval.ads (Compile_Time_Compare): Restore parameter Diff to be of an access type. * sem_eval.adb (Compile_Time_Compare): Adapt body and callers. * sem_attr.adb (Eval_Attribute): Adapt callers.
2020-11-27[Ada] Small improvement to System.Value_R.Scan_Raw_RealEric Botcazou1-6/+40
gcc/ada/ * libgnat/s-valuer.adb (Scan_Decimal_Digits): Round Extra. (Scan_Integral_Digits): Likewise.
2020-11-27[Ada] Do not apply range checks inside generics in GNATprove modeYannick Moy1-3/+3
gcc/ada/ * checks.adb (Selected_Range_Checks): Adapt the condition for applying range checks so that it is not done inside generics.
2020-11-27[Ada] Do not use 128-bit division for 64-bit fixed-point typesEric Botcazou1-22/+38
gcc/ada/ * exp_fixd.adb (Build_Double_Divide): Only use a 128-bit division if one of the operands is larger than 64 bits. (Build_Double_Divide_Code): Likewise. (Build_Scaled_Divide): Likewise. (Build_Scaled_Divide_Code): Likewise.
2020-11-27[Ada] To_GM_Time returning invalid value for Invalid_TimeArnaud Charlet1-1/+24
gcc/ada/ * libgnat/s-os_lib.adb (To_GM_Time): Return valid and consistent values for Invalid_Time.
2020-11-27[Ada] Implement AI12-0187 (Stable properties of abstract data types)Steve Baird8-39/+777
gcc/ada/ * snames.ads-tmpl: Define new Name_Stable_Properties Name_Id value. * aspects.ads, aspects.adb: Add new Aspect_Stable_Properties enumeration literal to Aspect_Id type. Add Class_Present parameter to Find_Aspect and related functions (Find_Value_Of_Aspect and Has_Aspect). * sem_util.adb (Has_Nontrivial_Precondition): Fix previously-latent bug uncovered by adding Class_Present parameter to Aspect.Find_Aspect. The code was wrong before, but with the change the bug was more likely to make a user-visible difference. * sem_ch6.adb (Analyze_Operator_Symbol): If a string literal like "abs" or "-" occurs in a Stable_Properties aspect specification, then it is to be interpreted as an operator symbol and not as a string literal. * sem_ch13.ads: Export new Parse_Aspect_Stable_Properties function, analogous to the existing Parse_Aspect_Aggregate exported procedure. * sem_ch13.adb: (Parse_Aspect_Stable_Properties): New function; analogous to existing Parse_Aspect_Aggregate. (Validate_Aspect_Stable_Properties): New procedure; analogous to existing Validate_Aspect_Aggregate. Called from the same case statement (casing on an Aspect_Id value) where Validate_Aspect_Aggregate is called. (Resolve_Aspect_Stable_Properties): New procedure; analogous to existing Resolve_Aspect_Aggregate. Called from the same two case statements (each casing on an Aspect_Id value) where Resolve_Aspect_Aggregate is called. (Analyze_Aspect_Specifications): Set Has_Delayed_Aspects and Is_Delayed_Aspect attributes for Aspect_Stable_Properties aspect specifications. (Check_Aspect_At_End_Of_Declarations): The syntactic "expression" for a Stable_Properties aspect specification is not semantically an expression; it doesn't have a type. Thus, force T to be empty in this case. * contracts.adb (Expand_Subprogram_Contract): Add call to new local procedure, Expand_Subprogram_Contract.Add_Stable_Property_Contracts, which generates Postcondition pragmas corresponding to stable property checks.
2020-11-27[Ada] Default_Initial_Condition assertion policy is now RM definedPiotr Trojanek2-54/+54
gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst: (Assertion_Policy): Move "Default_Initial_Condition" from ID_ASSERTION_KIND to RM_ASSERTION_KIND section. * gnat_rm.texi: Regenerate.
2020-11-27[Ada] Sync doc and code for pragma Assertion_PolicyPiotr Trojanek2-31/+37
gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst (Assertion_Policy): Add "Default_Initial_Condition", "Initial_Condition" and "Subprogram_Variant". * gnat_rm.texi: Regenerate.
2020-11-27[Ada] Assertion_Policy is not a valid assertion policyPiotr Trojanek1-1/+0
gcc/ada/ * sem_prag.adb (Is_Valid_Assertion_Kind): Return False on "Assertion_Policy"
2020-11-27[Ada] Do not compile predefined units with -gnatp in gnatmakeEric Botcazou1-3/+3
gcc/ada/ * make.adb (GNAT_Flag): Change to "-gnatg". (Compile): Adjust comments accordingly.
2020-11-27[Ada] Restore general case for folding comparison of static stringsPiotr Trojanek3-63/+74
gcc/ada/ * exp_ch4.adb (Rewrite_Comparison): Add assertion to confirm that evaluation folds comparisons with static operands; when folding comparison with non-static operands, the resulting literal is non-static. * sem_eval.adb (Eval_Relational_Op): Refactor nested IF statement for the special case in the THEN branch; move code for the "general case" out of the ELSE branch. * sem_res.adb (Resolve_Comparison_Op): Only apply a dubious special-case for GNATprove in the GNATprove_Mode.
2020-11-27[Ada] Change parameter from access type to mode outPiotr Trojanek3-24/+24
gcc/ada/ * sem_eval.ads (Compile_Time_Compare): Change parameter Diff from access to mode out. * sem_eval.adb (Compile_Time_Compare): Adapt body and callers. * sem_attr.adb (Eval_Attribute): Adapt callers.
2020-11-27[Ada] Move down call to Narrow_Large_Operation in Expand_N_Op_MultiplyEric Botcazou1-10/+10
gcc/ada/ * exp_ch4.adb (Expand_N_Op_Multiply): Move down block calling Narrow_Large_Operation if the type is Universal_Integer.
2020-11-27[Ada] Reimplement Ada.Numerics.Big_Numbers.Big_Reals.Float_ConversionsEric Botcazou1-9/+168
gcc/ada/ * libgnat/a-nbnbre.adb: Remove clauses for System.Img_Real and add them for System.Unsigned_Types. (Float_Conversions.To_Big_Real): Reimplement. (Float_Conversions.From_Big_Real): Likewise.
2020-11-27[Ada] Optimize generation of checks for fixed-point typesEric Botcazou5-122/+139
gcc/ada/ * checks.ads (Determine_Range_To_Discrete): New procedure. * checks.adb (Apply_Scalar_Range_Check): Call it to determine a range for the expression when the target type is discrete. And also apply the tests for discrete types to fixed-point types when they are treated as integers. (Apply_Type_Conversion_Checks): Apply checks to conversions involving fixed-point types when they are treated as integers. (Determine_Range) <N_Type_Conversion>: Factor out code into... (Determine_Range_To_Discrete): ...this new procedure and add support for fixed-point types when they are treated as integers. * einfo.ads (Type_High_Bound): Remove obsolete sentence. (Type_Low_Bound): Likewise. * exp_ch4.adb (Discrete_Range_Check): Remove obsolete code. (Real_Range_Check): Likewise. (Expand_N_Type_Conversion): In case of a no-op conversion, clear the Do_Range_Check flag on the operand before substituting it. Remove calls to Real_Range_Check and Discrete_Range_Check that are not guarded by the Do_Range_Check flag, and an assertion. * sem_res.adb (Resolve_Type_Conversion): Always apply range checks in GNATprove mode; in normal mode, use the updated type of the operand in the test against Universal_Fixed. Remove obsolete code setting the Do_Range_Check flag at the end.
2020-11-27[Ada] Simplify check for illegal non-returning proceduresPiotr Trojanek1-17/+11
gcc/ada/ * sem_prag.adb (Analyze_Pragma): Change "Ref Manual" to RM; replace uses of an unnecessary "Ok" variable with RETURN statements; replace nested IF with ELSIF.
2020-11-27[Ada] Abort defer mismatch with SJLJ exceptionsArnaud Charlet7-164/+7
gcc/ada/ * libgnarl/s-tasren.adb (Local_Complete_Rendezvous): Always call Defer_Abort. * libgnat/a-except.adb: Abort does not need to be deferred. * libgnarl/s-tpobop.adb (Exceptional_Complete_Entry_Body): Abort never needs to be undeferred here. * exp_ch11.adb (Expand_Exception_Handlers): Remove difference between ZCX and SJLJ. * exp_ch9.adb (Expand_N_Asynchronous_Select): Remove different handling for sjlj. * exp_sel.ads, exp_sel.adb (Build_Abort_Block, Build_Abort_Block_Handler): Ditto.
2020-11-27[Ada] Emit error messages for null/generic nonreturning proceduresGhjuvan Lacambre1-4/+62
gcc/ada/ * sem_prag.adb (Analyze_Pragma): declare new Check_No_Return function and call it.
2020-11-27[Ada] Fix tree for expanded instantiations corresponding to formal packagesArnaud Charlet1-1/+1
gcc/ada/ * sem_ch12.adb (Instantiate_Object): Consistently use New_Copy_Tree instead of New_Copy.
2020-11-27[Ada] Adjust head comment of various subprograms in Exp_FixdEric Botcazou1-9/+8
gcc/ada/ * exp_fixd.adb (Build_Conversion): Adjust head comment. (Build_Divide): Likewise. (Build_Double_Divide): Likewise. (Build_Multiply): Likewise. (Build_Rem): Likewise. (Build_Scaled_Divide): Likewise.
2020-11-27[Ada] To_Big_Integer and 128bits integersArnaud Charlet3-4/+30
gcc/ada/ * libgnat/s-genbig.ads, libgnat/s-genbig.adb (To_Bignum): New variant taking an Unsigned_128. * libgnat/a-nbnbin.adb (To_Big_Integer): Add support for 128 bits signed and unsigned types.
2020-11-27[Ada] Small tweaks to new implementation of Set_Image_FixedEric Botcazou1-14/+31
gcc/ada/ * libgnat/s-imagef.adb (Set_Image_Fixed): Pass the full value of the quotient to Set_Image_Integer during the first round and adjust the handling of the minus sign.