aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2020-07-16[Ada] Ongoing work for AI12-0212 : container aggregatesEd Schonberg2-7/+301
gcc/ada/ * sem_aggr.adb (Resolve_Container_Aggregate): Add semantic checks for indexed aggregates, including component associations and iterated component associations. * exp_aggr.adb (Expand_Iterated_Component): New subprogram, subsidiary of Expand_Container_Aggreggate, used for positional, named, and indexed aggregates. (Aggregate_Size): New subprogram to precompute the size of an indexed aggregate prior to call to allocate it. (Expand_Range_Component): New subprogram so generate loop for a component association given by a range or a subtype name in an indexed aggregate.
2020-07-16[Ada] gnatbind: Fix No_Entry_Calls_In_Elaboration_Code messageBob Duff1-2/+1
gcc/ada/ * bindo-diagnostics.adb (Output_Invocation_Related_Suggestions): Use Cumulative_Restrictions.Set, because Restriction_Active only works at compile time.
2020-07-16[Ada] Ada2020: AI12-0117 Restriction No_Tasks_Unassigned_To_CPUBob Duff7-139/+176
gcc/ada/ * gnatbind.adb (Gnatbind): For No_Tasks_Unassigned_To_CPU, check that CPU has been set on the main subprogram. (Restriction_Could_Be_Set): Don't print No_Tasks_Unassigned_To_CPU if it would violate the above-mentioned rule. Up to now, all restrictions were checked by the compiler, with the binder just checking for consistency. But the compiler can't know which subprogram is the main, so it's impossible to check this one at compile time. * restrict.ads, restrict.adb: Misc refactoring. Change Warning to Warn, for consistency, since most already use Warn. (Set_Restriction): New convenience routine. * sem_ch13.adb (Attribute_CPU): Check No_Tasks_Unassigned_To_CPU. * sem_prag.adb (Pragma_CPU): Check No_Tasks_Unassigned_To_CPU. Misc refactoring. * tbuild.ads, tbuild.adb (Sel_Comp): New functions for building selected components.
2020-07-16[Ada] Remove duplicated lineEric Botcazou1-1/+0
gcc/ada/ * impunit.adb (Non_Imp_File_Names_95): Remove duplicate entry.
2020-07-16[Ada] Wrong execution of Tan on large argumentArnaud Charlet3-629/+8
gcc/ada/ * Makefile.rtl: replace a-numaux__x86.ads by a-numaux__libc-x86.ads and a-numaux__x86.adb by a-numaux__dummy.adb. * libgnat/a-numaux__x86.ads, libgnat/a-numaux__x86.adb: Removed. * libgnat/a-numaux__dummy.adb: New.
2020-07-16[Ada] Spurious error in instance nested in formal packageEd Schonberg1-0/+15
gcc/ada/ * sem_ch12.adb (Load_Parent_Of_Generic): If an ancestor is an instance whose source appears within a formal package of the current unit, there is no body of the ancestor needed to complete the current generic compilation.
2020-07-16[Ada] v7r2cert: minor refactoringDoug Rupp1-35/+20
gcc/ada/ * libgnat/s-thread__ae653.adb (taskVarAdd): Defunct, so remove. (Current_ATSD): Make it a TLS variable. (OK): Move to package scope. (System.Storage_Elements): Import and Use.
2020-07-16[Ada] Set missing Parent field of block entityEric Botcazou1-0/+1
gcc/ada/ * exp_ch9.adb (Expand_N_Accept_Statement): Set Parent of the created block entity to the created block statement.
2020-07-16[Ada] AI12-0004 Normalization and allowed charactersArnaud Charlet13-6/+490
gcc/ada/ * scng.adb (Scan): Detect wide characters not in NFKC. * libgnat/a-chahan.adb, libgnat/a-chahan.ads, libgnat/a-wichha.adb, libgnat/a-wichha.ads, libgnat/a-wichun.adb, libgnat/a-wichun.ads, libgnat/a-zchhan.adb, libgnat/a-zchhan.ads, libgnat/a-zchuni.adb, libgnat/a-zchuni.ads (Is_NFKC): New. * libgnat/s-utf_32.ads, libgnat/s-utf_32.adb (Is_UTF_32_NFKC): New.
2020-07-16[Ada] Ada2020: AI12-0117 Restriction No_Tasks_Unassigned_To_CPUBob Duff1-0/+1
gcc/ada/ * libgnat/s-rident.ads (Restriction_Id): Add No_Tasks_Unassigned_To_CPU.
2020-07-16[Ada] Adjust heuristics about size of static aggregatesBob Duff1-19/+77
gcc/ada/ * exp_aggr.adb (Max_Aggregate_Size): Use the small size of 64 when copying is needed (for example, for the initialization of a local variable, and for assignment statements). Use the larger size when static allocation can be done without copying.
2020-07-16[Ada] Ada2020: AI12-0055 No_Dynamic_CPU_Assignment restrictionBob Duff5-82/+74
gcc/ada/ * libgnat/s-rident.ads (No_Dynamic_CPU_Assignment): New restriction. Add it to all relevant profiles. * sem_ch13.adb (Attribute_CPU): Check No_Dynamic_CPU_Assignment restriction. (Attribute_CPU, Attribute_Dispatching_Domain, Attribute_Interrupt_Priority): Remove error checks -- these are checked in the parser. * sem_prag.adb (Pragma_CPU): Check No_Dynamic_CPU_Assignment restriction. We've got a little violation of DRY here. * sem.ads, sem_ch3.ads: Minor comment fix.
2020-07-16[Ada] Implicit dereferencing in container indexingGary Dismukes1-1/+20
gcc/ada/ * sem_ch4.adb (Try_Container_Indexing): When the prefix type is an access type, change it to the designated type, change the prefix to an explicit dereference, and emit a ?d? warning for the implicit dereference. Include a ??? comment questioning whether this is the right context in which to perform the implicit dereferencing.
2020-07-16[Ada] AI12-0373 Additional check on Integer_Literal functionArnaud Charlet2-20/+19
gcc/ada/ * sem_ch13.adb (Validate_Literal_Aspect): Ensure that the parameter is not aliased. Minor reformatting. * sem_util.adb (Statically_Names_Object): Update comment.
2020-07-16[Ada] Handle N_Others_Choice case in range-building functionGhjuvan Lacambre2-1/+24
gcc/ada/ * sem_case.adb (Build_Choice): Set Is_Static_Expression flag. (Lit_Of): Update specification to mention Is_Static_Expression flag. * sem_ch13.adb (Membership_Entry): Check for N_Others_Choice.
2020-07-16[Ada] Ada2020: AI12-0289 Implicitly null excluding anon accessBob Duff1-21/+55
gcc/ada/ * sem_ch6.adb (Null_Exclusions_Match): New function to check that the null exclusions match, including in the case addressed by this AI. (Check_Conformance): Remove calls to Comes_From_Source when calling Null_Exclusions_Match. These are not needed, as indicated by an ancient "???" comment.
2020-07-16[Ada] Spurious accessibility error on allocator in generic instanceJustin Squirek2-16/+26
gcc/ada/ * exp_ch4.adb (Expand_N_Type_Conversion): Remove flawed test for whether "statically deeper" accessibility rules apply to a given target type and instead use the new routine Statically_Deeper_Relation_Applies. (Statically_Deeper_Relation_Applies): Created to centralize the calculation of whether a target type within a conversion must have static accessibility checks. * sem_ch13.adb (Check_One_Function): Minor comment revision.
2020-07-16[Ada] Small cleanup in interface with GCC back-endEric Botcazou2-4/+0
gcc/ada/ * fe.h (Is_OK_Static_Expression): Delete. * sem_eval.ads (Is_OK_Static_Expression): Remove WARNING note.
2020-07-16[Ada] Incorrect static accessibility error in return aggregateJustin Squirek4-5/+37
gcc/ada/ * einfo.adb, einfo.ads (Is_Named_Access_Type): Created for readability. * sem_ch6.adb (Check_Return_Construct_Accessibility): Add special cases for formals. * sem_util.adb (Object_Access_Level): Add handling of access attributes and named access types in the general case.
2020-07-16[Ada] Simplify detection of others choice with just one valuePiotr Trojanek1-1/+1
gcc/ada/ * sem_case.adb (Build_Choice): Simplify.
2020-07-16[Ada] Disable Initialize_Scalars on runtime filesArnaud Charlet1-0/+10
gcc/ada/ * frontend.adb: Disable Initialize_Scalars on runtime files.
2020-07-16[Ada] Do not perform null exclusion static checks on generated entitiesGhjuvan Lacambre1-1/+1
gcc/ada/ * sem_ch3.adb (Analyze_Object_Declaration): Add Comes_From_Source call.
2020-07-16[Ada] Avoid false positive reported by CodePeerJavier Miranda1-1/+1
gcc/ada/ * exp_attr.adb (Expand_Access_To_Protected_Op): Initialize variable Sub to Empty to avoid false positive reported by Codepeer.
2020-07-16[Ada] Spurious redundant use clause warningArnaud Charlet1-4/+11
gcc/ada/ * sem_ch8.adb (Note_Redundant_Use): Add missing warning tag. Do not check for redundant use clauses in predefined units to avoid misleading warnings that may occur as part of a rtsfind load.
2020-07-16[Ada] Ada2020: AI12-0107 convention of By_Protected_ProcedureJavier Miranda5-20/+203
gcc/ada/ * exp_attr.adb (Has_By_Protected_Procedure_Prefixed_View): New subprogram. (Expand_Access_To_Protected_Op): Adding support for prefixed class-wide view with By_Protected_Procedure convention. * sem_attr.adb (Get_Convention): New subprogram. (Get_Kind): Adapted to use Get_Convention. * sem_ch4.adb (Try_By_Protected_Procedure_Prefixed_View): New subprogram. (Analyze_Selected_Component): Invoke Try_By_Protected_Procedure_Prefixed_View. * sem_util.ads (Is_By_Protected_Procedure): New subprogram. * sem_util.adb (Is_By_Protected_Procedure): New subprogram.
2020-07-16[Ada] Overflow in string streamingArnaud Charlet2-10/+19
gcc/ada/ * libgnat/s-ststop.ads: Fix typo. * libgnat/s-ststop.adb (Read, Write): Fix block number computation to avoid overflows in case of large strings.
2020-07-16[Ada] Add centralized capacity check in Generic_BignumsArnaud Charlet1-19/+12
gcc/ada/ * libgnat/s-genbig.adb ("**"): Remove capacity limit check. Improve code by using an extended return. (Normalize): Perform capacity limit check here instead which is the centralized place where (potentially large) big integers are allocated.
2020-07-16[Ada] AI12-0042: Type invariant checking rulesGary Dismukes2-1/+108
gcc/ada/ * exp_ch4.adb (Expand_N_Type_Conversion): Handle the case of applying an invariant check for a conversion to a class-wide type whose root type has a type invariant, when the conversion appears within the immediate scope of the type and the expression is of a specific tagged type. * sem_ch3.adb (Is_Private_Primitive): New function to determine whether a primitive subprogram is a private operation. (Check_Abstract_Overriding): Enforce the restriction imposed by AI12-0042 of requiring overriding of an inherited nonabstract private operation when the ancestor has a class-wide type invariant and the ancestor's private operation is visible. (Derive_Subprogram): Set Requires_Overriding on a subprogram inherited from a visible private operation of an ancestor to which a Type_Invariant'Class expression applies.
2020-07-16Daily bump.GCC Administrator5-1/+350
2020-07-15i386: Introduce peephole2 to use flags from CMPXCHG more [PR96189]Uros Bizjak2-0/+47
CMPXCHG instruction sets ZF flag if the values in the destination operand and EAX register are equal; otherwise the ZF flag is cleared and value from destination operand is loaded to EAX. Following assembly: movl %esi, %eax lock cmpxchgl %edx, (%rdi) cmpl %esi, %eax sete %al can be optimized by removing the unneeded comparison, since set ZF flag signals that no update to EAX happened. 2020-15-07 Uroš Bizjak <ubizjak@gmail.com> gcc/ChangeLog: PR target/95355 * config/i386/sync.md (peephole2 to remove unneded compare after CMPXCHG): New pattern. gcc/testsuite/ChangeLog: PR target/95355 * gcc.target/i386/pr96189.c: New test.
2020-07-15openmp: Fix up loop-21.cJakub Jelinek3-38/+23
I've missed +FAIL: libgomp.c/loop-21.c execution test during testing of the recent patch. The problem is that while for the number of iterations computation it doesn't matter if we compute min_inner_iterations as (m2 * first + n2 + (adjusted step) + m1 * first + n1) / step or (m2 * last + n2 + (adjusted step) + m1 * last + n1) / step provided that in the second case we use as factor (m1 - m2) * ostep / step rather than (m2 - m1) * ostep / step, for the logical to actual iterator values computation it does matter and in my hand written C implementations of all the cases (outer vs. inner loop with increasing vs. decreasing iterator) I'm using the same computation and it worked well for all the pseudo-random iterators testing it was doing. It also means min_inner_iterations is misnamed, because it is not really minimum number of inner iterations, whether the first or last outer iteration results in the smaller or larger value of this can be (sometimes) only determined at runtime. So this patch also renames it to first_inner_iterations. 2020-07-15 Jakub Jelinek <jakub@redhat.com> PR libgomp/96198 * omp-general.h (struct omp_for_data): Rename min_inner_iterations member to first_inner_iterations, adjust comment. * omp-general.c (omp_extract_for_data): Adjust for the above change. Always use n1first and n2first to compute it, rather than depending on single_nonrect_cond_code. Similarly, always compute factor as (m2 - m1) * outer_step / inner_step rather than sometimes m1 - m2 depending on single_nonrect_cond_code. * omp-expand.c (expand_omp_for_init_vars): Rename min_inner_iterations to first_inner_iterations and min_inner_iterationsd to first_inner_iterationsd.
2020-07-15c++: refactor some parser codeNathan Sidwell1-34/+27
cp_parser_declaration copies tokens to local variables, before inspecting (some of) their fields. There's no need. Just point at them in the token buffer -- they don't move. Also, we never look at the second token if the first is EOF, so no need for some kind of dummy value in that case. gcc/cp/ * parser.c (cp_parser_declaration): Avoid copying tokens. (cp_parser_block_declaration): RAII token pointer.
2020-07-15[Ada] Cleanup code related to object overlaysPiotr Trojanek1-2/+2
gcc/ada/ * sem_util.adb (Find_Overlaid_Entity): Fix style in comment. (Note_Possible_Modification): Simplify repeated calls to Ekind.
2020-07-15[Ada] Cleanup in Convert_To_Positional after previous workEric Botcazou1-15/+3
gcc/ada/ * exp_aggr.adb (Flatten): Adjust description. (Convert_To_Positional): Remove obsolete ??? comment and use Compile_Time_Known_Value in the final test.
2020-07-15[Ada] Ongoing work for AI12-0212: container aggregatesArnaud Charlet9-30/+153
gcc/ada/ * par-ch4.adb (P_Iterated_Component_Association): Extended to recognzize the similar Iterated_Element_Association. This node is only generated when an explicit Key_Expression is given. Otherwise the distinction between the two iterated forms is done during semantic analysis. * sinfo.ads: New node N_Iterated_Element_Association, for Ada202x container aggregates. New field Key_Expression. * sinfo.adb: Subprograms for new node and newn field. * sem_aggr.adb (Resolve_Iterated_Component_Association): Handle the case where the Iteration_Scheme is an Iterator_Specification. * exp_aggr.adb (Wxpand_Iterated_Component): Handle a component with an Iterated_Component_Association, generate proper loop using given Iterator_Specification. * exp_util.adb (Insert_Axtions): Handle new node as other aggregate components. * sem.adb, sprint.adb: Handle new node. * tbuild.adb (Make_Implicit_Loop_Statement): Handle properly a loop with an Iterator_ specification.
2020-07-15[Ada] Fix logic in Allocate_Any_ControlledArnaud Charlet1-6/+9
gcc/ada/ * libgnat/s-stposu.adb (Allocate_Any_Controlled): Fix logic in lock/unlock.
2020-07-15[Ada] Target name is an object referencePiotr Trojanek1-0/+5
gcc/ada/ * sem_util.adb (Is_Object_Reference): Return True on N_Target_Name.
2020-07-15[Ada] Spurious error on Predicate_Failure aspectArnaud Charlet1-0/+2
gcc/ada/ * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Add proper handling of Aspect_Predicate_Failure, consistent with Check_Aspect_At_Freeze_Point.
2020-07-15[Ada] Mention -gnat2020 in error messageArnaud Charlet1-1/+2
gcc/ada/ * sem_ch13.adb (Check_Aspect_Too_Late): Mention -gnat2020 switch in error message.
2020-07-15[Ada] Do not generate elaboration code for alignment aspectEric Botcazou4-9/+21
gcc/ada/ * einfo.ads (Delayed Freezing and Elaboration): Adjust description. * freeze.adb (Freeze_Object_Declaration): Likewise. * sem_ch3.adb (Delayed_Aspect_Present): Likewise. Do not return true for Alignment. * sem_ch13.adb (Analyze_Aspect_Specifications): Do not always delay for Alignment. Moreover, for Alignment and various Size aspects, do not delay if the expression is an attribute whose prefix is the Standard package.
2020-07-15[Ada] Do not generate extra copies inside initialization proceduresEric Botcazou1-0/+7
gcc/ada/ * exp_ch6.adb (Requires_Atomic_Or_Volatile_Copy): Return false inside an initialization procedure.
2020-07-15[Ada] Guard against access to wrong fields in Is_RenamingGhjuvan Lacambre1-2/+22
gcc/ada/ * sem_util.adb (Is_Renaming): Add ekind checks.
2020-07-15[Ada] Remove doc on obsolete toolsArnaud Charlet2-2645/+184
gcc/ada/ * doc/gnat_ugn/gnat_utility_programs.rst: Remove doc on obsolete tools. * gnat_ugn.texi: Regenerate.
2020-07-15[Ada] Assert failure with -gnatwrArnaud Charlet1-4/+3
gcc/ada/ * sem_res.adb (Resolve_Type_Conversion): Protect against null entity. Add proper tag for -gnatwr warning.
2020-07-15[Ada] Missing error on operator callArnaud Charlet2-5/+9
gcc/ada/ * sem_ch6.adb (Analyze_Procedure_Call): Detect use of operators in a procedure call. * sem_util.adb: Minor edit.
2020-07-15[Ada] Fix for possibly null ranges in 'Update and delta_aggregatePiotr Trojanek1-2/+2
gcc/ada/ * exp_spark.adb (Expand_SPARK_Delta_Or_Update): Apply scalar range checks against the base type of an index type, not against the index type itself.
2020-07-15[Ada] Small addition and tweaks in documentation on freezingEric Botcazou1-5/+7
gcc/ada/ * einfo.ads (Delayed Freezing and Elaboration): Minor tweaks. Document the discrepancy between the aspect and the non-aspect cases for alignment settings in object declarations.
2020-07-15[Ada] ACATS 4.1P [BDB4001] - 13.11.4(22-23/3) not enforcedArnaud Charlet2-39/+137
gcc/ada/ * exp_ch3.adb (Freeze_Type): Remove warning in expander, replaced by a corresponding error in sem_ch13.adb. Replace RTE_Available by RTU_Loaded to avoid adding unnecessary dependencies. * sem_ch13.adb (Associate_Storage_Pool): New procedure. (Analyze_Attribute_Definition_Clause [Attribute_Simple_Storage_Pool| Attribute_Storage_Pool]): Call Associate_Storage_Pool to add proper legality checks on subpools.
2020-07-15[Ada] Mark standard containers as not in SPARKYannick Moy48-48/+144
gcc/ada/ * libgnat/a-cbdlli.adb, libgnat/a-cbdlli.ads, libgnat/a-cbhama.adb, libgnat/a-cbhama.ads, libgnat/a-cbhase.adb, libgnat/a-cbhase.ads, libgnat/a-cbmutr.adb, libgnat/a-cbmutr.ads, libgnat/a-cborma.adb, libgnat/a-cborma.ads, libgnat/a-cborse.adb, libgnat/a-cborse.ads, libgnat/a-cbprqu.adb, libgnat/a-cbprqu.ads, libgnat/a-cbsyqu.adb, libgnat/a-cbsyqu.ads, libgnat/a-cdlili.adb, libgnat/a-cdlili.ads, libgnat/a-cidlli.adb, libgnat/a-cidlli.ads, libgnat/a-cihama.adb, libgnat/a-cihama.ads, libgnat/a-cihase.adb, libgnat/a-cihase.ads, libgnat/a-cimutr.adb, libgnat/a-cimutr.ads, libgnat/a-ciorma.adb, libgnat/a-ciorma.ads, libgnat/a-ciormu.adb, libgnat/a-ciormu.ads, libgnat/a-ciorse.adb, libgnat/a-ciorse.ads, libgnat/a-cohama.adb, libgnat/a-cohama.ads, libgnat/a-cohase.adb, libgnat/a-cohase.ads, libgnat/a-coinve.adb, libgnat/a-coinve.ads, libgnat/a-comutr.adb, libgnat/a-comutr.ads, libgnat/a-convec.adb, libgnat/a-convec.ads, libgnat/a-coorma.adb, libgnat/a-coorma.ads, libgnat/a-coormu.adb, libgnat/a-coormu.ads, libgnat/a-coorse.adb, libgnat/a-coorse.ads: Add SPARK_Mode => Off.
2020-07-15[Ada] Fix oversight in Delayed_Aspect_Present predicateEric Botcazou2-4/+6
gcc/ada/ * sem_ch3.adb (Delayed_Aspect_Present): Fix oversight in loop. * freeze.adb (Freeze_Object_Declaration): Use Declaration_Node instead of Parent for the sake of consistency.