PR c++/40689
* init.c (build_new_1): Handle initializer list as array initializer.
(build_vec_init): Likewise.
* typeck.c (cp_build_modify_expr): Likewise.
* typeck2.c (process_init_constructor_array): Error rather than abort
if too many initializers.
From-SVN: r149533
PR tree-optimization/40585
* except.c (expand_resx_expr): When there already is resume
instruction, produce linked list.
(build_post_landing_pads): Assert that resume is empty.
(connect_post_landing_pads): Handle resume lists.
(dump_eh_tree): Dump resume list.
From-SVN: r149530
* checks.adb (Apply_Address_Clause_Check): Remove Size_Warning_Output
local variable and do not test it in Compile_Time_Bad_Alignment.
Do not issue size or alignment warnings for the X'Address form.
* sem_util.ads (Find_Overlaid_Object): Delete.
(Find_Overlaid_Entity): New procedure.
* sem_util.adb (Find_Overlaid_Object): Rename to...
(Find_Overlaid_Entity): ...this and turn into a procedure. Report
whether the address is offseted within the overlaid entity.
(Has_Compatible_Alignment): Track the offset globally instead of
passing it to Check_Offset. For an indexed component, compute the
full offset when possible. If the resulting offset is zero, only
check the prefix.
(Check_Offset): Delete.
* sem_ch13.adb (Address_Clause_Check_Record): Add Off field.
(Address_Aliased_Entity): Delete.
(Analyze_Attribute_Definition_Clause) <Attribute_Address>: Call
Find_Overlaid_Entity to find the overlaid entity and the offset.
Adjust throughout for above change.
(Validate_Address_Clauses): Always use attributes of entities, not of
their type. Tweak message for warning. Call Has_Compatible_Alignment
if the address is offseted to warn about incompatible alignments.
* gcc-interface/gigi.h (annotate_object): Declare.
* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Annotate renaming
entity. Call annotate_object instead of annotating manually objects.
(annotate_object): New function.
* gcc-interface/trans.c (Subprogram_Body_to_gnu): Annotate parameters
at the end.
From-SVN: r149520
2009-07-11 Thomas Quinot <quinot@adacore.com>
* sem_util.adb, sem_res.adb, sem_warn.adb: Minor comment editing:
Lvalue -> lvalue
* exp_ch6.adb: Minor reformatting
2009-07-11 Ed Schonberg <schonberg@adacore.com>
* freeze.adb (Expand_Atomic_Aggregate): Clean up code, take into
account possible type qualification to determine whether aggregate
needs a target temporary to respect atomic type or object.
* exp_aggr.adb (Expand_Record_Aggregate): Use new version of
Expand_Atomic_Aggregate.
2009-07-11 Emmanuel Briot <briot@adacore.com>
* prj.adb, prj.ads, prj-nmsc.adb (Mark_Excluded_Sources): Speed up
algorithm.
(Excluded_Sources_Htable): No longer a global table.
Change error message to indicate which files are illegal in the list
of excluded files, as opposed to only the location in the project
file.
(Find_Source): New subprogram.
From-SVN: r149515
PR debug/40713
* dwarf2out.c (dw_fde_struct): Add in_std_section and
cold_in_std_section bits.
(dwarf2out_begin_prologue): Initialize them.
(dwarf2out_finish): Don't emit FDE range into .debug_ranges
if already covered by text_section or cold_text_section range.
From-SVN: r149514
PR rtl-optimization/40667
* defaults.h (MINIMUM_ALIGNMENT): Define if not defined.
* doc/tm.texi (MINIMUM_ALIGNMENT): Document it.
* config/i386/i386.h (MINIMUM_ALIGNMENT): Define.
* config/i386/i386.c (ix86_minimum_alignment): New function.
* config/i386/i386-protos.h (ix86_minimum_alignment): New prototype.
* cfgexpand.c (expand_one_var): Use MINIMIM_ALIGNMENT.
* emit-rtl.c (gen_reg_rtx): Likewise.
* function.c (assign_parms): Likewise. If nominal_type needs
bigger alignment than FUNCTION_ARG_BOUNDARY, use its alignment
rather than passed_type's alignment.
From-SVN: r149513
PR target/40668
* function.c (assign_parm_setup_stack): Adjust
MEM_OFFSET (data->stack_parm) if promoted_mode is different
from nominal_mode on big endian.
* gcc.c-torture/execute/pr40668.c: New test.
From-SVN: r149511
2009-07-11 Paolo Bonzini <bonzini@gnu.org>
* expmed.c (emit_store_flag_1): Fix choice of zero vs. sign extension.
2009-07-11 Paolo Bonzini <bonzini@gnu.org>
* gcc.c-torture/execute/20090711-1.c: New test.
From-SVN: r149509
2009-07-10 David Daney <ddaney@caviumnetworks.com>
PR target/39079
* testsuite/gcc.target/mips/mips.exp: Make -msynci a known option.
* gcc.target/mips/clear-cache-1.c (dg-options): Add -msynci.
2009-07-10 David Daney <ddaney@caviumnetworks.com>
PR target/39079
* config.gcc (supported_defaults): Add synci.
(with_synci): Add validation.
(all_defaults): Add synci.
* config/mips/mips.md (clear_cache): Use TARGET_SYNCI instead of
ISA_HAS_SYNCI.
(synci): Same.
* config/mips/mips.opt (msynci): New option.
* config/mips/mips.c (mips_override_options): Warn on use of
-msynci for targets that do now support it.
* gcc/config/mips/mips.h (OPTION_DEFAULT_SPECS): Add a default for
msynci.
* gcc/doc/invoke.texi (-msynci): Document the new option.
* doc/install.texi (--with-synci): Document the new option.
From-SVN: r149500
2009-07-10 Thomas Quinot <quinot@adacore.com>
* exp_ch7.adb: Update comments.
2009-07-10 Arnaud Charlet <charlet@adacore.com>
* exp_ch13.adb (Expand_N_Record_Representation_Clause): Ignore mod
clause if -gnatI is set instead of crashing.
2009-07-10 Ed Schonberg <schonberg@adacore.com>
* sem_ch11.adb (Same_Expression): Null is always equal to itself.
Additional work to remove redundant successive raise statements, in
this case access checks.
2009-07-10 Vincent Celier <celier@adacore.com>
* make.adb (Compile): Always create a deep copy of the mapping file
argument (-gnatem=...) as it may be deallocate/reallocate by
Normalize_Arguments.
2009-07-10 Javier Miranda <miranda@adacore.com>
* einfo.adb (Directly_Designated_Type): Add assertion.
* sem_res.adb (Check_Fully_Declared_Prefix): Add missing check on
access types before using attribute Directly_Designated_Type.
2009-07-10 Emmanuel Briot <briot@adacore.com>
* prj.ads: Minor typo fix
2009-07-10 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (Add_Extra_Formal): Protected operations do no need
special treatment.
* exp_ch6.adb (Expand_Protected_Subprogram_Call): If rewritten
subprogram is a function call, resolve properly, to ensure that extra
actuals are added as needed.
From-SVN: r149474
2009-07-10 Richard Guenther <rguenther@suse.de>
PR tree-optimization/40496
* tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Create
the PHI result with a compatible type.
* g++.dg/opt/pr40496.C: New testcase.
From-SVN: r149469
2009-07-10 Robert Dewar <dewar@adacore.com>
* exp_util.adb: Minor code reorganization (use N_Short_Circuit)
* exp_ch4.adb: Add ??? comment for conditional expressions on limited
types.
* checks.adb (In_Declarative_Region_Of_Subprogram_Body): New procedure,
replaces Safe_To_Capture_In_Parameter_Value, and properly handles the
case of conditional expressions that may not be elaborated.
* sem_util.adb (Safe_To_Capture_Value): Properly handle case of
conditional expression where we may not execute then then or else
branches.
From-SVN: r149468
2009-07-10 Javier Miranda <miranda@adacore.com>
* exp_ch3.adb (Expand_Freeze_Record_Type): Handle constructors of
non-tagged record types.
* sem_prag.adb
(Process_Import_Or_Interface): Allow the use of "pragma Import (CPP,..)"
with non-tagged types. Required to import C++ classes that have no
virtual primitives.
(Analyze_Pragma): For pragma CPP_Constructor. Allow the use of functions
returning non-tagged types. For backward compatibility, if the
constructor returns a class wide type we internally change the
returned type to the corresponding non class-wide type.
* sem_aggr.adb
(Valid_Ancestor_Type): CPP_Constructors code cleanup.
(Resolve_Extension_Aggregate): CPP_Constructors code cleanup.
(Resolve_Aggr_Expr): CPP_Constructors code cleanup.
(Resolve_Record_Aggregate): CPP_Constructors code cleanup.
* sem_ch3.adb
(Analyze_Object_Declaration): CPP_Constructors code cleanup.
* sem_ch5.adb (Analyze_Assignment): CPP_Constructors code cleanup.
* sem_util.adb (Is_CPP_Constructor_Call): Code cleanup.
* sem_res.adb (Resolve_Allocator): CPP_Constructors code cleanup.
* exp_ch4.adb (Expand_Allocator_Expression): CPP_Constructors code
cleanup.
* exp_aggr.adb (Build_Record_Aggr_Code): CPP_Constructors code clean up.
* gnat_rm.texi
(pragma CPP_Class): Document that it can be used now with non-tagged
record types.
(pragma CPP_Constructor): Document that it can be used now with
functions returning specific types. For backward compatibility
we also support functions returning class-wide types.
* gnat_ugn.texi
(Interfacing with C++ constructors): Update the examples to incorporate
the new syntax in which the functions used to import C++ constructors
return specific types.
(Interfacing with C++ at the Class Level): Update the examples to
incorporate the new syntax in which the functions used to import
C++ constructors return specific types.
From-SVN: r149466
2009-07-10 Thomas Quinot <quinot@adacore.com>
* exp_disp.adb (Make_Disp_Asynchronous_Select_Body,
Make_Disp_Conditional_Select_Body,
Make_Disp_Timed_Select_Body): For the case of a type that is neither an
interface nor a concurrent type, the primitive body is empty. Generate
a null statement so that it remains well formed.
2009-07-10 Ed Schonberg <schonberg@adacore.com>
* exp_aggr.adb (Build_Record_Aggr_Code): If the type has discriminants,
replace references to them in defaulted component expressions with
references to the values of the discriminants of the target object.
From-SVN: r149465
2009-07-10 Ed Schonberg <schonberg@adacore.com>
* exp_ch7.adb (Build_Final_List): If the list is being built for a
Taft-Amendment type, place the finalization list in the package body,
to ensure that the tree for the spec is identical whenever it is
compiled.
2009-07-10 Javier Miranda <miranda@adacore.com>
* sem_ch3.adb (Build_Derived_Record_Type): Use the full-view when
inheriting attributes from a private Parent_Base.
From-SVN: r149464
2009-07-10 Ed Schonberg <schonberg@adacore.com>
* sem_ch11.adb (analyze_raise_xxx_error): Remove consecutive raise
statements with the same condition.
From-SVN: r149462
2009-07-10 Javier Miranda <miranda@adacore.com>
* exp_util.adb (Find_Interface_Tag): Reorder processing of incoming
Typ argument to ensure proper management of access types.
From-SVN: r149461
2009-07-10 Vincent Celier <celier@adacore.com>
* make.adb: Do not include object directories or library ALI
directories of library projects in the object path.
From-SVN: r149460
2009-07-10 Ed Schonberg <schonberg@adacore.com>
* sem_prag.adb (Analyze pragma, case Task_Name): Analyze argument of
pragma, to capture global references if the context is generic.
* exp_ch2.adb (Expand_Discriminant): If a task type discriminant
appears within the initialization procedure for the corresponding
record, replace it with the proper discriminal.
From-SVN: r149459
2009-07-10 Paul Thomas <pault@gcc.gnu.org>
PR fortran/39334
* primary.c (match_kind_param): Return MATCH_NO if the symbol
has no value.
2009-07-10 Paul Thomas <pault@gcc.gnu.org>
PR fortran/39334
* gfortran.dg/recursive_parameter_1.f90: New test.
From-SVN: r149456
gcc/cp/
2008-07-08 Simon Martin <simartin@users.sourceforge.net>
Jason Merrill <jason@redhat.com>
* pt.c (perform_typedefs_access_check, get_types_needing_access_check,
append_type_to_template_for_access_check_1): Use CLASS_TYPE_P.
Co-Authored-By: Jason Merrill <jason@redhat.com>
From-SVN: r149439