intrinsic.c (gfc_convert_type_warn): Propagate the input shape to the output expression.
* intrinsic.c (gfc_convert_type_warn): Propagate the input shape
to the output expression.
* iresolve.c (gfc_resolve_cshift, gfc_resolve_eoshift): Suppress
warning conversion.
(gfc_resolve_reshape): Force convert SHAPE and ORDER parameters
to index kind.
Zack Weinberg [Wed, 8 Dec 2004 19:13:35 +0000 (19:13 +0000)]
re PR middle-end/17982 (stop calling assemble_external before final assembly output time)
PR 17982
* varasm.c (pending_assemble_externals): New static.
(assemble_external_real): Meat of assemble_external split out
to this new function.
(process_pending_assemble_externals): New function.
(assemble_external): Use gcc_assert. If flag_unit_at_a_time
is true and the basic test passes, merely cons the decl onto
the pending list to be handled later.
* tree.h: Declare process_pending_assemble_externals.
* cgraphunit.c (cgraph_optimize): Call it.
* config/h8300/h8300.h: Do not define ASM_OUTPUT_EXTERNAL.
Arnaud Charlet [Wed, 8 Dec 2004 11:49:44 +0000 (12:49 +0100)]
g-socket.ads (Get_Host_By_Address, [...]): Clarify documentation of the behaviour of these functions when...
* g-socket.ads (Get_Host_By_Address, Get_Host_By_Name): Clarify
documentation of the behaviour of these functions when passed an IP
address that has no record in the system hosts database and no reverse
record in the DNS.
* make.adb: Minor reformatting
Add some ??? comments asking for more comments
* s-poosiz.adb: Minor reformatting
Add comments on alignment requirement
* sinfo.ads: Remove obsolete comment and fix typo.
* gnat_ugn.texi: Update the section "The GNAT Driver and Project
Files" with the new tool and package names.
Reformatting to suppress most of the warnings for line too long
Document the new section "Project Search Path:" in the output of
gnatls -v.
Add gnatmetric section
* vms_data.ads: Correct GNAT METRIC qualifiers: -I-, -Idir and
-gnatec= are not direct switches of gnatmetric. Changed -eis to -eps
and -eit to -ept. Added qualifier
/ELEMENT_METRICS=CONSTRUCT_NESTING_MAX for new switch -ec.
Arnaud Charlet [Wed, 8 Dec 2004 11:48:22 +0000 (12:48 +0100)]
sem_ch4.adb (Process_Implicit_Dereference_Prefix): New subprogram used to record an implicit dereference as a read operation on...
* sem_ch4.adb (Process_Implicit_Dereference_Prefix): New subprogram
used to record an implicit dereference as a read operation on its
prefix when operating under -gnatc. Necessary to avoid spurious
'variable assigned but never read' warnings in that mode.
(Process_Indexed_Component, Analyze_Selected_Component): When the prefix
is a non-overloaded implicit dereference, call the above subprogram to
ensure proper recording of references.
Arnaud Charlet [Wed, 8 Dec 2004 11:48:04 +0000 (12:48 +0100)]
nlists.adb (Prepend_Debug): Remove parameters and nest within Prepend.
* nlists.adb (Prepend_Debug): Remove parameters and nest within
Prepend.
(Remove_Next_Debug): Same fix
* nlists.ads: Correct bad comments for Prev and Prev_Non_Pragma (we do
maintain back pointers now, though we did not used to, and comments
were out of date).
(Prepend): Remove pragma Inline.
(Remove_Next): Same cleanup
Arnaud Charlet [Wed, 8 Dec 2004 11:47:21 +0000 (12:47 +0100)]
lib-xref.adb (Generate_Reference): Handle properly a reference to an entry formal...
* lib-xref.adb (Generate_Reference): Handle properly a reference to an
entry formal, when an accept statement has a pragma Unreferenced for it.
* sem_ch9.adb (Analyze_Accept_Statement): Reset the Is_Referenced flag
and the Has_Pragma_Unreferenced flag for each formal before analyzing
the body, to ensure that warnings are properly emitted for each accept
statement of a given task entry.
Arnaud Charlet [Wed, 8 Dec 2004 11:46:11 +0000 (12:46 +0100)]
exp_dist.adb (Specific_Build_General_Calling_Stubs, [...]): New subprograms.
* exp_dist.adb (Specific_Build_General_Calling_Stubs,
Specific_Build_Stub_Target): New subprograms.
(Build_Subprogram_Calling_Stubs): Make this procedure independent from
the PCS implementation used, using the above PCS-customized subprograms.
Minor reformatting.
(PolyORB_Support.Helpers): New subunit containing supporting subprograms
for generation of DSA code targeted to the PolyORB PCS.
(Add_Stub_Type): Rewrite to isolate the parts that are specific to one
implementation of the partition communication subsystem in ancillary
subprograms.
(Specific_Build_Stub_Type, GARLIC_Support.Build_Stub_Type,
PolyORB_Support.Build_Stub_Type): New subrograms containing the
PCS-specific part of Add_Stub_Type.
(Insert_Partition_Check): Use runtime library function to perform
E.4(19) check.
* rtsfind.ads: New entity System.PolyORB_Interface.Make_Ref
(RE_Same_Partition): New entity, from s-parint.
* s-parint.ads, s-parint.adb (Same_Partition): New subprogram.
Arnaud Charlet [Wed, 8 Dec 2004 11:27:00 +0000 (12:27 +0100)]
exp_ch6.adb (Expand_Call): Add comment on handling of back end intrinsic
* exp_ch6.adb (Expand_Call): Add comment on handling of back end
intrinsic
* exp_intr.adb (Expand_Intrinsic_Call): Ignore unrecognized intrinsic,
leaving call unchanged.
This deals with the case where the pragma Import specified
an external name, to be handled by the back end.
* sem_prag.adb (Process_Import_Or_Interface): Do not check validity of
subprogram which is Imported with convention Intrinsic if an
External_Name argument is specified.
(Process_Import_Or_Interface): Properly diagnose link name argument.
(Inlining_Not_Possible): New name for Cannot_Inline, to avoid confusion
with Sem_Ch6.Cannot_Inline.
(Process_Inline): Provide separate warning for inapplicable inline
pragma.
(Cannot_Inline): Reject subprograms that have an at_end handler, so that
treatment is uniform on different targets.
Arnaud Charlet [Wed, 8 Dec 2004 11:26:46 +0000 (12:26 +0100)]
exp_ch4.adb (Expand_N_Indexed_Component): For an indexed component with an implicit dereference as its prefix...
* exp_ch4.adb (Expand_N_Indexed_Component): For an indexed component
with an implicit dereference as its prefix, use
Insert_Explicit_Dereference instead of merely rewriting the prefix into
an explicit dereference. This ensures that a reference to the original
prefix is generated, if appropriate.
* sem_util.adb (Insert_Explicit_Dereference): When an implicit
dereference is rewritten to an explicit one, generate a reference to
the entity denoted by its prefix using the original prefix node, so
the dereference can be properly recorded as a read of the denoted
access value, if appropriate.
* sem_warn.adb (Output_Unreferenced_Messages): Do not abstain from
emitting 'assigned but never read' warning on a variable on the basis
that it has an access type.
(Check_References): Emit unreferenced warning when the scope is a
subprogram body.
Arnaud Charlet [Wed, 8 Dec 2004 11:26:20 +0000 (12:26 +0100)]
decl.c (maybe_pad_type): Use TYPE_SIZE_UNIT of the input type for TYPE_SIZE_UNIT of result type if...
* decl.c (maybe_pad_type): Use TYPE_SIZE_UNIT of the input type for
TYPE_SIZE_UNIT of result type if SIZE is not specified.
(make_aligning_type): Pass -1 as ADDRESSABLE to prevent the creation
of a bitfield, which we know is useless and causes trouble because of
alignment implications.
* utils.c (create_var_decl): Set DECL_COMMON again on targets without
BSS sections.
(process_attributes): Clear DECL_COMMON again when a section attribute
is present.
(finish_record_type): Independently track if RECORD_TYPE has SIZE and/or
SIZE_UNIT already set and use to compute final SIZE and SIZE_UNIT.
(create_field_decl): Special case ADDRESSABLE negative to mean
"no bitfield creation", to be used by make_aligning_type. Don't
restrict bitfield creation to !ADDRESSABLE any more, as some BLKmode
fields claimed addressable still have to be bitfields. Use
value_factor_p instead of a raw binop construction to check for the
position's alignment.
Arnaud Charlet [Wed, 8 Dec 2004 11:25:51 +0000 (12:25 +0100)]
make.adb (Check_Mains, [...]): Adapt to name changes in package Prj (Current_Spec_Suffix => Ada_Spec_Suffix...
* make.adb (Check_Mains, Switches_Of): Adapt to name changes in
package Prj (Current_Spec_Suffix => Ada_Spec_Suffix,
Current_Body_Suffix => Ada_Body_Suffix).
Take into account Externally_Built attribute.
* clean.adb (In_Extension_Chain): Always return False when one of the
parameter is No_Project.
(Clean_Project): Adapt to changes in package Prj (Lang_Ada =>
Ada_Language_Index).
(Gnatclean): Adapt to change in package Prj.Pars (no parameter
Process_Languages for procedure Parse).
* gnatcmd.adb (Carg_Switches): New table.
(GNATCmd): Put all switches following -cargs in the Carg_Switches table.
Adapt to name changes in package Prj (Current_Spec_Suffix =>
Ada_Spec_Suffix, Current_Body_Suffix => Ada_Body_Suffix).
* mlib-prj.adb: Adapt to changes in packages Prj and Prj.Com: type
Header_Num and function Hash are now declared in package Prj,
not Prj.Com.
* prj.adb (Suffix_Of): New function.
(Set (Suffix)): New procedure.
(Hash): One function moved from Prj.Com
(Is_Present, Language_Processing_Data_Of): New functions
(Set): Two new procedures
(Add_Language_Name, Display_Language_Name): New procedures
* prj.ads: (Suffix_Of): New function
(Set (Suffix)): New procedure
Add several types and tables for multi-language support.
(Header_Num): Type moved from Prj.Com
(Hash): Two functions moved from Prj.Com
(Is_Present, Language_Processing_Data_Of): New functions
(Set): Two new procedures
(Add_Language_Name, Display_Language_Name): New procedures
(Naming): Component name changes:
Current_Spec_Suffix => Ada_Spec_Suffix,
Current_Body_Suffix => Ada_Body_Suffix. Add new components:
Impl_Suffixes, Supp_Suffixes.
(Project_Data): New components: Externally_Built, Supp_Languages,
First_Language_Processing, Supp_Language_Processing, Default_Linker,
Default_Linker_Path.
* prj-attr.adb: Add new attributes Ada_Roots and Externally_Built and
new package Language_Processing with its attributes (Compiler_Driver,
Compiler_Kind, Dependency_Option, Compute_Dependency, Include_Option,
Binder_Driver, Default_Linker).
* prj-com.ads, prj-com.adb (Hash): Function moved to package Prj.
(Header_Num): Type moved to package Prj
* prj-env.adb: Adapt to name changes in package Prj
(Current_Spec_Suffix => Ada_Spec_Suffix,
Current_Body_Suffix => Ada_Body_Suffix).
* prj-ext.adb: Add the default project dir (<prefix>/log/gnat) by
default to the project path, except the "-" is one of the directories
in env var ADA_PROJECT_PATH.
(Current_Project_Path): Global variable, replacing Project_Path
that was in the body of Prj.Part.
(Project_Path): New function
(Set_Project_Path): New procedure
Initialize Current_Project_Path during elaboration of the package
Remove dependency on Prj.Com, no longer needed
* prj-ext.ads (Project_Path): New function
(Set_Project_Path): New procedure
* prj-nmsc.adb (Body_Suffix_Of): New function. Returns .<lang> when no
suffix is defined for language <lang>.
(Find_Sources, Record_Other_Sources): Use Body_Suffix_Of, instead of
accessing directly the components of Naming.
(Look_For_Sources): Use Set (Suffix) to set the suffix of a language.
Reorganise of this package.
Break procedure Check in several procedures.
* prj-nmsc.ads: Replace all procedures (Ada_Check,
Other_Languages_Check and Language_Independent_Check) with a single
procedure Check.
* prj-pars.ads, prj-pars.adb (Parse): Remove parameter
Process_Languages, no longer needed.
* prj-part.adb (Project_Path): Move to the body of Prj.Ext as
Current_Project_Path.
Remove elaboration code, moved to the body of Prj.Ext
Use new function Prj.Ext.Project_Path instead of old variable
Project_Path.
(Post_Parse_Context_Clause): Get Resolved_Path as a case-sensitive path.
When comparing with project paths on the stack, first put the resolved
path in canonical case.
(Parse_Single_Project): Set the path name of the project file in the
tree to the normalized path.
* prj-proc.ads, prj-proc.adb (Check, Recursive_Check, Process): Remove
parameter Process_Languages, no longer needed.
(Recursive_Check): Call Prj.Nmsc.Check, instead of Ada_Check and
Other_Languages_Check.
* prj-tree.ads (Project_Name_And_Node): New component Canonical_Path
to store the resolved canonical path of the project file.
Remove dependency to Prj.Com, no longer needed
* prj-util.adb: Adapt to name changes in package Prj
(Current_Spec_Suffix => Ada_Spec_Suffix, Current_Body_Suffix =>
Ada_Body_Suffix).
* snames.ads, snames.adb: New standard names: Ada_Roots, Binder_Driver,
Compiler_Driver, Compiler_Kind, Compute_Dependency, Default_Linker,
Externally_Built, Include_Option, Language_Processing.
* makegpr.adb: Numerous changes due to changes in packages
Prj and Prj.Nmsc.
* gnatls.adb: Add the default project dir (<prefix>/log/gnat) by
default to the project path, except whe "-" is one of the directories
in env var ADA_PROJECT_PATH.
(Gnatls): In verbose mode, add the new section "Project Search Path:"
Arnaud Charlet [Wed, 8 Dec 2004 11:24:50 +0000 (12:24 +0100)]
a-exexpr.adb (Others_Value, [...]): Change initial values from 16#BEEF# to 16#7FFF# to avoid exceeding Integer'Last...
* a-exexpr.adb (Others_Value, All_Others_Value): Change initial values
from 16#BEEF# to 16#7FFF# to avoid exceeding Integer'Last on 16-bit
targets (such as AAMP).
Uros Bizjak [Wed, 8 Dec 2004 06:50:58 +0000 (07:50 +0100)]
i386-protos.h (ix86_split_fp_branch): New rtx argument.
* config/i386/i386-protos.h (ix86_split_fp_branch): New rtx
argument.
* config/i386/i386.c (output_fp_compare): Fix is_sse condition.
Use EFLAGS_P only when fcomi insn should be used. Fix handling
of eflags_p variable. Change alt table accordingly. For non-fcomi
compare insn always use trailing fnstsw insn. Fix intmode
calculation for ficom insn.
(ix86_split_fp_branch): Add "rtx pushed" as new parameter. Call
ix86_free_from_memory when "pushed" is specified.
(ix86_expand_branch): Change call to ix86_split_fp_branch.
* config/i386/i386.md (*cmpfp_0_sf, *cmpfp_0_df, *cmpfp_0_xf):
Change eflags_p parameter in call to output_fp_compare.
(*cmpfp_2_sf, *cmpfp_2_df, *cmpfp_2_xf): Remove.
(*cmpfp_2_sf_1, *cmpfp_2_df_1, *cmpfp_2_xf_1): Rename to
*cmpfp_2_sf, *cmpfp_2_df, *cmpfp_2_xf. Change eflags_p
parameter in call to output_fp_compare.
(*cmpfp_2_u): Remove.
(*cmpfp_2_u_1): Rename to *cmpfp_2_u. Change eflags_p parameter
in call to output_fp_compare.
(*ficom_1): Remove insn definition and corresponding define_split.
(*cmpfp_si): New insn definition.
(*fp_jcc_8): New insn definition. Add new splitters for
"memory_operand" and "register_operand".
(define_split): Add new parameter in call to ix86_split_fp_branch.
config/i386/predicates.md (float_operator): New predicate.
Kazu Hirata [Wed, 8 Dec 2004 06:39:00 +0000 (06:39 +0000)]
c-common.c (verify_tree): Don't check code length if we know we are handling tcc_unary.
* c-common.c (verify_tree): Don't check code length if we know
we are handling tcc_unary.
* print_tree.c (print_node): Remove code to handle RTL
appearing as a part of a tree node.
* tree-gimple.c (recalculate_side_effects): Rename fro as len.
* tree.c (build1_stat): Don't check TREE_CODE_LENGTH.
(PROCESS_ARG): Don't refer to fro.
(build2_stat, build3_stat, build4_stat): Don't compute fro.
Roger Sayle [Wed, 8 Dec 2004 02:15:36 +0000 (02:15 +0000)]
re PR middle-end/18293 (Redundant copy operation introduced by expand)
PR middle-end/18293
* expmed.c (EXACT_POWER_OF_2_OR_ZERO_P): Move definition earlier.
(expand_mult): Special case powers of two to avoid synth_mult.
* loop.c (product_cheap_p): Handle case where expand_mult does
require/generate any instructions (i.e. multiplication by zero).
tree-pretty-print.c (dump_array_domain): Split out from dump_generic_node; fix off-by-one error on zero-based array bounds.
* tree-pretty-print.c (dump_array_domain): Split out from
dump_generic_node; fix off-by-one error on zero-based array bounds.
(dump_generic_node): Use it.
(print_declaration): Likewise.
Steve Ellcey [Wed, 8 Dec 2004 00:32:39 +0000 (00:32 +0000)]
io.h (open_external): Change prototype.
* io/io.h (open_external): Change prototype.
* io/unix.c (regular_file): Change prototype and set flags->action if
needed.
(open_external): Ditto.
* io/open.c (new_unit): Let open_external set flags->action.
Steven Bosscher [Wed, 8 Dec 2004 00:09:30 +0000 (00:09 +0000)]
re PR middle-end/17340 (Internal error compiling with -O3)
PR tree-optimization/17340
* tree-ssa-pre.c (compute_antic): Fix comment.
(compute_avail): Do not recurse, instead do a DFS using a stack
and a loop.
(execute_pre): Adjust.
Eric Botcazou [Tue, 7 Dec 2004 23:43:40 +0000 (00:43 +0100)]
configure.ac: Check for ieeefp.h.
* configure.ac: Check for ieeefp.h. Check for fabsf in libm.
* configure: Regenerate.
* config.h.in: Likewise.
* c99_protos.h: New file.
* libgfortran.h: Include c99_protos.h and conditionally ieeefp.h.
* intrinsics/c99_functions.c (fabsf): New function.
Zdenek Dvorak [Mon, 6 Dec 2004 20:22:01 +0000 (21:22 +0100)]
re PR tree-optimization/18601 (tree cfglceanup is slow)
PR tree-optimization/18601
* tree-cfg.c (thread_jumps, thread_jumps_from_bb): Removed.
(tree_forwarder_block_p): Do not consider blocks that are its own
successors forwarders.
(cleanup_forwarder_blocks, remove_forwarder_block): New functions.
(cleanup_tree_cfg): Use cleanup_forwarder_blocks instead of
thread_jumps.
* tree-flow.h (bb_ann_d): Remove forwardable.
Roger Sayle [Mon, 6 Dec 2004 17:24:16 +0000 (17:24 +0000)]
c-gimplify.c (gimplify_c_loop): Improve initial implementations for loops whose conditions are known at...
* c-gimplify.c (gimplify_c_loop): Improve initial implementations
for loops whose conditions are known at compile-time.
* gimplify.c (append_to_statement_list_1): Remove side_effects
parameter, this function should never be called if its false.
(append_to_statement_list): Only call append_to_statement_list_1
if t is non-NULL tree with side-effects.
(append_to_statement_list_force): Likewise, if t is not NULL.
J"orn Rennecke [Mon, 6 Dec 2004 16:07:57 +0000 (16:07 +0000)]
bt-load.c (btr_def_s): New member own_end;
* bt-load.c (btr_def_s): New member own_end;
(add_btr_to_live_range): Add second parameter. Changed caller.
(clear_btr_from_live_range): Clear btrs_live_at_end bit
for the register its definition basic block if own_end is set.
(augment_live_range): Also take btrs_live_at_end into account.
(combine_btr_defs): Don't bother with
other_def->other_btr_uses_after_use if it pertains to a different
register.
(move_btr_def): Set def->other_btr_uses_before_def after
calling combine_btr_defs."
* bt-load.c (augment_live_range): New argument full_range.
Changed all callers.
* bt-load.c (move_tr_def): Set other_tr_uses_before_def
taking new btr assignment into account.
Nick Clifton [Mon, 6 Dec 2004 10:57:43 +0000 (10:57 +0000)]
builtins-config.h: Use <sys/types.h> instead of <limits.h> because the latter comes from gcc's...
* gcc.dg/builtins-config.h: Use <sys/types.h> instead of <limits.h> because the
latter comes from gcc's include/ directory and not the newlib/libc/include
directory.