Michael Meissner [Fri, 24 Apr 2015 17:24:05 +0000 (17:24 +0000)]
re PR target/65849 (Add missing tuning knobs to #pragma target/attribute target support)
[gcc]
2015-04-24 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/65849
* config/rs6000/rs6000.opt (-mvsx-align-128): Make options that
save to independent variables use the Save attribute. This will
allow these options to be modified with the #pragma/attribute
target support.
(-mallow-movmisalign): Likewise.
(-mallow-df-permute): Likewise.
(-msched-groups): Likewise.
(-malways-hint): Likewise.
(-malign-branch-targets): Likewise.
(-mvectorize-builtins): Likewise.
(-msave-toc-indirect): Likewise.
* config/rs6000/rs6000.c (rs6000_opt_masks): Add more options that
can be set via the #pragma/attribute target support.
(rs6000_opt_vars): Likewise.
(rs6000_inner_target_options): If VSX was set, also set
-mno-avoid-indexed-addresses.
[gcc/testsuite]
2015-04-24 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/65849
* gcc.target/powerpc/pr65849-1.c: New test to verify being able to
set new options.
* gcc.target/powerpc/pr65849-2.c: Likewise.
[AArch64] Implement -m{cpu,tune,arch}=native using only /proc/cpuinfo
* config.host (case ${host}): Add aarch64*-*-linux case.
* config/aarch64/aarch64-cores.def: Add IMPLEMENTER_ID and PART_NUMBER
fields to all the cores.
* config/aarch64/aarch64-elf.h (DRIVER_SELF_SPECS):
Add MCPU_MTUNE_NATIVE_SPECS.
* config/aarch64/aarch64-option-extensions.def: Add FEATURE_STRING
field to all extensions.
* config/aarch64/aarch64-opts.h: Adjust definition of AARCH64_CORE.
* config/aarch64/aarch64.c: Adjust definition of AARCH64_CORE.
Adjust definition of AARCH64_OPT_EXTENSION.
* config/aarch64/aarch64.h: Adjust definition of AARCH64_CORE.
(MCPU_MTUNE_NATIVE_SPECS): Define.
* config/aarch64/driver-aarch64.c: New file.
* config/aarch64/x-arch64: New file.
* doc/invoke.texi (AArch64 Options): Document native value for -mcpu,
-mtune and -march.
Tom de Vries [Fri, 24 Apr 2015 14:18:57 +0000 (14:18 +0000)]
Replace g++.dg/pr65802.C with gcc.dg/pr65802.c
2015-04-24 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/65802
* g++.dg/pr65802.C: Move to ...
* gcc.dg/pr65802.c: ... here. Add -fexceptions to dg-options. Include
stdarg.h. Rewrite for C.
(fn1): Use va_list and va_arg. Make variable args function. Add use of
va_start and va_end. Remove unnecessary inline asm.
sse.md (*vec_concatv2sf_sse4_1): Do not allow both input operands in memory.
* config/i386/sse.md (*vec_concatv2sf_sse4_1): Do not allow both
input operands in memory.
(*vec_concatv2si_sse4_1): Ditto.
(*vec_concatv2df): Ditto, except for SSE3 and equal input operands.
(vec_extract_lo_<mode><mask_name>): Change operand 1 predicate to
register_operand.
(vec_extract_hi_v32hi): Ditto.
(vec_extract_hi_v64hi): Ditto.
(<mask_codefor>avx512f_unpckhpd512<mask_name>): Ditto.
re PR rtl-optimization/34503 (Issues with constant/copy propagation implementation in gcse.c)
2015-04-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
Steven Bosscher <steven@gcc.gnu.org>
gcc/
PR rtl-optimization/34503
* cprop.c (cprop_reg_p): New.
(hash_scan_set): Use above function to check if register can be
propagated.
(find_avail_set): Return up to two sets, one whose source is a
register and one whose source is a constant. Sets are returned in an
array passed as parameter rather than as a return value.
(cprop_insn): Use a do while loop rather than a goto. Try each of the
sets returned by find_avail_set, starting with the one whose source is
a constant. Use cprop_reg_p to check if register can be propagated.
(do_local_cprop): Use cprop_reg_p to check if register can be
propagated.
(implicit_set_cond_p): Likewise.
gcc/testsuite/
PR rtl-optimization/34503
* gcc.target/arm/pr64616.c: New file.
Co-Authored-By: Steven Bosscher <steven@gcc.gnu.org>
From-SVN: r222398
* ipa-icf.c (sem_function::equals_wpa): Compare thunk info.
(sem_function::equals): IGNORED_NODES parameter is now unused;
update call of equals_private.
(sem_function::equals_private): Do not call equals_wpa; skip
gimple body matching if there is no body.
(sem_function::init): Add logic to hash tthunk info.
(sem_function::parse): Also parse thunks.
* ipa-icf.h (equals_private): Update declaration.
Bill Schmidt [Thu, 23 Apr 2015 20:18:10 +0000 (20:18 +0000)]
altivec.md (*altivec_lvx_<mode>_internal): Remove asterisk from name so this can be generated directly.
2015-04-23 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* config/rs6000/altivec.md (*altivec_lvx_<mode>_internal): Remove
asterisk from name so this can be generated directly.
(*altivec_stvx_<mode>_internal): Likewise.
* config/rs6000/rs6000.c (rs6000_emit_le_vsx_store): Add assert
that this is never called during or after reload/lra.
(rs6000_frame_related): Remove split_reg
argument and logic that references it.
(emit_frame_save): Remove last parameter from call to
rs6000_frame_related.
(rs6000_emit_prologue): Remove last parameter from eight calls to
rs6000_frame_related. Force generation of stvx instruction for
Altivec register saves. Remove split_reg handling, which is no
longer needed.
(rs6000_emit_epilogue): Force generation of lvx instruction for
Altivec register restores.
Jason Merrill [Thu, 23 Apr 2015 15:55:11 +0000 (11:55 -0400)]
re PR c++/65646 (ICE in invalid syntax)
PR c++/65646
* pt.c (check_explicit_specialization): Don't
SET_DECL_TEMPLATE_SPECIALIZATION for a variable with no template
headers.
* decl.c (grokvardecl): Revert earlier fix.
Jan Hubicka [Thu, 23 Apr 2015 15:25:26 +0000 (17:25 +0200)]
ipa-icf.c (sem_item::compare_attributes): New function.
* ipa-icf.c (sem_item::compare_attributes): New function.
(sem_item::compare_referenced_symbol_properties): Compare variable
attributes.
(sem_item::hash_referenced_symbol_properties): Record DECL_ALIGN.
(sem_function::param_used_p): New function.
(sem_function::equals_wpa): Fix attribute comparsion; match
parameter type codes; do not compare paremter flags when
they are not used; compare edge flags; compare indirect calls.
(sem_item::update_hash_by_addr_refs): Hash reference type.
(sem_function::equals_private): Do not match DECL_ATTRIBUTES.
(sem_variable::equals_wpa): Do not match DECL_ALIGN; match
reference use type.
(sem_item_optimizer::update_hash_by_addr_refs): Use param_used_p.
* ipa-icf.h (compare_attributes, param_used_p): Declare.
* ipa-icf.c (symbol_compare_collection::symbol_compare_collection):
cleanup.
(sem_function::get_hash): Do not hash DECL_DISREGARD_INLINE_LIMITS,
DECL_DECLARED_INLINE_P and DECL_IS_OPERATOR_NEW.
(sem_item::compare_referenced_symbol_properties): New.
(sem_item::hash_referenced_symbol_properties): New.
(sem_item::compare_cgraph_references): Rename to ...
(sem_item::compare_symbol_references): ... this one; use
compare_referenced_symbol_properties.
(sem_function::equals_wpa): Do not compare
DECL_DISREGARD_INLINE_LIMITS, DECL_DECLARED_INLINE_P,
DECL_IS_OPERATOR_NEW; compare pointer sizes.
(sem_item::update_hash_by_addr_refs): Call
hash_referenced_symbol_properties.
(sem_item::update_hash_by_local_refs): Cleanup.
(sem_function::merge): Do not mix up symbol properties.
(sem_variable::equals_wpa): Use compare_symbol_references.
* ipa-icf.h (sem_item::compare_referenced_symbol_properties): New.
(sem_item::hash_referenced_symbol_properties): New.
(sem_item::compare_symbol_references): New.
(sem_item::compare_cgraph_references): Remove.
Marek Polacek [Thu, 23 Apr 2015 14:35:12 +0000 (14:35 +0000)]
re PR c/65345 (ICE with _Generic selection on _Atomic int)
PR c/65345
* c-decl.c (set_labels_context_r): New function.
(store_parm_decls): Call it via walk_tree_without_duplicates.
* c-typeck.c (convert_lvalue_to_rvalue): Use create_tmp_var_raw
instead of create_tmp_var. Build TARGET_EXPR instead of
COMPOUND_EXPR.
(build_atomic_assign): Use create_tmp_var_raw instead of
create_tmp_var. Build TARGET_EXPRs instead of MODIFY_EXPR.
* gcc.dg/pr65345-1.c: New test.
* gcc.dg/pr65345-2.c: New test.
PF fortran/60322
* gfortran.dg/class_allocate_19.f03: New test.
* gfortran.dg/class_array_20.f03: New test.
* gfortran.dg/class_array_21.f03: New test.
* gfortran.dg/finalize_10.f90: Corrected scan-trees.
* gfortran.dg/finalize_15.f90: Fixing comparision to model
initialization correctly.
* gfortran.dg/finalize_29.f08: New test.
gcc/fortran/ChangeLog:
2015-04-23 Andre Vehreschild <vehre@gmx.de>
PR fortran/60322
* expr.c (gfc_lval_expr_from_sym): Code to select the regular
or class array added.
* gfortran.h: Add IS_CLASS_ARRAY macro.
* trans-array.c (gfc_add_loop_ss_code): Treat class objects
to be referenced always.
(build_class_array_ref): Adapt retrieval of array descriptor.
(build_array_ref): Likewise.
(gfc_conv_array_ref): Hand the vptr or the descriptor to
build_array_ref depending whether the sym is class or not.
(gfc_trans_array_cobounds): Select correct gfc_array_spec for
regular and class arrays.
(gfc_trans_array_bounds): Likewise.
(gfc_trans_dummy_array_bias): Likewise.
(gfc_get_dataptr_offset): Correcting call of build_array_ref.
(gfc_conv_expr_descriptor): Set the array's offset to -1 when
lbound in inner most dim is 1 and symbol non-pointer/assoc.
* trans-decl.c (gfc_build_qualified_array): Select correct
gfc_array_spec for regular and class arrays.
(gfc_build_dummy_array_decl): Likewise.
(gfc_get_symbol_decl): Get a dummy array for class arrays.
(gfc_trans_deferred_vars): Tell conv_expr that the descriptor
is desired.
* trans-expr.c (gfc_class_vptr_get): Get the class descriptor
from the correct location for class arrays.
(gfc_class_len_get): Likewise.
(gfc_conv_intrinsic_to_class): Add handling of _len component.
(gfc_conv_class_to_class): Prevent access to unset array data
when the array is an optional argument. Add handling of _len
component.
(gfc_copy_class_to_class): Check that _def_init is non-NULL
when used in _vptr->copy()
(gfc_trans_class_init_assign): Ensure that the rank of
_def_init is zero.
(gfc_conv_component_ref): Get the _vptr along with _data refs.
(gfc_conv_variable): Make sure the temp array descriptor is
returned for class arrays, too, and that class arrays are
dereferenced correctly.
(gfc_conv_procedure_call): For polymorphic type initialization
the initializer has to be a pointer to _def_init stored in a
dummy variable, which then needs to be used by value.
* trans-intrinsic.c (gfc_conv_intrinsic_sizeof): Use the
temporary array descriptor for class arrays, too.
(gfc_conv_intrinsic_storage_size): Likewise.
(gfc_conv_intrinsic_loc): Add ref to _data for BT_CLASS
expressions.
* trans-stmt.c (trans_associate_var): Use a temporary array for
the associate variable of class arrays, too, making the array
one-based (lbound == 1).
* trans-types.c (gfc_is_nodesc_array): Use the correct
array data.
* trans.c (gfc_build_array_ref): Use the dummy array descriptor
when present.
* trans.h: Add class_vptr to gfc_se for storing a class ref's
vptr.
Richard Biener [Thu, 23 Apr 2015 11:19:45 +0000 (11:19 +0000)]
passes.def: Remove copy propagation passes run directly after CCP.
2015-04-23 Richard Biener <rguenther@suse.de>
* passes.def: Remove copy propagation passes run directly after CCP.
* tree-ssa-ccp.c (get_value_for_expr): Fall back to a COPY for
SSA names.
(ccp_visit_phi_node): Rework to handle first executable edge
specially.
* tree-vect-slp.c (vect_find_first_load_in_slp_instance): Remove.
(vect_find_last_store_in_slp_instance): Rename to ...
(vect_find_last_scalar_stmt_in_slp): ... this and generalize.
(vect_analyze_slp_cost_1): Use vector_load for constant defs
and vec_construct for external defs when estimating prologue cost.
(vect_analyze_slp_instance): Do not init SLP_INSTANCE_FIRST_LOAD_STMT.
Compute costs here only when vectorizing loops.
(vect_slp_analyze_bb_1): Compute SLP cost here, after vector types
have been determined.
(vect_schedule_slp_instance): Simplify vectorized code placement
and prepare for in-BB external defs.
* tree-vectorizer.h (struct _slp_instance): Remove first_load member.
(SLP_INSTANCE_FIRST_LOAD_STMT): Remove.
* tree-vect-stmts.c (vect_model_store_cost): Remove PURE_SLP_STMT
guard.
(vect_model_load_cost): Likewise.
(vectorizable_store): Instead add it here.
(vectorizable_load): Likewise.
(vect_is_simple_use): Dump def type textually.
Richard Biener [Thu, 23 Apr 2015 08:30:04 +0000 (08:30 +0000)]
cfgexpand.c (expand_gimple_stmt_1): Use ops.code.
2015-04-23 Richard Biener <rguenther@suse.de>
* cfgexpand.c (expand_gimple_stmt_1): Use ops.code.
* cfgloop.c (verify_loop_structure): Verify the root loop node.
* except.c (duplicate_eh_regions): Call get_eh_region_from_lp_number_fn
instead of get_eh_region_from_lp_number.
* loop-init.c (fix_loop_structure): If we removed a loop, reset
the SCEV cache.
2015-04-22 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* config/rs6000/rs6000.c (rtx_is_swappable_p): Commentary
adjustments.
(insn_is_swappable_p): Return 1 for a convert from double to
single precision when all of its uses are splats of BE element
zero.
[gcc/testsuite]
2015-04-22 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
Bill Schmidt [Thu, 23 Apr 2015 00:21:39 +0000 (00:21 +0000)]
re PR target/65456 (powerpc64le autovectorized copy loop missed optimization)
[gcc]
2015-04-22 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR target/65456
* config/rs6000/rs6000.c (rs6000_option_override_internal): For
VSX + POWER8, enable TARGET_ALLOW_MOVMISALIGN and
TARGET_EFFICIENT_UNALIGNED_VSX if not selected by command line
option.
(rs6000_builtin_mask_for_load): Return 0 for targets with
efficient unaligned VSX accesses so that the vectorizer will use
direct unaligned loads.
(rs6000_builtin_support_vector_misalignment): Always return true
for targets with efficient unaligned VSX accesses.
(rs6000_builtin_vectorization_cost): Cost of unaligned loads and
stores on targets with efficient unaligned VSX accesses is almost
always the same as the cost of an aligned load or store, so model
it that way.
* config/rs6000/rs6000.h (SLOW_UNALIGNED_ACCESS): Return 0 for
unaligned vectors if we have efficient unaligned VSX accesses.
* config/rs6000/rs6000.opt (mefficient-unaligned-vector): New
undocumented option.
[gcc/testsuite]
2015-04-22 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
gcc/testsuite/
* c-c++-common/asan/user-section-1.c: New test.
* c-c++-common/asan/user-section-2.c: New test.
* c-c++-common/asan/user-section-3.c: New test.
bfin: handle BFIN_CPU_UNKNOWN in TARGET_CPU_CPP_BUILTINS
gcc/c-family/c-cppbuiltin.c
In file included from ./tm.h:21:0,
from
../../../../../../home/me/src/gcc-5.0.mine/gcc/c-family/c-cppbuiltin.c:23:
../../../../../../home/me/src/gcc-5.0.mine/gcc/c-family/c-cppbuiltin.c:
In function ‘void c_cpp_builtins(cpp_reader*)’:
../../../../../../home/me/src/gcc-5.0.mine/gcc/config/bfin/bfin.h:43:14:
error: enumeration value ‘BFIN_CPU_UNKNOWN’ not handled in switch
[-Werror=switch]
switch (bfin_cpu_type) \
^
../../../../../../home/me/src/gcc-5.0.mine/gcc/c-family/c-cppbuiltin.c:1243:3:
note: in expansion of macro ‘TARGET_CPU_CPP_BUILTINS’
TARGET_CPU_CPP_BUILTINS ();
^
cc1plus: all warnings being treated as errors
make[2]: *** [c-family/c-cppbuiltin.o] Error 1
Maybe seeing BFIN_CPU_UNKNOWN in the cpu switch statement should
__builtin_abort() but be conservative to just allow all-gcc of config-list.mk
to compile
* conditions.h: Define macros even if HAVE_cc0 is undefined.
* emit-rtl.c: Define functions even if HAVE_cc0 is undefined.
* final.c: Likewise.
* jump.c: Likewise.
* recog.c: Likewise.
* recog.h: Declare functions even when HAVE_cc0 is undefined.
* sched-deps.c (sched_analyze_2): Always compile case for cc0.
Jerry DeLisle [Tue, 21 Apr 2015 16:13:54 +0000 (16:13 +0000)]
re PR fortran/56743 (Namelist bug with comment and no blank)
2015-04-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/56743
* io/list_read.c (CASE_SEPARATORS): Add case for '!'.
(is_separator): Add condition for '!'.
(eat_separator): Use notify_std to warn or errord if '!' is
encountered before a proper separator.
Richard Biener [Tue, 21 Apr 2015 12:52:43 +0000 (12:52 +0000)]
re PR tree-optimization/65650 (CCP does not propgate copies)
2015-04-21 Richard Biener <rguenther@suse.de>
PR tree-optimization/65650
* tree-ssa-ccp.c (valid_lattice_transition): Allow lattice
transitions involving copies.
(set_lattice_value): Adjust for copy lattice state.
(ccp_lattice_meet): Do not merge UNDEFINED and a copy to the copy
if that doesn't dominate the merge point.
(bit_value_unop): Adjust what we treat as varying mask.
(bit_value_binop): Likewise.
(bit_value_assume_aligned): Likewise.
(evaluate_stmt): When we simplified to a SSA name record a copy
instead of dropping to varying.
(visit_assignment): Simplify.
* gimple-match.h (gimple_simplify): Add another callback.
* gimple-fold.c (fold_stmt_1): Adjust caller.
(gimple_fold_stmt_to_constant_1): Likewise - pass valueize
for the 2nd callback.
* gimple-match-head.c (gimple_simplify): Add a callback that is
used to valueize the stmt operands and use it that way.