Aditya Kumar [Thu, 24 Dec 2015 16:41:46 +0000 (16:41 +0000)]
Fix computation of single entry/exit of a region.
For basic block with two preds, allow (as single entry) only when the other
edge is a backedge. Similarly for basic block with two succs,
allow (as single exit) only when the other edge is a back edge.
Dominik Vogt [Wed, 23 Dec 2015 11:06:20 +0000 (11:06 +0000)]
Fix broken handling of LABEL_REF in genrecog + genpreds.
gcc/ChangeLog
* config/s390/predicates.md ("larl_operand"): Remove now superfluous
const_int and const_double.
* genrecog.c (safe_predicate_mode): Return false for VOIDmode
LABEL_REFs even if the predicate does not handle const_int,
const_double or const_wide_int.
* genpreds.c (add_mode_tests): Treat LABEL_REF like CONST_INT.
David Sherwood [Wed, 23 Dec 2015 10:28:18 +0000 (10:28 +0000)]
iterators.md (VMAXMINFNM): New int iterator.
2015-12-23 David Sherwood <david.sherwood@arm.com>
gcc/
* config/arm/iterators.md (VMAXMINFNM): New int iterator.
(fmaxmin): New int attribute.
(fmaxmin_op): Likewise.
* config/arm/unspecs.md (UNSPEC_VMAXNM): New unspec.
(UNSPEC_VMINNM): Likewise.
* config/arm/neon.md (fmaxmin): New pattern.
* config/arm/vfp.md (fmaxmin): Likewise.
gcc/testsuite
* gcc.target/arm/fmaxmin.x: New file used by tests below.
* gcc.target/arm/fmaxmin.c: New test.
* gcc.target/arm/vect-fmaxmin.c: Likewise.
H.J. Lu [Wed, 23 Dec 2015 09:49:28 +0000 (09:49 +0000)]
[PATCH] Allow indirect call via GOT for 64-bit Pmode x32
From: H.J. Lu <hongjiu.lu@intel.com>
Since Pmode is 64-bit with -maddress-mode=long for x32, indirect call
via GOT slot doesn't need zero_extend. This patch enables indirect call
via GOT for x32 with 64-bit Pmode.
David Malcolm [Tue, 22 Dec 2015 22:27:45 +0000 (22:27 +0000)]
PR c/68473: sanitize source range-printing within certain macro expansions
gcc/ChangeLog:
PR c/68473
* diagnostic-show-locus.c (layout::layout): Make loc_range const.
Sanitize the layout_range against ranges that finish before they
start.
gcc/testsuite/ChangeLog:
PR c/68473
* gcc.dg/plugin/diagnostic-test-expressions-1.c (fminl): New decl.
(TEST_EQ): New macro.
(test_macro): New function.
* gcc.target/i386/pr68473-1.c: New test case.
David Malcolm [Tue, 22 Dec 2015 22:06:00 +0000 (22:06 +0000)]
libcpp: Avoid unnecessary ad-hoc uses for large source files
libcpp/ChangeLog:
* line-map.c (get_combined_adhoc_loc): Remove condition
on locus < RESERVED_LOCATION_COUNT when considering
whether a caret == start == finish location can be
simply stored as the caret location.
Jakub Jelinek [Tue, 22 Dec 2015 20:47:58 +0000 (21:47 +0100)]
re PR c++/67376 (Comparison with pointer to past-the-end of array fails inside constant expression)
PR c++/67376
* fold-const.c (size_low_cst): Removed.
(fold_comparison): For POINTER_PLUS_EXPR where base is ADDR_EXPR
call get_inner_reference and handle INDIRECT_REF base of it. Use
offset_int for computation of the bitpos.
(fold_binary_loc) <case EQ_EXPR, NE_EXPR>: Formatting
fixes for X +- Y CMP X and C - X CMP X folding. Add X CMP X +- Y
and X CMP C - X folding.
The must-not-throw wrapper for protect_cleanup_actions gets in
the way of being able to access __builtin_eh_pointer without
confusion as the identit of the exception to which we are
referring (b_eh_p has no usable argument up to this point).
Since EH_ELSE never comes from user derived code, let's drop
the c++ specific wrapping.
* tree-eh.c (honor_protect_cleanup_actions): Do not wrap
eh_else in a must-not-throw; set ehp_region for it too.
H.J. Lu [Tue, 22 Dec 2015 15:38:25 +0000 (15:38 +0000)]
[PATCH] Use call-clobbered register for sibcall via GOT
From: H.J. Lu <hongjiu.lu@intel.com>
Since sibcall never returns, we can only use call-clobbered register as
GOT base. Otherwise, callee-saved register used as GOT base won't be
properly restored. sibcall_memory_operand is changed to allow 32-bit
GOT slot only with pseudo register as GOT base for RTL expansion. 2
new patterns, *sibcall_GOT_32 and *sibcall_value_GOT_32, are added to
expose GOT base register to register allocator so that call-clobbered
register will be used for GOT base.
gcc/
PR target/68937
* config/i386/i386.c (ix86_function_ok_for_sibcall): Count
call to global function via GOT slot as indirect call.
* config/i386/i386.md (*sibcall_GOT_32): New pattern.
(*sibcall_value_GOT_32): Likewise.
* config/i386/predicates.md (sibcall_memory_operand): Rewrite.
Allow 32-bit GOT slot only with pseudo register as GOT base.
(GOT32_symbol_operand): New predicate.
Sujoy Saraswati [Tue, 22 Dec 2015 14:04:30 +0000 (14:04 +0000)]
This series of patches fix PR61441.
This series of patches fix PR61441. This patch avoids various transformations
with signaling NaN operands when flag_signaling_nans is on, to avoid folding
which would lose exceptions.
Bootstrapped & regression-tested on x86_64-linux-gnu.
gcc/
* fold-const.c (const_binop): Convert sNaN to qNaN when
flag_signaling_nans is off.
(const_unop): Avoid the operation, other than NEGATE and
ABS, if flag_signaling_nans is on and the operand is an sNaN.
(fold_convert_const_real_from_real): Avoid the operation if
flag_signaling_nans is on and the operand is an sNaN.
(integer_valued_real_unary_p): Update comment stating it
returns false for sNaN values.
(integer_valued_real_binary_p, integer_valued_real_call_p): Same.
(integer_valued_real_single_p): Same.
(integer_valued_real_invalid_p, integer_valued_real_p): Same.
* fold-const-call.c (fold_const_pow): Avoid the operation
if flag_signaling_nans is on and the operand is an sNaN.
(fold_const_builtin_load_exponent) Same.
(fold_const_call_sss): Same for CASE_CFN_POWI.
* gimple-fold.c (gimple_assign_integer_valued_real_p): Same.
(gimple_call_integer_valued_real_p): Same.
(gimple_phi_integer_valued_real_p): Same.
(gimple_stmt_integer_valued_real_p): Same.
* simplify-rtx.c (simplify_const_unary_operation): Avoid the
operation if flag_signaling_nans is on and the operand is an sNaN.
(simplify_const_binary_operation): Same.
* tree-ssa-math-opts.c (gimple_expand_builtin_pow): Avoid the
operation if flag_signaling_nans is on and the operand is an sNaN.
Jeff Law [Tue, 22 Dec 2015 03:09:08 +0000 (20:09 -0700)]
dbgcnt.def (dom_unreachable_edges): New debug counter.
* dbgcnt.def (dom_unreachable_edges): New debug counter.
* tree-ssa-dom.c: Include dbgcnt.h
(dom_opt_dom_walker::before_dom_children): Handle the new counter.
* go-gcc.cc (class Bvariable): Remove Gcc_tree parent class. Add
t_ and orig_type_ fields. Add new two parameter constructor. Add
get_tree and get_decl methods.
(Gcc_backend::var_expression): Pass location to var get_tree.
(Gcc_backend::global_variable): Don't add VIEW_CONVERT_EXPR. Use
two parameter constructor for Bvariable.
(Gcc_backend::global_variable_set_init): Don't remove
VIEW_CONVERT_EXPR. Use var get_decl, not get_tree.
(Gcc_backend::write_global_definitions): Likewise.
(Gcc_backend::init_statement): Call var get_decl, not get_tree.
(Gcc_backend::block): Likewise.
(Gcc_backend::implicit_variable_set_init): Likewise.
(Gcc_backend::immutable_struct_set_init): Likewise.
(Gcc_backend::function_set_parameters): Likewise.
Ian Lance Taylor [Tue, 22 Dec 2015 00:10:07 +0000 (00:10 +0000)]
go-gcc.cc (Gcc_backend::global_variable): If type is zero-sized, add a VIEW_CONVERT_EXPR to the tree.
* go-gcc.cc (Gcc_backend::global_variable): If type is zero-sized,
add a VIEW_CONVERT_EXPR to the tree.
(Gcc_backend::global_variable_set_init): Remove any
VIEW_CONVERT_EXPR.
(Gcc_backend::write_global_definitions): Likewise.
David Malcolm [Mon, 21 Dec 2015 17:45:34 +0000 (17:45 +0000)]
C and C++ FE: fix source ranges for binary ops
gcc/c-family/ChangeLog:
* c-common.c (binary_op_error): Convert first param from
location_t to rich_location * and use it when emitting an error.
* c-common.h (binary_op_error): Convert first param from
location_t to rich_location *.
gcc/c/ChangeLog:
* c-typeck.c: Include "gcc-rich-location.h".
(build_binary_op): In the two places that call binary_op_error,
create a gcc_rich_location and populate it with the location of
the binary op and its two operands.
gcc/cp/ChangeLog:
* typeck.c (cp_build_binary_op): Update for change in signature
of build_binary_op. Use error_at to replace an implicit use
of input_location with param "location" in "invalid operands"
error.
(cp_build_binary_op): Replace an error with an error_at, using
"location", rather than implicitly using input_location.
gcc/testsuite/ChangeLog:
* g++.dg/diagnostic/bad-binary-ops.C: New test case.
* gcc.dg/bad-binary-ops.c: New test case.
gcc.dg/plugin/diagnostic_plugin_show_trees.c (get_range_for_expr):
Remove material copied from gcc-rich-location.c
(gcc_rich_location::add_expr): Likewise.
DWARF: allow dynamic data member offsets for inheritance info
An unintended effect of the recently introduced machinery to handle
dynamic data member offsets in variable-length records (when
-fgnat-encodings=minimal) prevented GCC from describing correctly
inheritance information for classes in C++, which is a regression.
This change rectifies this machinery in this case.
gcc/ChangeLog:
* dwarf2out.c (add_data_member_location_attribute): Do not
disable dynamic data member offsets descriptions for TREE_BINFO
members.
Sujoy Saraswati [Mon, 21 Dec 2015 07:59:30 +0000 (07:59 +0000)]
This series of patches fix PR61441.
This series of patches fix PR61441. This patch makes resulting NaN values
to be quiet NaN for real value operations, irrespective of the flag_signaling_nans
flag. The caller has the responsibility to avoid the operation if flag_signaling_nans
is on.
gcc/
* real.c (do_add): Make resulting NaN value to be qNaN.
(do_multiply, do_divide, do_fix_trunc): Same.
(real_arithmetic, real_ldexp, real_convert): Same.
(real_isinteger): Updated comment stating it returns false for sNaN.
Jason Merrill [Sun, 20 Dec 2015 18:38:37 +0000 (13:38 -0500)]
re PR c++/67411 (internal compiler error: in tsubst_copy, at cp/pt.c:13473)
PR c++/67411
* lambda.c (generic_lambda_fn_p): Split out from...
(maybe_add_lambda_conv_op): ...here.
* semantics.c (process_outer_var_ref): Don't defer maybe-constant
variables in a generic lambda.
* pt.c (instantiate_non_dependent_or_null): New.
* init.c (constant_value_1): Use it.
* cp-tree.h: Declare it and generic_lambda_fn_p.
Eric Botcazou [Sun, 20 Dec 2015 10:30:27 +0000 (10:30 +0000)]
decl.c (gnat_to_gnu_entity): During layout in type_annotate_only mode...
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: During
layout in type_annotate_only mode, skip discriminants of derived
tagged types renaming those of the parent type.
In type_annotate_only mode, if the type is tagged, do not override a
size clause but take into account the alignment of the tag.
(annotate_rep): In type_annotate_only mode, deal with discriminants
of derived tagged types renaming those of the parent type.
Eric Botcazou [Sun, 20 Dec 2015 10:27:37 +0000 (10:27 +0000)]
utils.c (maybe_pad_type): In type_annotate_only mode...
* gcc-interface/utils.c (maybe_pad_type): In type_annotate_only mode,
retrieve the component type if this is an array and do not issue the
warning for concurrent types.
Sujoy Saraswati [Sun, 20 Dec 2015 09:13:51 +0000 (09:13 +0000)]
This series of patches are for fixing PR61441.
This series of patches are for fixing PR61441. This patch modifies code to use
REAL_VALUE_ISSIGNALING_NAN instead of REAL_VALUE_ISNAN to avoid the operatins
only for sNaN operands.
Bootstrapped & regression-tested on x86_64-linux-gnu.
gcc/
* fold-const.c (const_binop): Use REAL_VALUE_ISSIGNALING_NAN instead
of REAL_VALUE_ISNAN to avoid the operation for sNaN operands.
* simplify-rtx.c (simplify_const_binary_operation): Same.
Jan Hubicka [Sun, 20 Dec 2015 05:50:29 +0000 (06:50 +0100)]
re PR tree-optimization/65337 (LTO bootstrap failure with Ada enabled)
PR middle-end/65337
* tree-ssa-dce.c (bb_postorder): New static var.
(forward_edge_to_pdom): Remove.
(remove_dead_stmt): Instead of redirecting edges only keep an edge
on a path to nearest live BB.
(eliminate_unnecessary_stmts): Free bb_postorder.
* cfganal.c (dfs_find_deadend): Add START_POINTES.
* cfganal.h (inverted_post_order_compute): Update prototype.
Andrew Burgess [Sat, 19 Dec 2015 19:29:12 +0000 (19:29 +0000)]
arc.md (*storeqi_update): Use 'memory_operand' and fix RTL pattern to include the plus.
2015-12-19 Andrew Burgess <andrew.burgess@embecosm.com>
* config/arc/arc.md (*storeqi_update): Use 'memory_operand' and
fix RTL pattern to include the plus.
(*storehi_update): Likewise.
(*storesi_update): Likewise.
(*storesf_update): Likewise.
* config/arc/predicates.md (store_update_operand): Delete.
Andrew Burgess [Sat, 19 Dec 2015 19:22:51 +0000 (19:22 +0000)]
arc.md (*loadqi_update): Use new 'any_mem_operand' and fix RTL pattern to include the plus.
gcc:
2015-12-19 Andrew Burgess <andrew.burgess@embecosm.com>
* config/arc/arc.md (*loadqi_update): Use new 'any_mem_operand'
and fix RTL pattern to include the plus.
(*load_zeroextendqisi_update): Likewise.
(*load_signextendqisi_update): Likewise.
(*loadhi_update): Likewise.
(*load_zeroextendhisi_update): Likewise.
(*load_signextendhisi_update): Likewise.
(*loadsi_update): Likewise.
(*loadsf_update): Likewise.
* config/arc/predicates.md (load_update_operand): Delete.
(any_mem_operand): New predicate.
gcc/testsuite:
2015-12-19 Andrew Burgess <andrew.burgess@embecosm.com>
re PR target/68729 (../Xbae/Methods.c:1772:1: ICE: in extract_insn, at recog.c:2343)
PR target/68729
* config/pa/pa.c (pa_emit_move_sequence): Reorganize handling of
floating-point reloads. Only reload operands that are not valid
floating-point memory operands.
Jakub Jelinek [Fri, 18 Dec 2015 22:16:24 +0000 (23:16 +0100)]
re PR debug/68860 (FAIL: gcc.dg/guality/pr36728-1.c -flto -O3 -g line 17 arg1 == 1)
PR debug/68860
* ipa-split.c (split_function): Only perform caller side
modifications for decl_debug_args here.
* cgraph.c: Include gimplify.h.
(cgraph_edge::redirect_call_stmt_to_callee): Add caller side
debug stmts for decl_debug_args. Spelling fix in a comment.
* tree-inline.c (tree_function_versioning): Populate decl_debug_args
for args_to_skip arguments and add callee side debug stmts.
Formatting fixes. Avoid shadowing i variable.
* gcc.dg/guality/pr68860-1.c: New test.
* gcc.dg/guality/pr68860-2.c: New test.
Fix a regression introduced by the fix of libstdc++/68276.
2015-12-18 Ville Voutilainen <ville.voutilainen@gmail.com>
Fix a regression introduced by the fix of libstdc++/68276.
* src/c++11/ios.cc (_M_grow_words): Catch bad_alloc again so that
bad_array_new_length is handled properly.
Paolo Carlini [Fri, 18 Dec 2015 18:18:47 +0000 (18:18 +0000)]
re PR c++/67592 (A virtual member function declared constexpr fails to trigger a diagnostic)
/cp
2015-12-18 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/67592
* decl.c (grokdeclarator): Reject constexpr virtual member functions;
in error messages, prefer %<virtual%> and %<constexpr%> to virtual
and constexpr, respectively.
/testsuite
2015-12-18 Paolo Carlini <paolo.carlini@oracle.com>
Richard Biener [Fri, 18 Dec 2015 13:52:11 +0000 (13:52 +0000)]
re PR testsuite/68776 (gcc.dg/vect/vect-widen-mult-const-[su]16.c failures since r226675)
2015-12-18 Richard Biener <rguenther@suse.de>
PR testsuite/68776
* tree-vect-patterns.c (struct vect_recog_func): New.
(vect_vect_recog_func_ptrs): Make an array of function name pairs.
(vect_pattern_recog_1): Print the recognized pattern name. Return
true if a pattern was recognized.
(vect_pattern_recog): Adjust. Stop iterating over pattern recognition
functions on a stmt if a pattern was recognized.
Paul Thomas [Fri, 18 Dec 2015 09:34:13 +0000 (09:34 +0000)]
re PR fortran/68196 (ICE on function result with procedure pointer component)
2015-12-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/68196
*expr.c (gfc_has_default_initializer): Prevent infinite recursion
through this function for procedure pointer components.
* trans-array.c (structure_alloc_comps): Ditto twice.
2015-12-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/68196
* gfortran.dg/proc_ptr_48.f90: New test.
Andreas Krebbel [Fri, 18 Dec 2015 09:20:53 +0000 (09:20 +0000)]
S/390: Deprecate g5 and g6 CPU levels
gcc/ChangeLog:
2015-12-18 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* config/s390/driver-native.c (s390_host_detect_local_cpu): Pick
z900 -march -mtune even on g5 and g6 machines.
* config/s390/s390.c (s390_option_override_internal): New argument
to distingiush between options and target attributes. Emit
deprecation warning for g5 and g6 arch/tune options.
(s390_option_override): Set new s390_option_override_internal
argument to true.
(s390_valid_target_attribute_tree): Set new
s390_option_override_internal argument to false.
* config/s390/s390.h: Default to z900 in the driver.
* doc/invoke.texi: Document the deprecation of g5 and g6.
gcc/testsuite/ChangeLog:
2015-12-18 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* gcc.target/s390/hotpatch-8.c: Add -Wno-deprecated to options.
* gcc.target/s390/hotpatch-9.c: Likewise.