Tom de Vries [Wed, 28 Oct 2015 15:09:12 +0000 (15:09 +0000)]
Improve alias dump info
2015-10-28 Tom de Vries <tom@codesourcery.com>
* tree-ssa-structalias.c (new_var_info, make_heapvar)
(make_constraint_from_restrict, make_constraint_from_global_restrict)
(create_function_info_for, create_variable_info_for_1)
(create_variable_info_for): Add and handle add_id parameter.
(get_call_vi, new_scalar_tmp_constraint_exp, handle_rhs_call)
(init_base_vars): Add extra argument to calls to new_var_info.
(get_vi_for_tree): Add extra argument to call to
create_variable_info_for.
(process_constraint, do_deref, process_all_all_constraints): Add extra
argument to calls to new_scalar_tmp_constraint_exp.
(handle_lhs_call, find_func_aliases_for_builtin_call): Add extra
argument to calls to make_heapvar.
(make_restrict_var_constraints): Add extra argument to call to
make_constraint_from_global_restrict.
(intra_create_variable_infos): Add extra argument to call to
create_variable_info_for_1.
(ipa_pta_execute): Add extra argument to call to
create_function_info_for.
* gcc.dg/tree-ssa/pta-callused.c: Update to scan for CALLUSED(id).
Richard Biener [Wed, 28 Oct 2015 10:09:37 +0000 (10:09 +0000)]
re PR middle-end/65962 (Missed vectorization of strided stores)
2015-10-28 Richard Biener <rguenther@suse.de>
PR tree-optimization/65962
* tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
Avoid creating loop carried dependences also for outer loops
of the loop a use to replace is in.
Richard Biener [Wed, 28 Oct 2015 10:01:23 +0000 (10:01 +0000)]
re PR middle-end/68067 (Wrong constant folding)
2015-10-28 Richard Biener <rguenther@suse.de>
PR middle-end/68067
* fold-const.c (negate_expr_p): We cannot negate plus or minus
if overflow is not wrapping. Likewise multiplication unless
one operand is constant and not power of two.
(fold_negate_expr): Adjust accordingly.
* gcc.dg/torture/pr68067-1.c: New testcase.
* gcc.dg/torture/pr68067-2.c: Likewise.
gcc/testsuite/
* gcc.target/powerpc/vsx-builtin-2.c: Allow vmadd and vnmsub as well
as xvmadd and xvnmsub.
* gcc.target/powerpc/vsx-vector-2.c: Allow vmadd as well as xvmadd.
* lto.c (unify_scc): Use flag_checking and remove ENABLE_CHECKING
conditionals.
(lto_fixup_state): Likewise.
(do_whole_program_analysis): Use
symtab_node::checking_verify_symtab_nodes and remove ENABLE_CHECKING
conditionals.
re PR rtl-optimization/67609 (Generates wrong code for SSE2 _mm_load_pd)
PR rtl-opt/67609
* config/i386/i386.c (ix86_cannot_change_mode_class): Disallow
narrowing subregs on SSE and MMX registers.
* doc/tm.texi.in (CANNOT_CHANGE_MODE_CLASS): Clarify when subregs that
appear to be sub-words of multi-register pseudos must be rejected.
* doc/tm.texi: Regenerate.
testsuite/
* gcc.target/i386/pr67609-2.c: New test.
Kyrylo Tkachov [Tue, 27 Oct 2015 18:32:37 +0000 (18:32 +0000)]
[AArch64] PR 68102: Check that operand is REG before checking the REGNO in mov-immediate splitters
PR target/68102
* config/aarch64/aarch64.md (*movsi_aarch64): Check that
operands[0] is a reg before taking its REGNO in split condition.
(*movdi_aarch64): Likewise.
Use isl_schedule_node instead of isl_band_list for isl-0.15.
Passes regtest and bootstrap for isl-0.15 and isl-0.12.2 on x86_64-linux.
gcc/ChangeLog:
* graphite-optimize-isl.c (get_schedule_for_node_st): New callback
function to schedule based on isl_schedule_node.
(get_schedule_map_st): New schedule optimizer based on isl_schedule_node.
(scop_get_domains): New. Return the isl_union_set containing the domains of all the pbbs.
(optimize_isl): Call the new function get_schedule_map_st for isl-0.15
H.J. Lu [Tue, 27 Oct 2015 14:29:31 +0000 (14:29 +0000)]
Properly handle -fno-plt in ix86_expand_call
prepare_call_address in calls.c is the wrong place to handle -fno-plt.
We shoudn't force function address into register and hope that load
function address via GOT and indirect call via register will be folded
into indirect call via GOT, which doesn't always happen. Also non-PIC
case can only be handled in backend. Instead, backend should expand
external function call into indirect call via GOT for -fno-plt.
This patch reverts -fno-plt in prepare_call_address and handles it in
ix86_expand_call. Other backends may need similar changes to support
-fno-plt. Alternately, we can introduce a target hook to indicate
whether an external function should be called via register for -fno-plt
so that i386 backend can disable it in prepare_call_address.
gcc/
PR target/67215
* calls.c (prepare_call_address): Don't handle -fno-plt here.
* config/i386/i386.c (ix86_expand_call): Generate indirect call
via GOT for -fno-plt. Support indirect call via GOT for x32.
* config/i386/predicates.md (sibcall_memory_operand): Allow
GOT memory operand.
fold_builtin_logb and fold_builtin_significand now only handle
constant arguments, so this patch renames them to fold_const...,
to match fold_const_builtin_pow. The idea is to differentiate
constant-only folds so that they can be moved to a const_binop-like
function in future.
The functions also had some unnecessary calls to STRIP_NOPS, which
I think are left over from code that has already moved to match.pd.
Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.
Evandro Menezes [Tue, 27 Oct 2015 11:57:01 +0000 (11:57 +0000)]
[PATCH] [AArch64] Distinct costs for sign and zero extension
gcc/
* config/aarch64/aarch64-protos.h (cpu_addrcost_table): Split member
for register extension into sign and zero register extension.
* config/aarch64/aarch64.c (generic_addrcost_table): Infer values
for sign and zero register extension.
(cortexa57_addrcost_table): Likewise.
(xgene1_addrcost_table): Likewise.
Remove constant handling from fold_builtin_{,f}abs
fold_builtin_fabs and fold_builtin_abs had code to handle constant
arguments, but this simply duplicated what the following fold_build1_loc
would do for ABS_EXPR.
Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.
gcc/
* builtins.c (fold_builtin_fabs): Remove constant handling.
(fold_builtin_abs): Likewise.
Arnaud Charlet [Tue, 27 Oct 2015 11:53:08 +0000 (12:53 +0100)]
[multiple changes]
2015-10-27 Ed Schonberg <schonberg@adacore.com>
* sem_ch4.adb (Analyze_Allocator): Do not perform legality check
on allocators for limited objects in a qualified expression,
because expression has not been resolved.
* sem_res.adb (Resolve_Allocator): Perform check on legality of
limited objects after resolution. Add sem_ch3.adb to context.
* sem_prag.adb (Analyze_Refined_Global_In_Decl_Part): Add variable
States.
(Check_Refined_Global_Item): An object or state acts as a
constituent only when the corresponding encapsulating state
appears in pragma Global.
(Collect_Global_Item): Add a state with non-null visible refinement to
list States.
2015-10-27 Gary Dismukes <dismukes@adacore.com>
* sem_util.ads, par.adb, sem_ch6.adb: Minor reformatting and a few
typo corrections.
2015-10-27 Pierre-Marie de Rodat <derodat@adacore.com>
* namet.ads, namet.adb (Name_Equals): New function.
* namet.h (Name_Equals): New macro.
2015-10-27 Arnaud Charlet <charlet@adacore.com>
* exp_ch6.adb (Build_Procedure_Form): Use 'RESULT' for the extra
parameter, to avoid ambiguity when generating tmps using _xxx which
might end up reusing _result.
Arnaud Charlet [Tue, 27 Oct 2015 11:50:29 +0000 (12:50 +0100)]
[multiple changes]
2015-10-27 Javier Miranda <miranda@adacore.com>
* sem_util.ads, sem_util.adb (Defining_Identifier): Adding a formal to
indicate the needed behavior in case of nodes with errors.
2015-10-27 Ed Schonberg <schonberg@adacore.com>
* sem_attr.adb (Eval_Attribute): If the prefix of attribute
Enum_Rep is an object that is a generated loop variable for an
element iterator, no folding is possible.
* sem_res.adb (Resolve_Entity_Name): Do not check for a missing
initialization in the case of a constant that is an object
renaming.
* exp_attr.adb (Expand_N_Attribute_Reference, case Enum_Rep):
If the prefix is a constant that renames an expression there is
nothing to evaluate statically.
2015-10-27 Vincent Celier <celier@adacore.com>
* gnatlink.adb: Always delete the response file, even when the
invocation of gcc to link failed.
* sem_ch6.adb (Analyze_Subprogram_Body_Helper):
Do not inherit the SPARK_Mode from the context if it has been
set already.
(Build_Subprogram_Declaration): Relocate relevant
pragmas from the subprogram body to the generated corresponding
spec. Do not copy aspect SPARK_Mode as this leads to circularity
in Copy_Separate_Tree. Inherit the attributes that describe
pragmas Ghost and SPARK_Mode.
(Move_Pragmas): New routine.
* inline.adb (Is_Expression_Function): Removed.
* sem_ch6.adb (Analyze_Subprogram_Body_Helper): An internally
generated subprogram body that completes an expression function
inherits the SPARK_Mode from the spec.
* sem_res.adb (Resolve_Call): Update all calls to
Is_Expression_Function.
* sem_util.ads, sem_util.adb (Is_Expression_Function): Reimplemented.
(Is_Expression_Function_Or_Completion): New routine.
Arnaud Charlet [Tue, 27 Oct 2015 11:21:23 +0000 (12:21 +0100)]
[multiple changes]
2015-10-27 Yannick Moy <moy@adacore.com>
* lib-xref-spark_specific.adb
(Enclosing_Subprogram_Or_Library_Package): detect library-level
subprograms and handle entries as subprograms, i.e. now both
library-level subprograms and entry bodies act as enclosing
scopes.
(Traverse_Declarations_Or_Statements): process entry bodies just
like subprogram bodies.
* lib-xref.ads (Enclosing_Subprogram_Or_Library_Package): comment
simplified while keeping its the meaning and minor typo fixed
("of" -> "or").
* spark_xrefs.ads (Xref Section): fix in description of the ALI
line for subprogram calls; such lines start with captial "F"
followed by a space.
2015-10-27 Ed Schonberg <schonberg@adacore.com>
* sem_ch8.adb (Find_Direct_Name): A parameter association is
a legal context for applying an implicit dereference.
(Analyze_Expanded_Name): Minor code cleanup.
Arnaud Charlet [Tue, 27 Oct 2015 11:15:27 +0000 (12:15 +0100)]
[multiple changes]
2015-10-27 Pascal Obry <obry@adacore.com>
* a-dirval-mingw.adb: Remove some characters from Invalid_Character set.
2015-10-27 Ed Schonberg <schonberg@adacore.com>
* exp_ch6.adb (Rewrite_Function_Call_For_C): Use a named
associaion for the added actual in the call because previous
actuals may also have been given by explicit associations.
* lib-xref.adb: Minor style fixes.
* sem_ch12.adb (Analyze_Formal_Package_Declaration): Code cleanup. Set
and restore the value of global flag Ignore_Pragma_SPARK_Mode. A
formal package declaration acts as a package instantation with
respect to SPARK_Mode legality.
* sem_prag.adb (Check_Constituent_Usage): Use
logical operators rather than short circuit operators. Emit an
error when a state with visible refinement is not refined.
* snames.ads-tmpl: Add names for detecting
predefined potentially blocking subprograms.
2015-10-27 Arnaud Charlet <charlet@adacore.com>
* exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Revert previous
change.
(Expand_Array_Aggregate): Rewrite previous change here
as done for other non GCC back-ends.
(Build_Record_Aggr_Code): Add special case.
An upcoming patch adds a fold from hypot(x,x) to fabs(x)*sqrt(2).
This is unusual in that it could trigger in the gimplifier but would
require new SSA names to be created. This patch makes sure that we
use the usual:
if (gimple_in_ssa_p (cfun))
res = make_ssa_name (type);
else
res = create_tmp_reg (type);
formula to cope with cases where we're not yet in SSA form.
Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.
gcc/
* gimple-match-head.c (maybe_push_res_to_seq): Use create_tmp_reg
instead of make_ssa_name if not yet in SSA form.
Richard Biener [Tue, 27 Oct 2015 08:56:03 +0000 (08:56 +0000)]
cfg.c (free_edge): Add function argument and use it instead of cfun.
2015-10-27 Richard Biener <rguenther@suse.de>
* cfg.c (free_edge): Add function argument and use it instead of cfun.
(clear_edges): Likewise.
* cfg.h (clear_edges): Adjust prototype.
* cfgexpand.c (pass_expand::execute): Adjust.
* cfgloop.c (release_recorded_exits): Add function argument and use
it instead of cfun.
* cfgloop.h (release_recorded_exits): Adjust prototype.
(loops_state_satisfies_p): Add overload with function argument.
(loops_state_set): Likewise.
(loops_state_clear): Likewise.
(struct loop_iterator): Add function argument to constructor
and iterator and use it instead of cfun.
(FOR_EACH_LOOP_FN): New macro.
(loop_optimizer_finalize): Add overload with function argument.
* loop-init.c (loop_optimizer_init): Adjust.
(fix_loop_structure): Likewise.
(loop_optimizer_finaliz): Add function argument and use it
instead of cfun.
* tree-cfg.c (delete_tree_cfg_annotations): Likewise.
* tree-cfg.h (delete_tree_cfg_annotations): Adjust prototype.
* cgraph.c (release_function_body): Do not push/pop cfun.
* final.c (rest_of_clean_state): Adjust.
* graphite.c (graphite_finalize): Likewise.
* tree-ssa-copy.c (fini_copy_prop): Likewise.
* tree-ssa-dce.c (perform_tree_ssa_dce): Likewise.
* tree-ssa-loop-ivcanon.c (canonicalize_induction_variables): Likewise.
(tree_unroll_loops_completely): Likewise.
(pass_complete_unrolli::execute): Likewise.
* tree-ssa-loop-niter.c (free_numbers_of_iterations_estimates):
Add function argument and use it instead of cfun.
* tree-ssa-loop-niter.h (free_numbers_of_iterations_estimates):
Adjust prototype.
* tree-ssa-loop.c (tree_ssa_loop_done): Adjust.
* tree-ssa.c (delete_tree_ssa): Add function argument and use it
instead of cfun.
* tree-ssa.h (delete_tree_ssa): Adjust prototype.
* tree-ssanames.c (fini_ssanames): Add function argument and use it
instead of cfun.
* tree-ssanames.c (fini_ssanames): Adjust prototype.
* tree-vrp.c (execute_vrp): Adjust.
* value-prof.c (free_histograms): Add function argument and use it
instead of cfun.
* value-prof.h (free_histograms): Adjust prototype.
Bin Cheng [Tue, 27 Oct 2015 05:26:27 +0000 (05:26 +0000)]
loop-invariant.c (struct def): New field can_prop_to_addr_uses.
* loop-invariant.c (struct def): New field can_prop_to_addr_uses.
(inv_can_prop_to_addr_use): New function.
(record_use): Call can_prop_to_addr_uses, set the new field.
(get_inv_cost): Count cost if inv can't be propagated into its
address uses.
Louis Krupp [Mon, 26 Oct 2015 19:18:08 +0000 (19:18 +0000)]
re PR fortran/66056 (ICEs and endless compilation for lonely labels/numbers in type)
2015-10-26 Louis Krupp <louis.krupp@zoho.com>
PR fortran/66056
* fortran.h: Include namespace pointer in statement label
structure.
* symbol.c (gfc_get_st_label): Store pointer to namespace
that owns the statement label tree in each label.
(gfc_free_st_label): Use namespace owning statement label
tree when deleting statement label.
* io.c: Initialize format_asterisk with NULL namespace pointer.
2015-10-26 Louis Krupp <louis.krupp@zoho.com>
PR fortran/66056
* gfortran.dg/empty_label_typedecl.f90: New test
Mike Frysinger [Mon, 26 Oct 2015 18:32:41 +0000 (18:32 +0000)]
libjava: fix locale handling when sorting JNI methods
When building under LANG=cs_CZ.UTF-8, the JNI method check fails:
/bin/bash ../../scripts/check_jni_methods.sh
Found a problem with the JNI methods declared and implemented.
(<) missing in implementation, (>) missing in header files
> Java_gnu_java_awt_peer_gtk_GtkClipboard_advertiseContent
> Java_gnu_java_awt_peer_gtk_GtkClipboard_initNativeState
... lots more ...
While the sed commands are run under LC_ALL=C, the two sort commands are
not, and they end up producing unexpected output (for the test). Once we
run both under LC_ALL=C, the check passes. While we're here, we can also
combine latter the `sort|uniq` into `sort -u` to match the earlier code.
URL: https://bugs.gentoo.org/563710 Reported-by: Miroslav Ć ulc <fordfrog@gentoo.org>
From-SVN: r229388
* sem_prag.adb (Add_Item_To_Name_Buffer): Update the comment on usage.
Add an output string for loop parameters.
(Analyze_Global_Items): Loop parameters are now a
valid global item. The share the legality checks of constants.
(Analyze_Input_Output): Loop parameters are now a valid dependency item.
(Find_Role): Loop parameters share the role of constants.
2015-10-26 Ed Schonberg <schonberg@adacore.com>
* sem_res.adb (Resolve_Generalized_Indexing): In ASIS mode,
preserve the Generalized_ indexing link if the context is not
a spec expression that will be analyzed anew.
2015-10-26 Javier Miranda <miranda@adacore.com>
* exp_ch6.ads, exp_ch6.adb (Build_Procedure_Body_Form): Promote it to
library level (to invoke this routine from the semantic analyzer).
* sem_ch6.adb (Analyze_Subprogram_Body_Helper): When generating
C code, invoke Build_Procedure_Body_Form to transform a function
that returns a constrained array type into a procedure with an
out parameter that carries the return value.
2015-10-26 Arnaud Charlet <charlet@adacore.com>
* a-reatim.ads: Add "Clock_Time with Synchronous" contract in package
Ada.Real_Time.
* a-taside.ads: Add "Tasking_State with Synchronous" contract in
package Ada.Task_Identification.
* sem_ch12.adb: minor typo in comment
* contracts.adb (Analyze_Object_Contract): Set and restore
the SPARK_Mode for both constants and objects. Factor out the
semantic checks concerning Ghost objects.
* freeze.adb (Freeze_Array_Type): A Ghost array type cannot have a
concurrent component type.
(Freeze_Entity): A Ghost type cannot also be concurrent.
(Freeze_Record_Type): A Ghost record type cannot have a concurrent
component.
* sem_prag.adb (Analyze_Abstract_State): A Ghost abstract
state cannot also be synchronized.
(Check_Ghost_Synchronous): New routine.
* sem_util.adb (Yields_Synchronized_Object): Correct the case
of record components to account for the case where the type has
no component list.
Jeff Law [Mon, 26 Oct 2015 15:36:04 +0000 (09:36 -0600)]
[PATCH] [PR tree-optimization/68013] Make sure first block in FSM path
is in VISITED_BBs
PR tree-optimization/68013
* tree-ssa-threadbackward.c
(fsm_find_control_statement_thread_paths): Make sure the first block
in the path is in VISITED_BBs.
PR tree-optimization/68013
* gcc.c-torture/compile/pr68013.c: New test.