PR tree-optimization/61114
* doc/md.texi (Standard Names): Add reduc_(plus,[us](min|max))|scal
optabs, and note in reduc_[us](plus|min|max) to prefer the former.
* expr.c (expand_expr_real_2): Use reduc_..._scal if available, fall
back to old reduc_... + BIT_FIELD_REF only if not.
* optabs.c (optab_for_tree_code): for REDUC_(MAX,MIN,PLUS)_EXPR,
return the reduce-to-scalar (reduc_..._scal) optab.
(scalar_reduc_to_vector): New.
* optabs.def (reduc_smax_scal_optab, reduc_smin_scal_optab,
reduc_plus_scal_optab, reduc_umax_scal_optab, reduc_umin_scal_optab):
New.
* optabs.h (scalar_reduc_to_vector): Declare.
* tree-vect-loop.c (vectorizable_reduction): Look for optabs reducing
to either scalar or vector.
From-SVN: r216737
PR tree-optimization/61114
* expr.c (expand_expr_real_2): For REDUC_{MIN,MAX,PLUS}_EXPR, add
extract_bit_field around optab result.
* fold-const.c (fold_unary_loc): For REDUC_{MIN,MAX,PLUS}_EXPR, produce
scalar not vector.
* tree-cfg.c (verify_gimple_assign_unary): Check result vs operand type
for REDUC_{MIN,MAX,PLUS}_EXPR.
* tree-vect-loop.c (vect_analyze_loop): Update comment.
(vect_create_epilog_for_reduction): For direct vector reduction, use
result of tree code directly without extract_bit_field.
* tree.def (REDUC_MAX_EXPR, REDUC_MIN_EXPR, REDUC_PLUS_EXPR): Update
comment.
From-SVN: r216736
2014-10-27 Richard Biener <rguenther@suse.de>
* match.pd (0 % X): Properly use the iterator iterating over
all modulo operators.
(X % 1): Likewise.
From-SVN: r216732
* gcc-interface/misc.c (gnat_init_options_struct): Parameterize errno
support here instead of...
Do not set flag_delete_dead_exceptions to 1 unconditionally.
(gnat_init_gcc_eh): Set flag_delete_dead_exceptions to 1.
(gnat_init_gcc_fp): ...here.
From-SVN: r216731
* gcc-interface/utils.c (create_var_decl_1): For a variable declared
in the unit, set TREE_PUBLIC only if it has static storage duration.
From-SVN: r216729
2014-10-27 Richard Biener <rguenther@suse.de>
* tree-ssa-forwprop.c: Include tree-cfgcleanup.h and tree-into-ssa.h.
(lattice): New global.
(fwprop_ssa_val): New function.
(fold_all_stmts): Likewise.
(pass_forwprop::execute): Finally fold all stmts.
* gcc.dg/tree-ssa/forwprop-6.c: Scan ccp1 dump instead.
* gcc.dg/strlenopt-8.c: Adjust and XFAIL for non_strict_align
target due to memcpy inline-expansion.
From-SVN: r216728
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Remove
superfluous computation for the max size.
<E_Array_Subtype>: Likewise. Make sure that the max size calculation
does not overflow at compile time.
From-SVN: r216725
In cp/error.c, I separate the initialization of the diagnostic context
from the initialization of the scratch pretty-printer (cxx_pp). This
was suggested by Gabriel in the last review of the patch and now I
realize it was a good idea. Now cxx_initialize_diagnostics is the
equivalent version of c_initialize_diagnostics. To avoid having to
make extern a bunch of functions, I moved it from cp-objcp-common.c to
error.c.
I moved the setting of diagnostic_format_decoder (global_dc) =
c_tree_printer, from c_objc_common_init to c_initialize_diagnostics,
and right after c_common_diagnostics_set_defaults. This
mimics what is done in cxx_initialize_diagnostics.
Moreover, in both c_initialize_diagnostics and
cxx_initialize_diagnostics, the FE-specific pretty-printer is
initialized first and then other settings are applied. This does not
make a difference right now, but if in the future one wishes to touch
something in the pretty-printer, it will not get overriden
immediately.
In fact, the code I removed in c_common_initialize_diagnostics, which
sets line_cutoff to 80, is useless because the pretty-printer created
here is actually never used, but overriden by the FE-specific
pretty-printers. This also means that doc/invoke.texi was wrong.
Finally, it is useless to set the maximum line length to 0 in the
constructor of cxx_pretty_printer. It is the default anyway.
gcc/c/ChangeLog:
2014-10-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/53061
* c-objc-common.c (c_objc_common_init): Do not do diagnostics
initialization here...
(c_initialize_diagnostics): ... but here. Set defaults after
building pretty-printer.
gcc/ChangeLog:
2014-10-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/53061
* doc/invoke.texi (fmessage-length): Update text to match reality.
gcc/cp/ChangeLog:
2014-10-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/53061
* cp-objcp-common.c: Do not include new.
(cxx_initialize_diagnostics): Move from here to ...
* error.c (cxx_initialize_diagnostics): : ... here. Move
diagnostics initialization here from init_error.
(cxx_pp): Use a real pointer not a macro.
(init_error): Just initialize cxx_pp.
* cxx-pretty-print.c (cxx_pretty_printer::cxx_pretty_printer): Do
not set maximum line length.
gcc/c-family/ChangeLog:
2014-10-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/53061
* c-opts.c (c_common_diagnostics_set_defaults): Renamed from
c_common_initialize_diagnostics.
* c-common.h: Likewise.
From-SVN: r216720
* config/pa/linux-unwind.h (pa32_read_access_ok): New function.
(pa32_fallback_frame_state): Use pa32_read_access_ok to check if
memory read accesses are ok.
From-SVN: r216716
gcc/
* config/mips/mips.c (r10k_needs_protection_p_call): Take a const_rtx
and return a bool. Iterate over all subrtxes here.
(r10k_needs_protection_p): Update accordingly.
From-SVN: r216712
gcc/
* config/mips/mips.c (r10k_needs_protection_p_1): Take an rtx
rather than an rtx pointer. Change type of insn from "void *"
to its real type. Return bool rather than int. Iterate over
all subrtxes here.
(r10k_needs_protection_p_store): Update accordingly.
(r10k_needs_protection_p): Likewise.
From-SVN: r216711
gcc/
* config/mips/mips.c (mips16_rewrite_pool_refs_info): Delete.
(mips16_rewrite_pool_refs): Take the insn and constant pool as
parameters. Iterate over the instruction's pattern and return void.
(mips16_lay_out_constants): Update accordingly.
From-SVN: r216710
gcc/
* config/mips/mips.c (mips_rewrite_small_data_1): Take the context
as a parameter instead of the containing MEM. Iterate over all
subrtxes. Don't return a value.
(mips_rewrite_small_data): Update call accordingly.
From-SVN: r216708
gcc/
* config/mips/mips.c: Include rtl-iter.h.
(mips_small_data_pattern_1): Take an rtx rather than an rtx pointer.
Take the context as a parameter instead of the containing MEM.
Iterate over all subrtxes.
(mips_small_data_pattern_p): Update call accordingly.
From-SVN: r216707
gcc/
* config/mep/mep.c (mep_store_find_set): Take a const_rtx and
return a bool. Replace "void *" with specific type. Iterate
over all subrtxes.
(mep_store_data_bypass_1): Update calls accordingly.
From-SVN: r216705
gcc/
* config/mep/mep.c: Include rtl-iter.h.
(global_reg_mentioned_p_1): Take a const_rtx and return a bool.
(xtensa_tls_referenced_p): Return a bool. Use FOR_EACH_SUBRTX.
From-SVN: r216704
gcc/
* config/sh/sh-protos.h (shmedia_cleanup_truncate): Take an
rtx as argument and return the number of changes.
* config/sh/sh.c: Include rtl-iter.h.
(shmedia_cleanup_truncate): Take an rtx as argument and iterate
over all subrtxes. Return the number of changes made.
* config/sh/sh.md: Update caller accordingly.
From-SVN: r216701
PR rtl-optimization/63615
* simplify-rtx.c (simplify_plus_minus): Set "canonicalized" on
decomposing PLUS or MINUS if operands are not placed adjacent
in the "ops" array.
From-SVN: r216689
rs6000_hard_regno_nregs_internal allows SPE vectors in single
registers satisfying SPE_SIMD_REGNO_P (i.e. register numbers 0 to
31). However, the corresponding test for e500 double treats all
registers as being able to store a 64-bit value, rather than just
those GPRs.
Logically this inconsistency is wrong; in addition, it causes problems
unwinding from signal handlers. linux-unwind.h uses
ARG_POINTER_REGNUM as a place to store the return address from a
signal handler, but this logic in rs6000_hard_regno_nregs_internal
results in that being considered an 8-byte register, resulting in
assertion failures.
(<https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02625.html> first
needs to be applied for unwinding to work in general on e500.) This
patch makes rs6000_hard_regno_nregs_internal handle the e500 double
case consistently with SPE vectors.
Tested with no regressions with cross to powerpc-linux-gnuspe (given
the aforementioned patch applied). Failures of signal handling
unwinding tests such as gcc.dg/cleanup-{8,9,10,11}.c are fixed by this
patch.
* config/rs6000/rs6000.c (rs6000_hard_regno_nregs_internal): Do
not allow e500 double in registers not satisyfing
SPE_SIMD_REGNO_P.
From-SVN: r216688
Continuing the cleanups of libgcc soft-fp configuration for
powerpc*-*-linux* in preparation for implementing
TARGET_ATOMIC_ASSIGN_EXPAND_FENV for soft-float and e500, this patch
optimizes the choice of which functions to build for the 32-bit
classic hard-float and soft-float cases. (e500 will be dealt with in
a separate patch which will need to add new features to t-hardfp and
t-softfp; this patch keeps the status quo for e500.)
For hard-float, while the functions in question are part of the libgcc
ABI there is no need for them to contain software floating point code:
no newly built code should use them, and if anything does use them
it's most efficient (space and speed) for them to pass straight
through to floating-point hardware instructions; this case is made to
use t-hardfp to achieve that. For soft-float, direct use of soft-fp
functions for operations involving DImode or unsigned integers is more
efficient than using the libgcc2.c versions of those operations to
convert to operations on other types (which then end up calling
soft-fp functions for those other types, possibly more than once);
this case is thus stopped from using t-softfp-excl. (A future patch
will stop the e500 cases from using t-softfp-excl as well.)
Tested with no regressions for crosses to powerpc-linux-gnu (soft
float and classic hard float); also checked that the same set of
symbols and versions is exported from shared libgcc before and after
the patch.
* configure.ac (ppc_fp_type): Set variable on powerpc*-*-linux*.
* configure: Regenerate.
* config.host (powerpc*-*-linux*): Use $ppc_fp_type to determine
additions to tmake_file. Use t-hardfp-sfdf and t-hardfp instead
of soft-fp for 32-bit classic hard float. Do not use
t-softfp-excl for soft float.
From-SVN: r216687
gcc:
* ginclude/stdbool.h: Do not define bool, true or false in C++11.
libstdc++-v3:
* testsuite/18_support/headers/cstdbool/macros.cc: New.
From-SVN: r216679