2012-07-18 Richard Guenther <rguenther@suse.de>
* tree.h (get_object_or_type_alignment): Remove.
* builtins.c (get_object_alignment_2): New function copied from
get_object_alignment_1. Take extra argument to indicate whether
we take the address of EXP. Rework to use type alignment information
if not, and return whether the result is an approximation or not.
(get_object_alignment_1): Wrap around get_object_alignment_2.
(get_pointer_alignment_1): Call get_object_alignment_2 indicating
we take the address.
(get_object_or_type_alignment): Remove.
* expr.c (expand_assignment): Call get_object_alignment.
(expand_expr_real_1): Likewise.
From-SVN: r189607
2012-07-17 Kazu Hirata <kazu@codesourcery.com>
Sandra Loosemore <sandra@codesourcery.com>
gcc/testsuite/
* gcc.target/m68k/pr36134.c: Use dg-skip-if to skip the testcase
if there is a conflict with -mcpu=. Use -mcpu=5208.
Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com>
From-SVN: r189596
* dumpfile.h (TDF_COMMENT): New define.
* basic-block.h (EDGE_FALLTHRU, EDGE_ABNORMAL, EDGE_ABNORMAL_CALL,
EDGE_EH, EDGE_FAKE, EDGE_DFS_BACK, EDGE_CAN_FALLTHRU,
EDGE_IRREDUCIBLE_LOOP, EDGE_SIBCALL, EDGE_LOOP_EXIT, EDGE_TRUE_VALUE,
EDGE_FALSE_VALUE, EDGE_EXECUTABLE, EDGE_CROSSING, EDGE_PRESERVE):
Move to new file cfg-flags.h.
(enum cfg_edge_flags): New enum, using cfg-flags.h.
(EDGE_ALL_FLAGS): Compute value automatically.
(BB_NEW, BB_REACHABLE, BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK,
BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION,
BB_DUPLICATED, BB_NON_LOCAL_GOTO_TARGET, BB_RTL,
BB_FORWARDER_BLOCK, BB_NONTHREADABLE_BLOCK, BB_MODIFIED, BB_VISITED,
BB_IN_TRANSACTION): Move to new file cfg-flags.h.
(enum bb_flags): Rename to cfg_bb_flags. Use cfg-flags.h.
(BB_ALL_FLAGS): New, compute value automatically.
(dump_bb_info): Update prototype.
(dump_edge_info): Update prototype.
* cfg-flags.h: New file.
* cfg.c (dump_edge_info): Take flags argument. Be verbose only if
TDF_DETAILS and not TDF_SLIM. Include cfg-flags.h for bitnames.
Check that the edge flags are within the range of EDGE_ALL_FLAGS.
(debug_bb): Update dump_bb call.
(dump_cfg_bb_info): Remove.
(dump_bb_info): New function. Use cfg-flags.h for bitnames.
Adjust verbosity using TDF_* flags. Check that the basic block flags
are within the range of BB_ALL_FLAGS.
(brief_dump_cfg): Use dump_bb_info instead of dump_cfg_bb_info.
* cfghooks.h (struct cfghooks): Update dump_bb hook, take a FILE
first for consistency with other dump functions.
(dump_bb): Update prototype accordingly.
* cfghooks.c: Include dumpfile.h.
(verify_flow_info): Update dump_edge_info calls.
(dump_bb): Take a flags argument and pass it around.
Use dump_bb_info to dump common information about a basic block.
(dump_flow_info): Moved here from cfgrtl.c. Make IL agnostic.
(debug_flow_info): Moved here from cfgrtl.c.
* profile.c (is_edge_inconsistent): Update dump_bb calls.
* loop-invariant.c (find_defs): Update print_rtl_with_bb call.
* rtl.h (debug_bb_n_slim, debug_bb_slim, print_rtl_slim,
print_rtl_slim_with_bb): Remove prototypes.
(dump_insn_slim): Adjust prototype to take a const_rtx.
(print_rtl_with_bb): Adjust prototype.
* sched-rgn.c (debug_region): Use dump_bb instead of debug_bb_n_slim.
* sched-vis.c (dump_insn_slim): Take a const_rtx.
(debug_insn_slim): Prototype here near DEBUG_FUNCTION marker.
(print_rtl_slim_with_bb): Remove.
(print_rtl_slim): Rename to debug_rtl_slim. Print only insn info,
not basic block info (print_rtl_with_bb with TDF_SLIM should be used
for that. Prototype here near DEBUG_FUNCTION marker.
(debug_bb_slim): Prototype here near DEBUG_FUNCTION marker.
Use dump_bb.
(debug_bb_n_slim): Prototype here near DEBUG_FUNCTION marker.
* tree-cfg.c (gimple_can_merge_blocks_p): Use EDGE_COMPLEX.
(remove_bb): Update dump_bb call.
(gimple_debug_bb): Use dump_bb.
(dump_function_to_file): Update gimple_dump_bb call.
(print_loops_bb): Likewise.
* tree-flow.h (gimple_dump_bb): Update prototype.
* gimple-pretty-print.c (dump_bb_header): Rename to
dump_gimple_bb_header. Write to a stream instead of a pretty
printer. Use dump_bb_info to dump basic block info.
(dump_bb_end): Rename to dump_gimple_bb_footer. Write to a
stream instead of a pretty printer. Use dump_bb_info.
(gimple_dump_bb_buff): Do not call dump_bb_header and dump_bb_end.
(gimple_dump_bb): Do it here with dump_gimple_bb_header and
dump_gimple_bb_footer.
* cfgrtl.c (rtl_dump_bb): Update prototype. Only dump DF if the
dump flags have TDF_DETAILS. Use dump_insn_slim if TDF_SLIM.
(print_rtl_with_bb): Take a flags argument and pass it around.
Use dump_insn_slim if TDF_SLIM.
(dump_bb_info): Removed and re-incarnated in cfg.c.
(dump_flow_info): Moved to cfghooks.c.
(debug_flow_info): Moved to cfghooks.c.
* passes.c (execute_function_dump): Unconditionally use
print_rtl_with_bb for RTL dumps, now that it understands TDF_SLIM.
* final.c (dump_basic_block_info): Update dump_edge_info calls.
* tree-vrp.c (dump_asserts_for): Likewise.
* ifcvt.c (if_convert): Unconditionally use print_rtl_with_bb.
* tree-if-conv.c (if_convertible_bb_p): Don't look at
EDGE_ABNORMAL_CALL, it has no meaning in the GIMPLE world.
* trans-mem.c (make_tm_edge): Don't set EDGE_ABNORMAL_CALL,
for the same reason.
* config/rl78/rl78.c (rl78_reorg): Update print_rtl_with_bb calls.
From-SVN: r189590
2012-07-17 Vincent Pucci <pucci@adacore.com>
* gnat_ugn.texi: GNAT dimensionality checking
documentation updated with System.Dim.Mks modifications.
2012-07-17 Ed Schonberg <schonberg@adacore.com>
* exp_ch3.adb: sloc of array init_proc is sloc of type declaration.
2012-07-17 Tristan Gingold <gingold@adacore.com>
* raise-gcc.c (get_call_site_action_for): Remove useless init
expression for p.
(get_action_description_for): Do not overwrite action->kind.
2012-07-17 Hristian Kirtchev <kirtchev@adacore.com>
* exp_attr.adb (Expand_N_Attribute_Reference): Add local variables Attr
and Conversion_Added. Add local constant Typ.
Retrieve the original attribute after the arithmetic check
machinery has modified the node. Add a conversion to the target
type when the prefix of attribute Max_Size_In_Storage_Elements
is a controlled type.
2012-07-17 Gary Dismukes <dismukes@adacore.com>
* exp_ch6.adb (Expand_Inlined_Call): For each actual parameter
of mode 'out' or 'in out' that denotes an entity, reset
Last_Assignment on the entity so that any assignments to the
corresponding formal in the inlining will not trigger spurious
warnings about overwriting assignments.
From-SVN: r189570
2012-07-17 Tristan Gingold <gingold@adacore.com>
* gnat_rm.texi: Adjust previous change.
2012-07-17 Ed Schonberg <schonberg@adacore.com>
* sem_prag.adb (Process_Import_Or_Interface): If the pragma
comes from an aspect, it applies to the corresponding entity
without further check.
2012-07-17 Olivier Hainque <hainque@adacore.com>
* initialize.c (__gnat_initialize for VxWorks): Remove section with
call to __gnat_vxw_setup_for_eh.
* system-vxworks-ppc.ads: Add -auto-register to -crtbe, relying
on the VxWorks constructor mechanism for network loaded modules
by default.
2012-07-17 Tristan Gingold <gingold@adacore.com>
* adaint.c: Minor reformatting.
2012-07-17 Pascal Obry <obry@adacore.com>
* s-regexp.adb (Adjust): Fix access violation in Adjust.
2012-07-17 Ed Schonberg <schonberg@adacore.com>
* freeze.adb (Freeze_Entity): Warn if an imported subprogram
has pre/post conditions, because these will not be enforced.
2012-07-17 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch7.adb (Process_Transient_Objects): Put all the
finalization blocks and the final raise statement into a wrapper
block.
2012-07-17 Vincent Pucci <pucci@adacore.com>
* s-atopri.adb (Lock_Free_Try_Write_X): Atomic_Compare_Exchange_X
replaced by Sync_Compare_And_Swap_X.
(Lock_Free_Try_Write_64): Removed.
* s-atopri.ads (Sync_Compare_And_Swap_X): Replaces previous
routine Atomic_Compare_Exchange_X.
(Lock_Free_Read_64): Renaming of Atomic_Load_64.
(Lock_Free_Try_Write_64): Renaming of Sync_Compare_And_Swap_64.
2012-07-17 Vincent Celier <celier@adacore.com>
* switch-m.adb (Normalize_Compiler_Switches): Recognize new
switches -gnatn1 and -gnatn2.
2012-07-17 Vincent Pucci <pucci@adacore.com>
* gnat_ugn.texi: GNAT dimensionality checking
documentation updated with System.Dim.Mks modifications.
2012-07-17 Ed Schonberg <schonberg@adacore.com>
* exp_ch3.adb: sloc of array init_proc is sloc of type declaration.
2012-07-17 Tristan Gingold <gingold@adacore.com>
* raise-gcc.c (get_call_site_action_for): Remove useless init
expression for p.
(get_action_description_for): Do not overwrite action->kind.
2012-07-17 Hristian Kirtchev <kirtchev@adacore.com>
* exp_attr.adb (Expand_N_Attribute_Reference): Add local variables Attr
and Conversion_Added. Add local constant Typ.
Retrieve the original attribute after the arithmetic check
machinery has modified the node. Add a conversion to the target
type when the prefix of attribute Max_Size_In_Storage_Elements
is a controlled type.
2012-07-17 Gary Dismukes <dismukes@adacore.com>
* exp_ch6.adb (Expand_Inlined_Call): For each actual parameter
of mode 'out' or 'in out' that denotes an entity, reset
Last_Assignment on the entity so that any assignments to the
corresponding formal in the inlining will not trigger spurious
warnings about overwriting assignments.
From-SVN: r189569
2012-07-17 Tristan Gingold <gingold@adacore.com>
* treepr.adb, treepr.ads: Revert previous patch, unneeded.
2012-07-17 Robert Dewar <dewar@adacore.com>
* s-assert.ads: Fix comments to make it clear that this is used
for all assertions, not just pragma Assert.
2012-07-17 Jerome Guitton <guitton@adacore.com>
* par_sco.ads: Minor typo fix.
2012-07-17 Gary Dismukes <dismukes@adacore.com>
* layout.adb (Layout_Type): In the case where the target is
AAMP, use 32 bits (a single pointer) rather than 64 bits for an
anonymous access-to-subprogram type if the type is library-level
and Is_Local_Anonymous_Access is True.
2012-07-17 Jose Ruiz <ruiz@adacore.com>
* s-tassta.adb, s-tarest.adb (Create_Task, Create_Restricted_Task,
Initialize): Add comments explaining that the CPU affinity value that
is passed to the run-time library can be either Unspecified_CPU, to
indicate that the task inherits the affinity of its activating task,
or a value in the range of CPU_Range but no greater than Number_Of_CPUs.
2012-07-17 Javier Miranda <miranda@adacore.com>
* exp_disp.adb (Make_DT): Remove decoration of Ada.Tags entities.
(Make_Tags): Add decoration of Ada.Tags entities.
2012-07-17 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (Check_Statement_Sequence): When locating the
last significant statement in a sequence, ignore iserted nodes
that typically come from expansion of controlled operations.
2012-07-17 Tristan Gingold <gingold@adacore.com>
* gnat_rm.texi: Document foreign exceptions.
From-SVN: r189568
2012-07-17 Robert Dewar <dewar@adacore.com>
* exp_ch9.adb: Minor code reorganization.
* exp_ch3.adb: Minor code improvement.
2012-07-17 Tristan Gingold <gingold@adacore.com>
* seh_init.c (__gnat_SEH_error_handler): Not compiled anymore
on Windows 64 (+ SEH), as it is unused.
2012-07-17 Tristan Gingold <gingold@adacore.com>
* treepr.ads (psloc): Declare.
* treepr.adb (psloc): New debug procedure to print a sloc.
(Print_Sloc): New procedure, from ...
(Print_Node_Subtree): ... this. Call Print_Sloc.
2012-07-17 Javier Miranda <miranda@adacore.com>
* sem_prag.adb (CPP_Class): Transform obsolescent pragma CPP_Class into
CPP convention automatically.
From-SVN: r189566
2012-07-17 Tobias Burnus <burnus@net-b.de>
PR fortran/52101
* decl.c (match_char_length): Extra argument, show obsolenscent
warning only if *length is used after the typename.
(variable_decl, gfc_match_char_spec): Update call
2012-07-17 Tobias Burnus <burnus@net-b.de>
PR fortran/52101
* gfortran.dg/oldstyle_4.f90: New.
From-SVN: r189565
* cp-tree.h (struct deferred_access_check): Add location.
* semantics.c (perform_access_checks): Use it.
(perform_or_defer_access_check): Store it.
From-SVN: r189552
2012-07-16 Thomas König <tkoenig@gcc.gnu.org>
PR fortran/53824
* resolve.c (resolve_allocate_deallocate): If both
start indices are NULL, skip the test for equality.
2012-07-16 Thomas König <tkoenig@gcc.gnu.org>
PR fortran/53824
* gfortran.dg/coarray_allocate_1.f90: New test.
From-SVN: r189549
2012-07-16 Andrew Pinski <apinski@cavium.com>
* gcc.c-torture/execute/bswap-1.c: New testcase.
* gcc.c-torture/compile/unalign-1.c: New testcase.
* gcc.c-torture/compile/20120524-1.c: New testcase.
* gcc.c-torture/compile/20101216-1.c: New testcase.
From-SVN: r189543
2012-07-16 Thomas Quinot <quinot@adacore.com>
* exp_ch9.adb (Ensure_Statement_Present): New subprogram.
(Expand_N_Asynchronous_Select,
Expand_N_Selective_Accept.Process_Accept_Alternative,
Expand_N_Selective_Accept.Process_Delay_Alternative,
Expand_N_Timed_Entry_Call): For an alternative with no trailing
statements, introduce a null statement to carry the sloc of
the initial special statement (accept, delay, or entry call)
in the alternative, for coverage analysis purposes.
2012-07-16 Thomas Quinot <quinot@adacore.com>
* sem_eval.adb (In_Subrange_Of): Fix typo in test for scalar
arguments.
From-SVN: r189535
2012-07-16 Robert Dewar <dewar@adacore.com>
* a-exexpr.adb, freeze.adb, a-exexpr-gcc.adb, a-except-2005.adb,
sem_eval.adb, s-fileio.adb: Minor reformatting.
2012-07-16 Javier Miranda <miranda@adacore.com>
* sem_prag.adb (Analyze_Pragma): Remove support for obsolescent
pragma CPP_Class.
* sem_ch13.adb (Analyze_Freeze_Entity): Add missing error on Ada
derivations of CPP types. Found updating the tests affected by
the removal of pragma CPP_Class.
2012-07-16 Thomas Quinot <quinot@adacore.com>
* back_end.adb: Minor reformatting.
2012-07-16 Thomas Quinot <quinot@adacore.com>
* exp_ch9.adb (Expand_N_Selective_Accept.Process_Accept_Alternative):
Remove junk test that was always true. For the case of no statements
following the ACCEPT, jump directly to End_Lab instead of
introducing an intermediate jump.
(Expand_N_Selective_Accept.Process_Delay_Alternative): Fix
predicate testing for presence of statements following the DELAY.
that was always true. For the case of no statements following
the ACCEPT, jump directly to End_Lab instead of introducing an
intermediate jump.
(Expand_N_Selective_Accept): Fix incorrect insertion point for
end label.
From-SVN: r189534
2012-07-16 Thomas Quinot <quinot@adacore.com>
* gnat_rm.texi: Minor documentation improvements.
2012-07-16 Yannick Moy <moy@adacore.com>
* sem_ch13.adb (Analyze_Aspect_Specifications): Allow Pre
and Pre'Class aspects on the same declaration.
* sem_prag.adb (Chain_PPC): Allow Pre and Pre'Class aspects on the
same hierarchy of primitive operations.
From-SVN: r189533
2012-07-16 Robert Dewar <dewar@adacore.com>
* freeze.adb, g-debpoo.adb, exp_ch3.adb: Minor reformatting.
2012-07-16 Thomas Quinot <quinot@adacore.com>
* s-oscons-tmplt.c: Add definitions of E2BIG and EILSEQ.
2012-07-16 Tristan Gingold <gingold@adacore.com>
* a-exexpr.adb (Propagate_Continue): New function replacing
Raise_Current_Excep.
(Allocate_Occurrence): New function.
(Propagate_Exception): Add Excep parameter, remove call to Call_Chain.
* a-exexpr-gcc.adb (GNAT_GCC_Exception): Occurrence component
is now aliased.
(To_GCC_Exception): Convert from Address.
(Allocate_Occurrence): Allocate an Unwind exception occurrence.
(Setup_Current_Excep): Fill the machine occurrence in case of
foreign exception.
(Propagate_Exception): Add Excep parameter, remove call to Call_Chain.
* a-except.adb (Set_Exception_C_Msg, Set_Exception_Msg): add
Excep parameter.
(Raise_Exception, Raise_Exception_Always,
Raise_Exception_No_Defer): Adjust calls to the above procedures.
(Raise_From_Signal_Handler, Raise_With_Location_And_Msg)
(Rcheck_PE_Finalize_Raised_Exception): Likewise.
* a-except-2005.adb (Set_Exception_C_Msg, Set_Exception_Msg):
add Excep parameter.
(Propagate_Exception): Likewise.
(Allocate_Occurrence): New function.
(Raise_Current_Excep): Removed.
(Complete_Occurrence): New function to save the call chain.
(Complete_And_Propagate_Occurrence): New procedure.
(Create_Occurrence_From_Signal_Handler): New function to build an
occurrence without propagating it.
(Create_Machine_Occurrence_From_Signal_Handler): Likewise, but
return the machine occurrence.
(Raise_From_Signal_Handler): Use Create_Occurrence_From_Signal_Handler.
(Raise_Exception, Raise_Exception_Always, Raise_Exception_No_Defer):
Adjust calls to the above procedures. Allocate the occurrence at
the beginning.
(Raise_With_Location_And_Msg, Raise_With_Msg)
(Rcheck_PE_Finalize_Raised_Exceptionm Reraise): Likewise.
(Reraise_Occurrence): Use Reraise_Occurrence_Always.
(Reraise_Occurrence_Always): Use Reraise_Occurrence_No_Defer.
(Reraise_Occurrence_No_Defer): Preserve machine occurrence.
(Save_Occurrence): Do not save machine occurrence.
* a-except-2005.ads (Exception_Occurrence): Add Machine_Occurrence
component.
(Null_Occurrence): Consider it.
* a-exexda.adb (Set_Exception_C_Msg, Set_Exception_Msg): add
Excep parameter.
2012-07-16 Tristan Gingold <gingold@adacore.com>
* seh_init.c (__gnat_map_SEH): New function extracted from
__gnat_SEH_error_handler.
* raise-gcc.c: __gnat_personality_seh0: Directly transforms
Windows system exception into GCC one when possible, in order
to save stack room (particularly useful when Storage_Error will
be propagated).
From-SVN: r189530