aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/specs
AgeCommit message (Collapse)AuthorFilesLines
2023-05-29Fix artificial overflow during GENERIC foldingEric Botcazou1-0/+18
The Ada compiler gives a bogus warning: storage_offset1.ads:16:52: warning: Constraint_Error will be raised at run time [enabled by default] Ironically enough, this occurs because of an intermediate conversion to an unsigned type which is supposed to hide overflows but is counter-productive for constants because TREE_OVERFLOW is always set for them, so it ends up setting a bogus TREE_OVERFLOW when converting back to the original type. The fix simply redirects INTEGER_CSTs to the other, direct path without the intermediate conversion to the unsigned type. gcc/ * match.pd ((T)P - (T)(P + A) -> -(T) A): Avoid artificial overflow on constants. gcc/testsuite/ * gnat.dg/specs/storage_offset1.ads: New test.
2023-05-19Fix internal error on small array with negative lower boundEric Botcazou1-0/+14
Ada supports arrays with negative indices, although the internal index type is sizetype like in other languages, which is unsigned. This means that negative values are represented by very large numbers, which works with a bit of care. This plugs a small loophole in output_constructor_bitfield. gcc/ * varasm.cc (output_constructor_bitfield): Call tree_to_uhwi instead of tree_to_shwi on array indices. Minor tweaks. gcc/testsuite/ * gnat.dg/specs/array6.ads: New test.
2023-03-14Add testcase for ifcvt fixEric Botcazou1-0/+69
gcc/testsuite/ PR tree-optimization/109005 * gnat.dg/specs/opt6.ads: New test.
2023-01-16Update copyright years.Jakub Jelinek1-1/+1
2022-10-25Relax assertion in profilerEric Botcazou3-0/+13
This assertion in branch_prob: if (bb == ENTRY_BLOCK_PTR_FOR_FN (cfun)->next_bb) { location_t loc = DECL_SOURCE_LOCATION (current_function_decl); gcc_checking_assert (!RESERVED_LOCATION_P (loc)); had been correct until the fix for PR debug/101598 was installed. gcc/ * profile.cc (branch_prob): Be prepared for ignored functions with DECL_SOURCE_LOCATION set to UNKNOWN_LOCATION. gcc/testsuite: * gnat.dg/specs/coverage1.ads: New test. * gnat.dg/specs/variant_part.ads: Minor tweak. * gnat.dg/specs/weak1.ads: Add dg directive.
2022-07-12[Ada] Warn on unset objects in packages with no bodiesPiotr Trojanek3-5/+6
Fix an inconsistency, where GNAT was warning about references to unset objects inside generic packages with no bodies but not inside ordinary packages with no bodies. gcc/ada/ * sem_ch7.adb (Analyze_Package_Declaration): Check references to unset objects. gcc/testsuite/ * gnat.dg/specs/discr5.ads: Expect new warnings. * gnat.dg/specs/empty_variants.ads: Likewise. * gnat.dg/specs/pack13.ads: Likewise.
2022-01-03Update copyright years.Jakub Jelinek1-1/+1
2021-05-10Remove call to gcc_unreachable in range-op.ccEric Botcazou2-0/+42
The Ada testcase happens to stumble on the call to gcc_unreachable in operator_bitwise_xor::op1_range, but there is nothing wrong going on and it's safe to let it go through. gcc/ * range-op.cc (get_bool_state): Adjust head comment. (operator_not_equal::op1_range): Fix comment. (operator_bitwise_xor::op1_range): Remove call to gcc_unreachable. gcc/testsuite/ * gnat.dg/specs/opt5.ads: New test. * gnat.dg/specs/opt5_pkg.ads: New helper.
2021-05-05Generate debug info for local dynamic record typesEric Botcazou1-1/+2
In Ada you can embed VLAs in local record types and thus end up with dynamic offsets in record types, which are not well described in DWARF because 1) the temporaries generated for them by the gimplifier are naturally marked DECL_IGNORED_P and 2) when the types are referenced in nested subprograms, the DWARF back-end does not correctly handle the rewritten references. gcc/ * dwarf2out.c (loc_list_from_tree_1) <DECL>: During early DWARF, do not expand the VALUE_EXPR of variables put in the non-local frame. * gimplify.c (gimplify_type_sizes) <RECORD_TYPE>: If the type is not to be ignored for debug info, ensure its variable offsets are not. gcc/testsuite/ * gnat.dg/debug8.adb: Minor tweak. * gnat.dg/debug11.adb: Likewise. * gnat.dg/debug16.adb: Likewise. * gnat.dg/debug17.adb: New test. * gnat.dg/specs/debug1.ads: Minor tweak.
2021-03-10Fix ICE on atomic enumeration type with LTOEric Botcazou1-0/+12
This is a strange regression whereby an enumeration type declared as atomic (or volatile) incorrectly triggers the ODR machinery for its values in LTO mode. gcc/ada/ * gcc-interface/decl.c (gnat_to_gnu_entity): Build a TYPE_STUB_DECL for the main variant of an enumeration type declared as volatile. gcc/testsuite/ * gnat.dg/specs/lto25.ads: New test.
2021-01-04Update copyright years.Jakub Jelinek1-1/+1
2020-10-22[Ada] Enable the support of 128-bit integer types by defaultEric Botcazou1-0/+1
gcc/ada/ * Makefile.rtl (GNATRTL_128BIT_PAIRS): Add i-cexten.ads. * debug.adb (d.H): Document new usage. * doc/gnat_rm/representation_clauses_and_pragmas.rst (Size Clauses): Document new limit on 64-bit platforms. (Component_Size Clauses): Likewise. (Pragma Pack for Arrays): Likewise. (Pragma Pack for Records): Likewise. (Record Representation Clauses): Likewise. * gnat_rm.texi: Regenerate. * gnat1drv.adb (Adjust_Global_Switches): Rewrite code enabling or disabling the support for 128-bit integer types. * switch-c.adb (Scan_Front_End_Switches): Do not deal with e128. * usage.adb (Write_Switch_Char): Do not print -gnate128 switch. * libgnat/i-cexten__128.ads: New file. gcc/testsuite/ * ada/acats/run_all.sh: Define and substitute target_{max,min}_int. * ada/acats/support/macro.dfs: Parameterize {MAX,MIN}_INT. * gnat.dg/assert1.adb: Adjust conditionally to 128-bit integer types. * gnat.dg/size_clause1.adb: Do not expect a warning for LP64 targets. * gnat.dg/warn11.adb: Likewise. * gnat.dg/specs/rep_clause5.ads (Array_2_Type): Add alignment clause.
2020-09-11Fix crash on array component with nonstandard index typeEric Botcazou1-0/+14
This is a regression present on mainline, 10 and 9 branches: the compiler goes into an infinite recursion eventually exhausting the stack for the declaration of a discriminated record type with an array component having a discriminant as bound and an index type that is an enumeration type with a non-standard representation clause. gcc/ada/ChangeLog: * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Subtype>: Only create extra subtypes for discriminants if the RM size of the base type of the index type is lower than that of the index type. gcc/testsuite/ChangeLog: * gnat.dg/specs/discr7.ads: New test.
2020-09-10Fix bogus error on Value_Size clause for variant record typeEric Botcazou1-0/+16
This is a regression present on the mainline and 10 branch: the compiler rejects a Value_Size clause on a discriminated record type with variant. gcc/ada/ChangeLog: * gcc-interface/decl.c (set_rm_size): Do not take into account the Value_Size clause if it is not for the entity itself. gcc/testsuite/ChangeLog: * gnat.dg/specs/size_clause5.ads: New test.
2020-01-05discr1.ads: Compile with -gnatc instead of -gnatct.Eric Botcazou5-5/+5
* gnat.dg/specs/discr1.ads: Compile with -gnatc instead of -gnatct. * gnat.dg/specs/limited_with4.ads: Likewise. * gnat.dg/specs/limited_with4_pkg.ads: Likewise. * gnat.dg/specs/private1-sub.ads: Likewise. * gnat.dg/specs/task1.ads: Likewise. From-SVN: r279889
2020-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r279813
2019-12-16[Ada] AI12-0001: Independence and Representation clauses for atomic objectsEric Botcazou2-5/+5
2019-12-16 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * gcc-interface/decl.c (gnat_to_gnu_entity): Adjust calls to validate_size. (gnat_to_gnu_component_type): Likewise. (gnat_to_gnu_field): Likewise and pass string for error messages. (components_need_strict_alignment): Remove test on Is_Aliased and add test for the independence of the component. (validate_size): Add S1 and S2 string parameters and use them to give better error messages for fields. Tweak a couple of messages. * einfo.ads (Has_Independent_Components): Document more cases. (Is_Independent): Likewise. (Strict_Alignment): Document new semantics. * exp_ch9.adb (Install_Private_Data_Declarations): Also set the Is_Independent flag along with Is_Aliased on the renaming entity. * freeze.adb (Size_Known): Remove always-false test and add test for the strict-alignment on the record type. Remove redundant tests and add test for the strict-alignment on the component type. (Check_Strict_Alignment): Set the flag if the type is by-ref and remove now redundant conditions. Set the flag on an array type if it has aliased components. In the record type case, do not set type for C_Pass_By_Copy convention. (Freeze_Array_Type): Move code checking for conflicts between representation aspects and clauses to before specific handling of packed array types. Give a warnind instead of an error for a conflict with pragma Pack. Do not test Has_Pragma_Pack for the specific handling of packed array types. (Freeze_Record_Type): Move error checking of representation clause to... (Freeze_Entity): ...here after Check_Strict_Alignment is called. * sem_aggr.adb (Array_Aggr_Subtype): Also set the Is_Independent flag along with Is_Aliased on the Itype. * sem_ch13.adb (Check_Record_Representation_Clause): Do not set the RM size for a strict-alignment type. * sem_ch3.adb (Add_Interface_Tag_Components): Also set the Is_Independent flag along with Is_Aliased on the tag. (Add_Interface_Tag_Components): Likewise on the offset. (Analyze_Component_Declaration): Likewise on the component. (Analyze_Object_Declaration): Likewise on the object. (Constrain_Array): Likewise on the array. (Record_Type_Declaration: Likewise on the tag. (Array_Type_Declaration): Also set the Has_Independent_Components flag along with Has_Aliased_Components on the array. (Copy_Array_Base_Type_Attributes): Copy Has_Independent_Components. (Copy_Array_Subtype_Attributes): Copy Is_Atomic, Is_Independent and Is_Volatile_Full_Access. (Analyze_Iterator_Specification): Set Is_Independent on the loop variable according to Independent_Components on the array. * sem_ch5.adb: Likewise. * sem_ch6.adb (Process_Formals): Also set the Is_Independent flag along with Is_Aliased on the formal. gcc/testsuite/ * gnat.dg/specs/clause_on_volatile.ads, gnat.dg/specs/size_clause3.ads: Update expected diagnostics. From-SVN: r279430
2019-10-11decl.c (gnat_to_gnu_field): Adjust again the packing for a field without ↵Eric Botcazou1-0/+20
strict alignment and with an... * gcc-interface/decl.c (gnat_to_gnu_field): Adjust again the packing for a field without strict alignment and with an oversized clause. From-SVN: r276873
2019-09-23trans.c (gnat_compile_time_expr_list): New variable.Eric Botcazou2-0/+16
* gcc-interface/trans.c (gnat_compile_time_expr_list): New variable. (Pragma_to_gnu): Rename local variable. Save the (first) expression of pragma Compile_Time_{Error|Warning} for later processing. (Compilation_Unit_to_gnu): Process the expressions saved above. From-SVN: r276045
2019-07-03dwarf2out.c (add_scalar_info): Add back refererence to existing DIE if it ↵Eric Botcazou1-0/+18
has the DW_AT_data_member_location... * dwarf2out.c (add_scalar_info): Add back refererence to existing DIE if it has the DW_AT_data_member_location attribute. From-SVN: r273002
2019-06-29decl.c (gnat_to_gnu_entity): Beep up comment on SAVED...Eric Botcazou4-0/+41
* gcc-interface/decl.c (gnat_to_gnu_entity): Beep up comment on SAVED, and tweak comment on the assertion about the scopes of Itypes. Do not skip the regular processing for Itypes that are E_Record_Subtype with a Cloned_Subtype. Get the Cloned_Subtype for every E_Record_Subtype if the type is dummy and hasn't got its own freeze node. <E_Record_Subtype>: Save again the DECL of the Cloned_Subtype, if any. <E_Access_Subtype>: Save again the DECL of the equivalent type. (Gigi_Equivalent_Type) <E_Access_Subtype>: New case. From-SVN: r272822
2019-06-29utils.c (unchecked_convert): Tweak comment.Eric Botcazou2-0/+39
* gcc-interface/utils.c (unchecked_convert): Tweak comment. Only skip dereferences when padding to have the same size on both sides. Do it for destination types with self-referential size too. From-SVN: r272821
2019-06-29decl.c (gnat_to_gnu_entity): If the type requires strict alignment, then set ↵Eric Botcazou1-2/+2
the RM size to the type size. * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: If the type requires strict alignment, then set the RM size to the type size. Rework handling of alignment and sizes of tagged types in ASIS mode. (validate_size): Rename local variable and remove special handling for strict-alignment types. * gcc-interface/utils.c (finish_record_type): Constify local variables and use properly typed constants. From-SVN: r272820
2019-06-29decl.c (gnat_to_gnu_field): Rework error messages for fields requiring ↵Eric Botcazou3-5/+5
strict alignment... * gcc-interface/decl.c (gnat_to_gnu_field): Rework error messages for fields requiring strict alignment, add explicit test on Storage_Unit for position and size, and mention type alignment for position. From-SVN: r272819
2019-06-05fold-const.c (extract_muldiv_1): Do not distribute a multiplication by a ↵Eric Botcazou1-0/+21
power-of-two value. * fold-const.c (extract_muldiv_1) <PLUS_EXPR>: Do not distribute a multiplication by a power-of-two value. (fold_plusminus_mult_expr): Use pow2p_hwi to spot a power-of-two value and turn the modulo operation into a masking operation. From-SVN: r271963
2019-05-28decl.c (components_to_record): Set a name on the type created for the REP ↵Eric Botcazou1-0/+57
part, if any. * gcc-interface/decl.c (components_to_record): Set a name on the type created for the REP part, if any. * gcc-interface/utils.c (finish_record_type): Only take the maximum when merging sizes for a variant part at offset 0. (merge_sizes): Rename has_rep parameter into max. From-SVN: r271681
2019-05-27dwarf2out.c (resolve_args_picking_1): Deal with DW_OP_GNU_addr_index and ↵Eric Botcazou1-0/+17
DW_OP_GNU_const_index opcodes. * dwarf2out.c (resolve_args_picking_1): Deal with DW_OP_GNU_addr_index and DW_OP_GNU_const_index opcodes. From-SVN: r271664
2019-01-23cgraphunit.c (cgraph_node::expand_thunk): When expanding a GIMPLE thunk that ↵Eric Botcazou1-0/+25
returns by reference... * cgraphunit.c (cgraph_node::expand_thunk): When expanding a GIMPLE thunk that returns by reference, use the type of the return object of the thunk instead of that of the alias to build the dereference. From-SVN: r268182
2019-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r267494
2018-06-02Add missing directiveEric Botcazou1-0/+2
From-SVN: r261109
2018-06-02ada-tree.h (TYPE_PADDING_FOR_COMPONENT): New macro.Eric Botcazou2-0/+18
* gcc-interface/ada-tree.h (TYPE_PADDING_FOR_COMPONENT): New macro. * gcc-interface/decl.c (gnat_to_gnu_component_type): Cache the padding type built for an aliased component with variable size. From-SVN: r261106
2018-01-03Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r256169
2017-10-21Fix typosEric Botcazou2-5/+5
From-SVN: r253972
2017-10-21utils.c (pad_type_hash): Use hashval_t for hash value.Eric Botcazou4-4/+54
* gcc-interface/utils.c (pad_type_hash): Use hashval_t for hash value. (convert): Do not use an unchecked conversion for converting from a type to another type padding it. From-SVN: r253971
2017-09-09decl.c (promote_object_alignment): New function taken from...Eric Botcazou1-0/+33
* gcc-interface/decl.c (promote_object_alignment): New function taken from... (gnat_to_gnu_entity) <E_Variable>: ...here. Invoke it. (gnat_to_gnu_field): If the field is Atomic or VFA, invoke it and create a padding type on success before doing the atomic check. From-SVN: r251931
2017-09-09decl.c (gnat_to_gnu_entity): Only set the TYPE_ALIGN_OK and ↵Eric Botcazou2-2/+112
TYPE_BY_REFERENCE_P flags on types after various... * gcc-interface/decl.c (gnat_to_gnu_entity): Only set the TYPE_ALIGN_OK and TYPE_BY_REFERENCE_P flags on types after various promotions. * gcc-interface/trans.c (node_has_volatile_full_access) <N_Identifier>: Consider all kinds of entities. From-SVN: r251927
2017-09-05utils.c (unchecked_convert): When the result type is a non-biased integral ↵Eric Botcazou1-0/+18
type with size 0... * gcc-interface/utils.c (unchecked_convert): When the result type is a non-biased integral type with size 0, set the result to 0 directly. From-SVN: r251701
2017-08-23function.c (fndecl_name): Use verbosity 1 (no arguments) for ↵Richard Biener1-1/+1
lang_hooks.decl_printable_name. 2017-08-23 Richard Biener <rguenther@suse.de> * function.c (fndecl_name): Use verbosity 1 (no arguments) for lang_hooks.decl_printable_name. * print-rtl-function.c (print_rtx_function): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * g++.dg/cpp1y/constexpr-instantiate.C: Adjust. * g++.dg/tree-ssa/pr45605.C: Likewise. * gnat.dg/noinline2.ad: Likewise.b * gnat.dg/renaming6.ad: Likewise.b * gnat.dg/renaming6.ad: Likewise.s * gnat.dg/specs/noinline3.ad: Likewise.s From-SVN: r251308
2017-05-22decl.c (gnat_to_gnu_entity): Skip regular processing for Itypes that are ↵Eric Botcazou1-0/+11
E_Access_Subtype. * gcc-interface/decl.c (gnat_to_gnu_entity): Skip regular processing for Itypes that are E_Access_Subtype. <E_Access_Subtype>: Use the DECL of the base type directly. From-SVN: r248323
2017-05-22decl.c (gnat_to_gnu_field): Do not enforce strict alignment for simple ↵Eric Botcazou2-4/+4
volatile fields and remove... * gcc-interface/decl.c (gnat_to_gnu_field): Do not enforce strict alignment for simple volatile fields and remove associated errors. testsuite/ * gnat.dg/specs/volatile1.ads: Remove obsolete errors. * gnat.dg/specs/clause_on_volatile.ads: Likewise. From-SVN: r248320
2017-05-15utils.c (can_materialize_object_renaming_p): Synchronize with GNAT's ↵Pierre-Marie de Rodat1-0/+25
Exp_Dbug.Debug_Renaming_Declaration... * gcc-interface/utils.c (can_materialize_object_renaming_p): Synchronize with GNAT's Exp_Dbug.Debug_Renaming_Declaration: process Original_Node instead of expanded names. From-SVN: r248054
2017-04-28Remove superfluous "" in dg-(error|warning|message|bogus)Tom de Vries1-1/+1
find $(find -type d -name testsuite) -type f \ | xargs sed -ri 's#(dg-(error|warning|message|bogus).*)" "" \}#\1" }#' 2017-04-28 Tom de Vries <tom@codesourcery.com> * g++.dg/abi/bitfield3.C: Remove superfluous "" in dg-(error|warning|message|bogus). * g++.dg/conversion/dr195-1.C: Same. * g++.dg/conversion/dr195.C: Same. * g++.dg/cpp0x/constexpr-reinterpret1.C: Same. * g++.dg/cpp0x/gen-attrs-14.C: Same. * g++.dg/cpp0x/inline-ns7.C: Same. * g++.dg/cpp0x/variadic105.C: Same. * g++.dg/cpp0x/variadic65.C: Same. * g++.dg/expr/call2.C: Same. * g++.dg/expr/member-of-incomplete-type-1.C: Same. * g++.dg/expr/pmf-1.C: Same. * g++.dg/ext/altivec-types-1.C: Same. * g++.dg/ext/altivec-types-2.C: Same. * g++.dg/ext/altivec-types-3.C: Same. * g++.dg/ext/attrib14.C: Same. * g++.dg/ext/complit1.C: Same. * g++.dg/ext/forscope2.C: Same. * g++.dg/ext/gnu-inline-global-reject.C: Same. * g++.dg/ext/label13.C: Same. * g++.dg/ext/member-attr.C: Same. * g++.dg/ext/visibility/anon7.C: Same. * g++.dg/ext/visibility/visibility-7.C: Same. * g++.dg/ext/vla2.C: Same. * g++.dg/inherit/access2.C: Same. * g++.dg/inherit/covariant12.C: Same. * g++.dg/inherit/covariant14.C: Same. * g++.dg/inherit/namespace-as-base.C: Same. * g++.dg/inherit/template-as-base.C: Same. * g++.dg/lookup/ambig1.C: Same. * g++.dg/lookup/ambig2.C: Same. * g++.dg/lookup/ambig3.C: Same. * g++.dg/lookup/class-member-1.C: Same. * g++.dg/lookup/conv-1.C: Same. * g++.dg/lookup/decl1.C: Same. * g++.dg/lookup/koenig1.C: Same. * g++.dg/lookup/scoped1.C: Same. * g++.dg/lookup/scoped2.C: Same. * g++.dg/lookup/two-stage4.C: Same. * g++.dg/lookup/used-before-declaration.C: Same. * g++.dg/lookup/using.C: Same. * g++.dg/lookup/using17.C: Same. * g++.dg/lookup/using2.C: Same. * g++.dg/other/abstract2.C: Same. * g++.dg/other/classkey1.C: Same. * g++.dg/other/component1.C: Same. * g++.dg/other/const1.C: Same. * g++.dg/other/const2.C: Same. * g++.dg/other/conversion1.C: Same. * g++.dg/other/do1.C: Same. * g++.dg/other/error1.C: Same. * g++.dg/other/error10.C: Same. * g++.dg/other/error3.C: Same. * g++.dg/other/error4.C: Same. * g++.dg/other/error5.C: Same. * g++.dg/other/error8.C: Same. * g++.dg/other/error9.C: Same. * g++.dg/other/field1.C: Same. * g++.dg/other/init1.C: Same. * g++.dg/other/ptrmem2.C: Same. * g++.dg/other/return1.C: Same. * g++.dg/overload/builtin3.C: Same. * g++.dg/overload/error1.C: Same. * g++.dg/overload/error2.C: Same. * g++.dg/overload/koenig2.C: Same. * g++.dg/overload/pmf1.C: Same. * g++.dg/parse/args1.C: Same. * g++.dg/parse/attr3.C: Same. * g++.dg/parse/constant4.C: Same. * g++.dg/parse/crash10.C: Same. * g++.dg/parse/crash18.C: Same. * g++.dg/parse/crash19.C: Same. * g++.dg/parse/crash20.C: Same. * g++.dg/parse/crash21.C: Same. * g++.dg/parse/crash22.C: Same. * g++.dg/parse/crash32.C: Same. * g++.dg/parse/decl-specifier-1.C: Same. * g++.dg/parse/error58.C: Same. * g++.dg/parse/local-class1.C: Same. * g++.dg/parse/non-dependent2.C: Same. * g++.dg/parse/parameter-declaration-1.C: Same. * g++.dg/parse/ptrmem2.C: Same. * g++.dg/parse/ptrmem3.C: Same. * g++.dg/parse/saved1.C: Same. * g++.dg/tc1/dr101.C: Same. * g++.dg/tc1/dr142.C: Same. * g++.dg/tc1/dr176.C: Same. * g++.dg/template/conv4.C: Same. * g++.dg/template/crash56.C: Same. * g++.dg/template/dependent-expr2.C: Same. * g++.dg/template/error1.C: Same. * g++.dg/template/error2.C: Same. * g++.dg/template/explicit6.C: Same. * g++.dg/template/init-list.C: Same. * g++.dg/template/local1.C: Same. * g++.dg/template/lookup2.C: Same. * g++.dg/template/meminit2.C: Same. * g++.dg/template/nontype25.C: Same. * g++.dg/template/ptrmem2.C: Same. * g++.dg/template/qualttp19.C: Same. * g++.dg/template/qualttp20.C: Same. * g++.dg/template/ttp3.C: Same. * g++.dg/template/unify4.C: Same. * g++.dg/template/unify6.C: Same. * g++.dg/template/unify7.C: Same. * g++.dg/template/warn1.C: Same. * g++.dg/tree-ssa/dom-invalid.C: Same. * g++.dg/ubsan/shift-1.C: Same. * g++.dg/warn/Wunused-2.C: Same. * g++.dg/warn/Wunused-4.C: Same. * g++.dg/warn/Wunused-6.C: Same. * g++.dg/warn/deprecated-6.C: Same. * g++.dg/warn/deprecated.C: Same. * g++.dg/warn/effc1.C: Same. * g++.dg/warn/effc3.C: Same. * g++.dg/warn/incomplete1.C: Same. * g++.dg/warn/inline1.C: Same. * g++.dg/warn/noeffect2.C: Same. * g++.dg/warn/noeffect4.C: Same. * g++.dg/warn/oldcast1.C: Same. * g++.dg/warn/sentinel.C: Same. * g++.dg/warn/unit-1.C: Same. * g++.old-deja/g++.pt/inherit2.C: Same. * g++.old-deja/g++.pt/overload8.C: Same. * gcc.dg/20000926-1.c: Same. * gcc.dg/20040223-1.c: Same. * gcc.dg/Warray-bounds-7.c: Same. * gcc.dg/alias-1.c: Same. * gcc.dg/alias-12.c: Same. * gcc.dg/alias-13.c: Same. * gcc.dg/alias-2.c: Same. * gcc.dg/array-13.c: Same. * gcc.dg/array-4.c: Same. * gcc.dg/attr-ifunc-2.c: Same. * gcc.dg/attr-invalid.c: Same. * gcc.dg/attr-noinline.c: Same. * gcc.dg/bitfld-2.c: Same. * gcc.dg/c90-const-expr-7.c: Same. * gcc.dg/c99-const-expr-7.c: Same. * gcc.dg/cpp/20000625-1.c: Same. * gcc.dg/cpp/charconst-4.c: Same. * gcc.dg/cpp/include2.c: Same. * gcc.dg/cpp/include2a.c: Same. * gcc.dg/decl-4.c: Same. * gcc.dg/deprecated-4.c: Same. * gcc.dg/deprecated.c: Same. * gcc.dg/dfp/altivec-types.c: Same. * gcc.dg/float-range-1.c: Same. * gcc.dg/pack-test-3.c: Same. * gcc.dg/pr11492.c: Same. * gcc.dg/pr15360-1.c: Same. * gcc.dg/pr37908.c: Same. * gcc.dg/pr53265.c: Same. * gcc.dg/pr57287-2.c: Same. * gcc.dg/pr57287.c: Same. * gcc.dg/redecl-1.c: Same. * gcc.dg/sync-3.c: Same. * gcc.dg/two-types-1.c: Same. * gcc.dg/two-types-2.c: Same. * gcc.dg/two-types-4.c: Same. * gcc.dg/two-types-5.c: Same. * gcc.dg/two-types-6.c: Same. * gcc.dg/two-types-7.c: Same. * gcc.dg/two-types-8.c: Same. * gcc.dg/two-types-9.c: Same. * gcc.dg/uninit-I.c: Same. * gcc.dg/uninit-pr19430.c: Same. * gcc.dg/visibility-7.c: Same. * gcc.dg/winline-10.c: Same. * gcc.dg/winline-2.c: Same. * gcc.dg/winline-3.c: Same. * gcc.dg/winline-9.c: Same. * gcc.target/i386/attr-returns_twice-1.c: Same. * gcc.target/i386/chkp-const-check-2.c: Same. * gcc.target/i386/chkp-label-address.c: Same. * gcc.target/i386/chkp-remove-bndint-2.c: Same. * gcc.target/i386/pr39162.c: Same. * gcc.target/i386/sse-5.c: Same. * gcc.target/powerpc/altivec-types-1.c: Same. * gcc.target/powerpc/altivec-types-2.c: Same. * gcc.target/powerpc/altivec-types-3.c: Same. * gcc.target/powerpc/float128-mix.c: Same. * gcc.target/powerpc/no-r11-3.c: Same. * gcc.target/spu/Wmain.c: Same. * gcc.target/spu/ea/errors2.c: Same. * gfortran.dg/assignment_1.f90: Same. * gfortran.dg/common_3.f90: Same. * gfortran.dg/der_io_1.f90: Same. * gfortran.dg/g77/20030326-1.f: Same. * gfortran.dg/g77/9263.f: Same. * gfortran.dg/g77/960317-1.f: Same. * gfortran.dg/g77/970625-2.f: Same. * gfortran.dg/g77/980615-0.f: Same. * gfortran.dg/g77/check0.f: Same. * gfortran.dg/g77/dnrm2.f: Same. * gfortran.dg/g77/pr9258.f: Same. * gfortran.dg/ichar_1.f90: Same. * gfortran.dg/interface_1.f90: Same. * gfortran.dg/namelist_1.f90: Same. * gfortran.dg/namelist_2.f90: Same. * gfortran.dg/namelist_3.f90: Same. * gfortran.dg/namelist_print_2.f: Same. * gfortran.dg/oldstyle_1.f90: Same. * gfortran.dg/runtime_warning_1.f90: Same. * gfortran.dg/underflow.f90: Same. * gnat.dg/specs/integer_value.ads: Same. * obj-c++.dg/fsf-package-0.m: Same. * objc.dg/two-types-1.m: Same. From-SVN: r247389
2017-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r243994
2016-10-10decl.c (gnat_to_gnu_entity): Put volatile qualifier on types at the very end ↵Eric Botcazou1-0/+14
of the processing. * gcc-interface/decl.c (gnat_to_gnu_entity): Put volatile qualifier on types at the very end of the processing. (gnat_to_gnu_param): Remove redundant test. (change_qualified_type): Do nothing for unconstrained array types. From-SVN: r240915
2016-03-27decl.c (components_to_record): Add special case for single field with ↵Eric Botcazou1-0/+22
representation clause at offset 0. * gcc-interface/decl.c (components_to_record): Add special case for single field with representation clause at offset 0. From-SVN: r234494
2016-03-03* gnat.dg/specs/task1.ads: New test.Eric Botcazou1-0/+16
From-SVN: r233932
2016-01-04Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r232055
2016-01-02* gnat.dg/specs/debug1.ads: Delete.Eric Botcazou1-14/+0
From-SVN: r232035
2015-12-18* gnat.dg/specs/debug1.ads: Bump final count to 18.Eric Botcazou1-1/+1
From-SVN: r231825
2015-12-17DWARF: handle variable-length records and variant partsPierre-Marie de Rodat1-1/+1
Enhance the DWARF back-end to emit proper descriptions for variable-length records as well as variant parts in records. In order to achieve this, generate DWARF expressions ("location descriptions" in dwarf2out's parlance) for size and data member location attributes. Also match QUAL_UNION_TYPE data types as variant parts, assuming the formers appear only to implement the latters (which is the case at the moment: only the Ada front-end emits them). Note that very few debuggers can handle these descriptions (GDB does not yet), so in order to ease the the transition enable these only when -fgnat-encodings=minimal. gcc/ada/ChangeLog: * gcc-interface/decl.c (gnat_to_gnu_entity): Disable ___XVS GNAT encodings when -fgnat-encodings=minimal. (components_to_record): Disable ___XVE, ___XVN, ___XVU and ___XVZ GNAT encodings when -fgnat-encodings=minimal. * gcc-interface/utils.c (maybe_pad_type): Disable __XVS GNAT encodings when -fgnat-encodings=minimal. gcc/ChangeLog: * debug.h (struct gcc_debug_hooks): Add a new size_function hook. * debug.c (do_nothing_debug_hooks): Set the size_function field to no-op. * dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Likewise. * sdbout.c (sdb_debug_hooks): Likewise. * vmsdbgout.c (vmsdbg_debug_hooks): Likewise. * stor-layout.c (finalize_size_functions): Let the debug info back-end know about the implementation of size functions. * dwarf2out.h (dw_discr_list_ref): New typedef. (enum dw_val_class): Add value classes for discriminant values and discriminant lists. (struct dw_discr_value): New structure. (struct dw_val_node): Add discriminant values and discriminant lists to the union. (struct dw_loc_descr_node): Add frame_offset_rel and dw_loc_frame_offset (only for checking) fields to handle DWARF procedures generation. (struct dw_discr_list_node): New structure. * dwarf2out.c (dwarf2out_size_function): New. (dwarf2_debug_hooks): Set the size_function field to dwarf2out_size_function. (dwarf2_lineno_debug_hooks): Set the size_function field to no-op. (new_loc_descr): Initialize the dw_loc_frame_offset field. (dwarf_proc_stack_usage_map): New. (dw_val_equal_p): Handle discriminants. (size_of_discr_value): New. (size_of_discr_list): New. (size_of_die): Handle discriminants. (add_loc_descr_to_each): New. (add_loc_list): New. (print_discr_value): New. (print_dw_val): Handle discriminants. (value_format): Handle discriminants. (output_discr_value): New. (output_die): Handle discriminants. (output_loc_operands): Handle DW_OP_call2 and DW_OP_call4. (uint_loc_descriptor): New. (uint_comparison_loc_list): New. (loc_list_from_uint_comparison): New. (add_discr_value): New. (add_discr_list): New. (AT_discr_list): New. (loc_descr_to_next_no_op): New. (free_loc_descr): New. (loc_descr_without_nops): New. (struct loc_descr_context): Add a dpi field. (struct dwarf_procedure_info): New helper structure. (new_dwarf_proc_die): New. (is_handled_procedure_type): New. (resolve_args_picking_1): New. (resolve_args_picking): New. (function_to_dwarf_procedure): New. (copy_dwarf_procedure): New. (copy_dwarf_procs_ref_in_attrs): New. (copy_dwarf_procs_ref_in_dies): New. (break_out_comdat_types): Copy DWARF procedures along with the types that reference them. (loc_list_from_tree): Rename into loc_list_from_tree_1. Handle CALL_EXPR in the cases suitable for DWARF procedures. Handle for PARM_DECL when generating a location description for a DWARF procedure. Handle big unsigned INTEGER_CST nodes. Handle NON_LVALUE_EXPR, EXACT_DIV_EXPR and all unsigned comparison operators. Add a wrapper for loc_list_from_tree that strips DW_OP_nop operations from the result. (type_byte_size): New. (struct vlr_context): New helper structure. (field_byte_offset): Change signature to return either a constant offset or a location description for dynamic ones. Handle dynamic byte offsets with constant bit offsets and handle fields in variant parts. (add_data_member_location): Change signature to handle dynamic member offsets and fields in variant parts. Update call to field_byte_offset. Handle location lists. Emit a variable data member location only when -fgnat-encodings=minimal. (add_bound_info): Emit self-referential bounds only when -fgnat-encodings=minimal. (add_byte_size_attribute): Use type_byte_size in order to handle dynamic type sizes. Emit variable byte size only when -fgnat-encodings=minimal and when the target DWARF version allows them. (add_bit_offset_attribute): Change signature to handle variable-length records. Update call to field_byte_offset. (gen_descr_array_type_die): Update call to gen_field_die. Update loc_descr_context literal. (gen_type_die_for_member): Likewise. (gen_subprogram_die): Update calls to get_decl_die. (gen_field_die): Change signature to handle variable-length records. Update calls to add_bit_offset_attribute and add_data_member_location_attribute. (gen_inheritance_die): Update call to add_data_member_location_attribute. (gen_decl_die): Change signature to handle variable-length records. Update call to gen_field_die. (gen_inheritance_die): Change signature to handle variable-length records. Update call to add_data_member_location_attribute. (is_variant_part): New. (analyze_discr_in_predicate): New. (get_discr_value): New. (analyze_variants_discr): New. (gen_variant_part): New. (gen_member_die): Update calls to gen_decl_die. Call instead gen_variant_part for variant parts. (gen_type_die_with_usage): Update calls to gen_decl_die. (process_scope_var): Likewise. (force_decl_die): Likewise. (declare_in_namespace): Likewise. (dwarf2out_decl): Likewise. (prune_unused_types_walk_loc_descr): New. (prune_unused_types_walk_attribs): Mark DIEs referenced by location descriptions and loc. descr. lists. (prune_unused_types_walk): Don't mark DWARF procedures by default. Mark variant parts since nothing is supposed to reference them. (dwarf2out_init): Allocate dwarf_proc_stack_usage_map. (dwarf2out_c_finalize): Deallocate and reset dwarf_proc_stack_usage_map. gcc/testsuite/ChangeLog: * gnat.dg/specs/debug1.ads: Update the expected number of DW_AT_artificial attribute in compiler output. From-SVN: r231762