aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-07-17[Ada] Fix unnesting issues involving tasksEd Schonberg2-4/+30
2018-07-17 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_util.adb (Enclosing_Subprogram): Handle properly entries, and synchronized types that are completions of limited types or private extensions. (Scope_Within): Handle properly accept statements in task bodies. From-SVN: r262769
2018-07-17[Ada] Spurious error on unused Part_Of constituentHristian Kirtchev4-15/+55
This patch updates the analysis of indicator Part_Of (or the lack thereof), to ignore generic formal parameters for purposes of determining the visible state space because they are not visible outside the generic and related instances. ------------ -- Source -- ------------ -- gen_pack.ads generic In_Formal : in Integer := 0; In_Out_Formal : in out Integer; package Gen_Pack is Exported_In_Formal : Integer renames In_Formal; Exported_In_Out_Formal : Integer renames In_Out_Formal; end Gen_Pack; -- pack.ads with Gen_Pack; package Pack with Abstract_State => State is procedure Force_Body; Val : Integer; private package OK_1 is new Gen_Pack (In_Out_Formal => Val) with Part_Of => State; -- OK package OK_2 is new Gen_Pack (In_Formal => 1, In_Out_Formal => Val) with Part_Of => State; -- OK package Error_1 is -- Error new Gen_Pack (In_Out_Formal => Val); package Error_2 is -- Error new Gen_Pack (In_Formal => 2, In_Out_Formal => Val); end Pack; -- pack.adb package body Pack with Refined_State => -- Error (State => (OK_1.Exported_In_Formal, OK_1.Exported_In_Out_Formal)) is procedure Force_Body is null; end Pack; -- gen_pack.ads generic In_Formal : in Integer := 0; In_Out_Formal : in out Integer; package Gen_Pack is Exported_In_Formal : Integer renames In_Formal; Exported_In_Out_Formal : Integer renames In_Out_Formal; end Gen_Pack; -- pack.ads with Gen_Pack; package Pack with Abstract_State => State is procedure Force_Body; Val : Integer; private package OK_1 is new Gen_Pack (In_Out_Formal => Val) with Part_Of => State; -- OK package OK_2 is new Gen_Pack (In_Formal => 1, In_Out_Formal => Val) with Part_Of => State; -- OK package Error_1 is -- Error new Gen_Pack (In_Out_Formal => Val); package Error_2 is -- Error new Gen_Pack (In_Formal => 2, In_Out_Formal => Val); end Pack; -- pack.adb package body Pack with Refined_State => -- Error (State => (OK_1.Exported_In_Formal, OK_1.Exported_In_Out_Formal)) is procedure Force_Body is null; end Pack; ---------------------------- -- Compilation and output -- ---------------------------- $ gcc -c pack.adb pack.adb:3:11: state "State" has unused Part_Of constituents pack.adb:3:11: constant "Exported_In_Formal" defined at gen_pack.ads:6, instance at pack.ads:15 pack.adb:3:11: variable "Exported_In_Out_Formal" defined at gen_pack.ads:7, instance at pack.ads:15 pack.ads:19:12: indicator Part_Of is required in this context (SPARK RM 7.2.6(2)) pack.ads:19:12: "Error_1" is declared in the private part of package "Pack" pack.ads:21:12: indicator Part_Of is required in this context (SPARK RM 7.2.6(2)) pack.ads:21:12: "Error_2" is declared in the private part of package "Pack" 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com> gcc/ada/ * sem_prag.adb (Has_Visible_State): Do not consider generic formals because they are not part of the visible state space. Add constants to the list of acceptable visible states. (Propagate_Part_Of): Do not consider generic formals when propagating the Part_Of indicator. * sem_util.adb (Entity_Of): Do not follow renaming chains which go through a generic formal because they are not visible for SPARK purposes. * sem_util.ads (Entity_Of): Update the comment on usage. From-SVN: r262768
2018-07-17[Ada] Fix handling of inherited discriminant constraintsEd Schonberg5-21/+158
2018-07-17 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_util.adb (Gather_Components): A discriminant of an ancestor may have been constrained by a later ancestor, so when looking for the value of that hidden discriminant we must examine the stored constraint of other ancestors than the immediate parent type. gcc/testsuite/ * gnat.dg/discr54.adb, gnat.dg/discr54_pkg.ads: New testcase. From-SVN: r262767
2018-07-17[Ada] Crash on case expression in build-in-place functionHristian Kirtchev7-23/+96
This patch modifies the recursive tree replication routine New_Copy_Tree to create new entities and remap old entities to the new ones for constructs in N_Expression_With_Actions nodes when requested by a caller. This in turn allows the build-in-place mechanism to avoid sharing entities between the 4 variants of returns it generates. 2018-07-17 Hristian Kirtchev <kirtchev@adacore.com> gcc/ada/ * exp_ch6.adb (Build_Heap_Or_Pool_Allocator): Ensure that scoping constructs and entities within receive new entities when replicating a tree. (Expand_N_Extended_Return_Statement): Ensure that scoping constructs and entities within receive new entities when replicating a tree. * sem_util.adb (New_Copy_Tree): Add new formal Scopes_In_EWA_OK. (Visit_Entity): Visit entities within scoping constructs inside expression with actions nodes when requested by the caller. Add blocks, labels, and procedures to the list of entities which need replication. * sem_util.ads (New_Copy_Tree): Add new formal Scopes_In_EWA_OK. Update the comment on usage. gcc/testsuite/ * gnat.dg/bip_case_expr.adb, gnat.dg/bip_case_expr_pkg.ads: New testcase. From-SVN: r262766
2018-07-17[Ada] Remove references to gcov from the User ManualArnaud Charlet4-400/+202
2018-07-17 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * doc/gnat_ugn/about_this_guide.rst, doc/gnat_ugn/gnat_and_program_execution.rst: Remove references to gcov. * gnat_ugn.texi: Regenerate. From-SVN: r262765
2018-07-17Daily bump.GCC Administrator1-1/+1
From-SVN: r262764
2018-07-16Forgot the PR number on the commit log.Carl Love1-0/+16
gcc/testsuite/ChangeLog: 2018-07-16 Carl Love <cel@us.ibm.com> Forgot the PR number on the commit log. PR target/86414 2018-07-16 Carl Love <cel@us.ibm.com> PR target/86414 * gcc.target/powerpc/divkc3-2.c: Add dg-require-effective-target longdouble128. * gcc.target/powerpc/divkc3-3.c: Ditto. * gcc.target/powerpc/mulkc3-2.c: Ditto. * gcc.target/powerpc/mulkc3-3.c: Ditto. * gcc.target/powerpc/fold-vec-mergehl-double.c: Update counts. * gcc.target/powerpc/pr85456.c: Make check Linux and AIX specific. From-SVN: r262758
2018-07-17rs6000: New testcase fp-convert.cSegher Boessenkool3-0/+165
This tests the generated code for all conversions between floating point point types, binary and decimal. gcc/testsuite/ * gcc.target/powerpc/convert-fp-128.c: New testcase. * gcc.target/powerpc/convert-fp-64.c: New testcase. From-SVN: r262757
2018-07-17rs6000: New testsuite selectorsSegher Boessenkool2-0/+46
This introduces four new selectors for use with Power testcases: longdouble64, ppc_float128, ppc_float128_insns, powerpc_vsx. gcc/testsuite/ * lib/target-supports.exp (check_effective_target_longdouble64, check_effective_target_ppc_float128, check_effective_target_ppc_float128_insns, check_effective_target_powerpc_vsx): New. From-SVN: r262756
2018-07-17rs6000: Fix testsuite bug in check_ppc_float128_hw_availableSegher Boessenkool2-1/+6
The test program for ppc_float128_hw_available would always return false, since there is a syntax error in that test program. gcc/testsuite/ * lib/target-supports.exp (check_ppc_float128_hw_available): Fix syntax error. From-SVN: r262755
2018-07-17rs6000: Improve truncifsf2Segher Boessenkool2-18/+11
The current implementation leaves an unnecessary register move. It is easier to just expand things in the expander already. This patch does that. * config/rs6000/rs6000.md (trunc<mode>sf2): Expand truncates of double-double modes to SFmode directly directly. (trunc<mode>sf2_fprs): Delete. From-SVN: r262754
2018-07-17rs6000: Use correct names for some trunc/extend libcallsSegher Boessenkool2-12/+19
The libcalls for trunc and extend of a decimal float to a binary float, and vice versa, do not have "2" in the name, although all other such conversions do. * config/rs6000/rs6000.c (init_float128_ibm): Use the correct names for conversions between IFmode and the decimal floating point modes. (init_float128_ieee): Use the correct names for conversions between KFmode and the decimal floating point modes. From-SVN: r262753
2018-07-17rs6000: Use more correct names for some trunc/extend libcallsSegher Boessenkool2-4/+11
They had source and destination swapped in the name. * config/rs6000/rs6000.c (init_float128_ibm): Use more correct names for the conversions between TDmode and IFmode. (init_float128_ieee): Use more correct names for the conversions between TDmode and KFmode. From-SVN: r262752
2018-07-16re PR tree-optimization/86526 (ICE in builtin_memcpy_read_str, at ↵Jakub Jelinek4-36/+54
builtins.c:3017) PR tree-optimization/86526 * builtins.c (expand_builtin_memcmp): Formatting fixes. (inline_expand_builtin_string_cmp): Likewise. (inline_string_cmp): Likewise. Use c_readstr instead of builtin_memcpy_read_str. Add unit_mode temporary. * gcc.c-torture/compile/pr86526.c: New test. From-SVN: r262750
2018-07-16divkc3-2.c: Add dg-require-effective-target longdouble128.Carl Love7-4/+17
gcc/testsuite/ChangeLog: 2018-07-16 Carl Love <cel@us.ibm.com> * gcc.target/powerpc/divkc3-2.c: Add dg-require-effective-target longdouble128. * gcc.target/powerpc/divkc3-3.c: Ditto. * gcc.target/powerpc/mulkc3-2.c: Ditto. * gcc.target/powerpc/mulkc3-3.c: Ditto. * gcc.target/powerpc/fold-vec-mergehl-double.c: Update counts. * gcc.target/powerpc/pr85456.c: Make check Linux and AIX specific. From-SVN: r262749
2018-07-16Fix handling of invalid assumed-shape/size arrays in legacy initializer lists.Fritz Reese7-33/+80
2018-07-16 Fritz Reese <fritzoreese@gmail.com> Fix handling of invalid assumed-shape/size arrays in legacy initializer lists. gcc/fortran/ChangeLog: PR fortran/83184 * decl.c (match_old_style_init): Initialize locus of variable expr when creating a data variable. (match_clist_expr): Verify array is explicit shape/size before attempting to allocate constant array constructor. gcc/testsuite/ChangeLog: PR fortran/83184 * gfortran.dg/assumed_rank_14.f90: New testcase. * gfortran.dg/assumed_rank_15.f90: New testcase. * gfortran.dg/dec_structure_8.f90: Update error messages. * gfortran.dg/dec_structure_23.f90: Update error messages. From-SVN: r262744
2018-07-16re PR fortran/86417 (FAIL: libgomp.fortran/alloc-comp-3.f90 -O0 (test for ↵Fritz Reese2-0/+7
excess errors)) 2018-07-16 Fritz Reese <fritzoreese@gmail.com> gcc/fortran/ChangeLog: PR fortran/86417 * module.c (mio_component): Set component->loc when loading from module. From-SVN: r262743
2018-07-16re PR middle-end/86528 (strlen of constant string malfunction -- had to back ↵Bernd Edlinger6-3/+40
out fix for PR middle-end/77357) gcc: 2018-07-16 Bernd Edlinger <bernd.edlinger@hotmail.de> PR middle-end/86528 * builtins.c (check_access): Bail out if range[0] is no INTEGER_CST. * expr.c (string_constant): Fix the element size of ARRAY_TYPE. testsuite: 2018-07-16 Bernd Edlinger <bernd.edlinger@hotmail.de> PR middle-end/86528 * gcc.c-torture/execute/pr86528.c: New test. * gcc.dg/Wrestrict-10.c (test_arr_strcat_2): Fix typo. From-SVN: r262742
2018-07-16* scripts/create_testsuite_files: Fix typo in comment.Jonathan Wakely2-1/+3
From-SVN: r262741
2018-07-16class.c (resolve_address_of_overloaded_function): Don't emit an inform if ↵Paolo Carlini6-7/+46
the matching permerror returns false. /cp 2018-07-16 Paolo Carlini <paolo.carlini@oracle.com> * class.c (resolve_address_of_overloaded_function): Don't emit an inform if the matching permerror returns false. * pt.c (check_specialization_namespace): Likewise. /testsuite 2018-07-16 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/template/spec40.C: New. * g++.dg/parse/ptrmem8.C: Likewise. From-SVN: r262740
2018-07-16PR libstdc++/86537 remove less<shared_ptr<T>> partial specializationJonathan Wakely4-20/+78
The standard doesn't specify this partial specialization (it was required after the changes in N2637 but then should have been removed following LWG 1262). Its presence is observable because it causes different results when operator< has been overloaded for a shared_ptr specialization. PR libstdc++/86537 * include/bits/shared_ptr.h (less<shared_ptr<_Tp>>): Remove non-standard partial specialization. * include/bits/shared_ptr_base.h (_Sp_less): Remove class definition. (less<__shared_ptr<_Tp, _Lp>): Remove partial specialization. * testsuite/20_util/shared_ptr/comparison/86537.cc: New test. From-SVN: r262739
2018-07-16extend.texi (PowerPC AltiVec Built-in Functions): Alphabetize prototypes of ↵Kelvin Nilsen2-756/+792
built-in functions... gcc/ChangeLog: 2018-07-16 Kelvin Nilsen <kelvin@gcc.gnu.org> * doc/extend.texi (PowerPC AltiVec Built-in Functions): Alphabetize prototypes of built-in functions, separating out built-in functions that are listed in this section but should be described elsewhere. From-SVN: r262737
2018-07-16re PR middle-end/86511 (Traps are generated for non-trapping compares)Uros Bizjak2-4/+17
PR target/86511 * expmed.c (emit_store_flag): Do not emit setcc followed by a conditional move when trapping comparison was split to a non-trapping one (and vice versa). From-SVN: r262736
2018-07-16Fix ChangeLog.Andreas Krebbel1-1/+1
From-SVN: r262735
2018-07-16S/390: Implement -mnop-mcountIlya Leoshkevich9-31/+145
On i386 the profiler call sequence always consists of 1 call instruction, so -mnop-mcount generates a single nop with the same length as a call. For S/390 longer sequences may be used in some cases, so -mnop-mcount generates the corresponding amount of nops. 2018-07-16 Ilya Leoshkevich <iii@linux.ibm.com> * config/s390/s390.c (s390_function_profiler): Generate nops instead of profiler call sequences. * config/s390/s390.opt: Add the new option. 2018-07-16 Ilya Leoshkevich <iii@linux.ibm.com> * gcc.target/s390/mnop-mcount-m31-fpic.c: New testcase. * gcc.target/s390/mnop-mcount-m31-mzarch.c: New testcase. * gcc.target/s390/mnop-mcount-m31.c: New testcase. * gcc.target/s390/mnop-mcount-m64-mfentry.c: New testcase. * gcc.target/s390/mnop-mcount-m64.c: New testcase. From-SVN: r262734
2018-07-16S/390: Implement -mrecord-mcountIlya Leoshkevich5-0/+34
This is the counterpart of the i386 feature introduced by 39a5a6a4: Add direct support for Linux kernel __fentry__ patching. 2018-07-16 Ilya Leoshkevich <iii@linux.ibm.com> * config/s390/s390.c (s390_function_profiler): Generate __mcount_loc section. * config/s390/s390.opt: Add the new option. 2018-07-16 Ilya Leoshkevich <iii@linux.ibm.com> * testsuite/gcc.target/s390/mrecord-mcount.c: New testcase. From-SVN: r262733
2018-07-16S/390: Add direct support for Linux kernel __fentry__ patching.Ilya Leoshkevich6-2/+47
On i386, the difference between mcount and fentry is that fentry comes before the prolog. On s390 mcount already comes before the prolog, but takes 4 instructions. This patch introduces the more efficient implementation (just 1 instruction) and puts it under -mfentry flag. The produced code is compatible only with newer glibc versions, which provide the __fentry__ symbol and do not clobber %r0 when resolving lazily bound functions. Because 31-bit PLT stubs assume %r12 contains GOT address, which is not the case when the code runs before the prolog, -mfentry is allowed only for 64-bit code. Also, code compiled with -mfentry cannot be used for the nested C functions, since they both use %r0. In this case instrumentation is not insterted, and a new warning is issued for each affected nested function. 2018-07-16 Ilya Leoshkevich <iii@linux.ibm.com> * common.opt: Add the new warning. * config/s390/s390.c (s390_function_profiler): Emit "brasl %r0,__fentry__" when -mfentry is specified. (s390_option_override_internal): Disallow -mfentry for 31-bit CPUs. * config/s390/s390.opt: Add the new option. 2018-07-16 Ilya Leoshkevich <iii@linux.ibm.com> * gcc.target/s390/mfentry-m64.c: New testcase. From-SVN: r262732
2018-07-16[Ada] Missing error on hidden state in instantiationHristian Kirtchev4-15/+92
This patch modifies the analysis of package contracts to split processing which is specific to package instantiations on its own. As a result, the lack of indicator Part_Of can now be properly assessed. ------------ -- Source -- ------------ -- gen_pack.ads generic package Gen_Pack is Pack_Var : Integer := 1; end Gen_Pack; -- gen_wrap.ads with Gen_Pack; generic package Gen_Wrap is Wrap_Var : Integer := 1; package Inst is new Gen_Pack; end Gen_Wrap; -- pack.ads with Gen_Pack; with Gen_Wrap; package Pack with SPARK_Mode => On, Abstract_State => State is procedure Force_Body; private package OK_Inst_1 is new Gen_Pack -- OK with Part_Of => State; -- OK package OK_Inst_2 is new Gen_Pack; -- OK pragma Part_Of (State); -- OK package OK_Inst_3 is new Gen_Wrap -- OK with Part_Of => State; -- OK package OK_Inst_4 is new Gen_Wrap; -- OK pragma Part_Of (State); package Error_Inst_1 is new Gen_Pack; -- Error package Error_Inst_2 is new Gen_Wrap; -- Error end Pack; -- pack.adb package body Pack with SPARK_Mode => On, Refined_State => (State => (OK_Inst_1.Pack_Var, OK_Inst_2.Pack_Var, OK_Inst_3.Wrap_Var, OK_Inst_3.Inst.Pack_Var, OK_Inst_4.Wrap_Var, OK_Inst_4.Inst.Pack_Var)) is procedure Force_Body is null; end Pack; ---------------------------- -- Compilation and output -- ---------------------------- $ gcc -c pack.adb pack.ads:23:12: indicator Part_Of is required in this context (SPARK RM 7.2.6(2)) pack.ads:23:12: "Error_Inst_1" is declared in the private part of package "Pack" pack.ads:24:12: indicator Part_Of is required in this context (SPARK RM 7.2.6(2)) pack.ads:24:12: "Error_Inst_2" is declared in the private part of package "Pack" 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com> gcc/ada/ * contracts.adb (Analyze_Contracts): Add specialized processing for package instantiation contracts. (Analyze_Package_Contract): Remove the verification of a missing Part_Of indicator. (Analyze_Package_Instantiation_Contract): New routine. * contracts.ads (Analyze_Package_Contract): Update the comment on usage. * sem_prag.adb (Check_Missing_Part_Of): Ensure that the entity of the instance is being examined when trying to determine whether a package instantiation needs a Part_Of indicator. From-SVN: r262731
2018-07-16[Ada] Minor reformattingHristian Kirtchev12-112/+132
2018-07-16 Hristian Kirtchev <kirtchev@adacore.com> gcc/ada/ * einfo.adb, exp_ch7.adb, exp_ch9.adb, exp_unst.adb, inline.adb, sem.adb, sem_ch12.adb, sem_ch13.adb, sem_ch3.adb, sem_eval.adb, sem_util.adb: Minor reformatting. From-SVN: r262730
2018-07-16[Ada] Only unnest subprograms if no previous errors were detectedArnaud Charlet2-1/+8
2018-07-16 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * frontend.adb: Only unnest subprograms if no previous errors were detected. From-SVN: r262729
2018-07-16[Ada] Fix expansion of blocks in loops inside elaboration codeEd Schonberg2-8/+46
2018-07-16 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Handle loops that contain blocks in the elaboration code for a package body. Create the elaboration subprogram wrapper only if there is a subprogram declaration in a block or loop. From-SVN: r262728
2018-07-16[Ada] Deep copy operands of membership operations for unnestingEd Schonberg2-1/+9
2018-07-16 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * exp_ch4.adb (Expand_Set_Membership): Use New_Copy_Tree to perform a deep copy of the left operand when building each conjuct of the expanded membership operation, to avoid sharing nodes between them. This sharing interferes with the unnesting machinery and is generally undesirable. From-SVN: r262727
2018-07-16[Ada] Unnesting: handle 'Address references that are callsEd Schonberg2-1/+8
2018-07-16 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * exp_unst.adb (Visit_Node): Handle 'Address references that are calls. From-SVN: r262726
2018-07-16[Ada] Unnesting: handle the semantic of Storage_Pool fieldEd Schonberg2-1/+20
2018-07-16 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * exp_unst.adb (Visit_Node): Handle the semantic of Storage_Pool field in relevant nodes: Allocate, Free, and return statements. From-SVN: r262725
2018-07-16[Ada] Fix Default_Storage_Pool aspect handling in generic instantiationsEd Schonberg2-17/+33
2018-07-16 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_ch12.adb (Analyze_Package_Instantiation): Handle properly an instance that carries an aspect Default_Storage_Pool that overrides a default storage pool that applies to the generic unit. The aspect in the generic unit was removed before copying it in the instance, rather than removing it from the copy of the aspects that are appended to the aspects in the instance. From-SVN: r262724
2018-07-16[Ada] Major code cleanupEd Schonberg5-16/+184
2018-07-16 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * einfo.adb (Set_Is_Uplevel_Referenced_Entity): Flag can appear on loop parameters. * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Handle subprogram bodies. * exp_ch9.adb (Reset_Scopes_To): Set the scopes of entities local to an entry body to be the corresponding generated subprogram, for correct analysis of uplevel references. * exp_unst.adb (Visit_Node): Handle properly binary and unary operators Ignore pragmas, fix component associations. (Register_Subprograms): Subprograms in synchronized types must be treated as reachable. From-SVN: r262723
2018-07-16[Ada] Spurious error with null Abstract_StateHristian Kirtchev5-0/+46
This patch corrects the mechanism which ensures that a package with a null Abstract_State does not introduce hidden state, by ignoring internal states and variables because they do not represent the "source" hidden state. 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com> gcc/ada/ * sem_util.adb (Check_No_Hidden_State): Ignore internally-generated states and variables. gcc/testsuite/ * gnat.dg/abstract_state1.adb, gnat.dg/abstract_state1.ads: New testcase. From-SVN: r262722
2018-07-16[Ada] Deconstruct unused Withed_Body filed of N_With_Clause nodePiotr Trojanek3-31/+5
The Withed_Body field was added to N_With_Clause node to help the Walk_Library_Items routine, which was created for the CodePeer backend and later adopted by the GNATprove. This routine is meant to traverse all library units, such that declarations are visited before references. However, for complex units (in particular, with generics and child packages) it never worked reliably and backends developed their own workarounds. This patch deconstructs the field, as it hasn't been used for years. Semantics unaffected; no test provided. 2018-07-16 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * sinfo.ads, sinfo.adb (Withed_Body): Remove. (Set_Withed_Body): Remove. From-SVN: r262721
2018-07-16[Ada] Avoid crash when traversing units with -gnatd.WW debug switchPiotr Trojanek2-2/+13
The debug switch -gnatd.WW enables extra info when traversing library units with Walk_Library_Items, which is used in the CodePeer and GNATprove. This routine was crashing when trying to print info about a unit with configuration pragmas (typically an .adc file). Now fixed. No test, as the crash only happens when a GNATprove backend is manually called with -gnatd.WW switch. Frontend is not affected. 2018-07-16 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * sem.adb (Walk_Library_Items): Skip units with configuration pragmas when printing debug info. From-SVN: r262720
2018-07-16[Ada] Trivial simplifications in in Walk_Library_ItemsPiotr Trojanek2-13/+15
Cleanup only; semantics unaffected. 2018-07-16 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * sem.adb (Walk_Library_Items): Reuse local constant. (Is_Subunit_Of_Main): Turn condition to positive and flip the IF-THEN-ELSE branches; avoid potentially ineffective assignment to the Lib variable. From-SVN: r262719
2018-07-16[Ada] Deconstruct always-false calls to Withed_Body in Walk_Library_ItemsPiotr Trojanek2-29/+6
We previously removed the calls to Set_Withed_Body; this commit deconstructs calls to Withed_Body, which always returned False. The Set_Withed_Body/Withed_Body were helping the Walk_Library_Items routine traverse the AST of several compilation units such that declarations are visited before references. However, this never worked as it should and there is no point to keep the code more complicated than necessary. No test provided, because thie removed code was ineffective (and only used in the non-compiler backends, i.e. CodePeer and GNATprove). 2018-07-16 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * sem.adb (Walk_Library_Items): Deconstruct dead code. From-SVN: r262718
2018-07-16[Ada] Use common routine Expand_Nonbinary_Modular_Op for XOR expressionsEd Schonberg2-1/+8
2018-07-16 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * exp_ch4.adb (Expand_N_Op_Xor): Use common routine Expand_Nonbinary_Modular_Op. Needed for unnesting. From-SVN: r262717
2018-07-16[Ada] Add a missing check for trivial predicates on non-discrete typesEd Schonberg2-1/+11
2018-07-16 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_ch3.adb (Inherit_Predicate_Flags): A non-discrete type may have a static predicate (for example True) but has no static_discrete_predicate. From-SVN: r262716
2018-07-16[Ada] Crash on Indefinite_Hashed_Maps with -gnata -gnateVHristian Kirtchev5-4/+257
This patch corrects the generation of helper functions which verify the validity of record type scalar discriminants and scalar components when switches -gnata (assertions enabled) and -gnateV (validity checks on subprogram parameters) are in effect. 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com> gcc/ada/ * exp_attr.adb (Build_Record_VS_Func): Handle corner cases dealing with class-wide types and record extensions. gcc/testsuite/ * gnat.dg/validity_check3.adb, gnat.dg/validity_check3.ads: New testcase. From-SVN: r262715
2018-07-16[Ada] Spurious possible contraint error warning with No_Exception_PropagationJustin Squirek2-2/+14
This patch corrects an issue whereby spurious unhandled exception warnings on integer literals within static if and case expressions would be emitted when the restriction No_Exception_Propagation is enabled. ------------ -- Source -- ------------ -- gnat.adc pragma Restrictions (No_Exception_Propagation); pragma SPARK_Mode (On); -- pack.ads package Pack is procedure Filter (Ret : out Integer); end Pack; -- pack.adb package body Pack is subtype Nat is Integer range 0 .. 10; Default : constant Nat := 1; User_Override : constant Integer := -1; procedure Filter (Ret : out Integer) is Val : constant Nat := (if User_Override in Nat then User_Override else Default); begin Ret := Val; end Filter; end Pack; ---------------------------- -- Compilation and output -- ---------------------------- & gcc -c -gnatp -gnatwa pack.adb 2018-07-16 Justin Squirek <squirek@adacore.com> gcc/ada/ * sem_eval.adb (Eval_Integer_Literal): Add exception for avoiding checks on expanded literals within if and case expressions. From-SVN: r262714
2018-07-16[Ada] Segmentation_Fault with Integer'Wide_Wide_ValueHristian Kirtchev4-13/+97
This patch updates the routines which produce Wide_String and Wide_Wide_String from a String to construct a result of the proper maximum size which is later sliced. 2018-07-16 Hristian Kirtchev <kirtchev@adacore.com> gcc/ada/ * libgnat/s-wchwts.adb (Wide_String_To_String): Use the appropriate longest sequence factor. Code clean up. (Wide_Wide_String_To_String): Use the appropriate longest sequence factor. Code clean up. gcc/testsuite/ * gnat.dg/wide_wide_value1.adb: New testcase. From-SVN: r262713
2018-07-16[Ada] Bit_Order cannot be defined for record extensionsJavier Miranda4-0/+33
This patch allows the compiler to report an error on Bit_Order when defined for a record extension. 2018-07-16 Javier Miranda <miranda@adacore.com> gcc/ada/ * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Report an error on Bit_Order when defined for a record extension. gcc/testsuite/ * gnat.dg/bit_order1.adb: New testcase. From-SVN: r262712
2018-07-16[Ada] System.Object_Reader: minor code clean-upArnaud Charlet2-8/+12
2018-07-16 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * libgnat/s-objrea.ads: Minor code clean up. From-SVN: r262711
2018-07-16[Ada] Adjust reference to renumbered SPARK RM rulePiotr Trojanek2-1/+6
Rules in SPARK RM 7.1.3 were renumbered when adding support for tasking, but references in the comments were not updated. Now fixed. 2018-07-16 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * sem_ch3.adb (Process_Discriminants): Adjust reference to the SPARM RM rule. From-SVN: r262710
2018-07-16[Ada] adaint.c: minor code cleanupArnaud Charlet2-1/+5
2018-07-16 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * adaint.c (__gnat_set_file_time_name): Code clean up. From-SVN: r262709