* tree.c (type_with_interoperable_signedness): New.
(gimple_canonical_types_compatible_p): Use it.
* tree.h (type_with_interoperable_signedness): Declare
* lto.c (hash_canonical_type): Honor
type_with_interoperable_signedness.
* gfortran.dg/lto/bind_c-2_0.f90: New testcase.
* gfortran.dg/lto/bind_c-2_1.c: New testcase.
* gfortran.dg/lto/bind_c-3_0.f90: New testcase.
* gfortran.dg/lto/bind_c-3_1.c: New testcase.
* gfortran.dg/lto/bind_c-4_0.f90: New testcase.
* gfortran.dg/lto/bind_c-4_1.c: New testcase.
* gfortran.dg/lto/bind_c-5_0.f90: New testcase.
* gfortran.dg/lto/bind_c-5_1.c: New testcase.
From-SVN: r228680
* fold-const.c (operand_equal_p): Document OEP_ADDRESS_OF
and OEP_CONSTANT_ADDRESS_OF; skip type compatibility checks
when OEP_ADDRESS_OF is se.
From-SVN: r228679
2015-10-07 Aditya Kumar <aditya.k7@samsung.com>
Sebastian Pop <s.pop@samsung.com>
* graphite-dependences.c (scop_get_dependences): Add dump of the
data dependence graph.
* graphite-poly.c (print_isl_union_map): New.
(debug_isl_union_map): New.
* graphite-poly.h (print_isl_union_map): Declare.
(debug_isl_union_map): Declare.
Co-Authored-By: Sebastian Pop <s.pop@samsung.com>
From-SVN: r228677
This patch adds an easy way to write tests for expected multiline
output. For example we can test carets and underlines for
a particular diagnostic with:
/* { dg-begin-multiline-output "" }
typedef struct _GMutex GMutex;
^~~~~~~
{ dg-end-multiline-output "" } */
multiline.exp is used by prune.exp; hence we need to load it before
prune.exp via *load_gcc_lib* for the testsuites of the various
non-"gcc" support libraries (e.g. boehm-gc).
gcc/testsuite/ChangeLog:
* lib/multiline.exp: New file.
* lib/prune.exp: Load multiline.exp.
(prune_gcc_output): Call into multiline.exp to handle any
multiline output directives.
* lib/libgo.exp: Load multiline.exp before prune.exp, using
load_gcc_lib.
boehm-gc/ChangeLog:
* testsuite/lib/boehm-gc.exp: Load multiline.exp before
prune.exp, using load_gcc_lib.
libatomic/ChangeLog:
* testsuite/lib/libatomic.exp: Load multiline.exp before
prune.exp, using load_gcc_lib.
libgomp/ChangeLog:
* testsuite/lib/libgomp.exp: Load multiline.exp before prune.exp,
using load_gcc_lib.
libitm/ChangeLog:
* testsuite/lib/libitm.exp: Load multiline.exp before prune.exp,
using load_gcc_lib.
libvtv/ChangeLog:
* testsuite/lib/libvtv.exp: Load multiline.exp before prune.exp,
using load_gcc_lib.
From-SVN: r228655
2015-10-09 Martin Jambor <mjambor@suse.cz>
tree-optimization/67794
* tree-sra.c (replace_removed_params_ssa_names): Do not distinguish
between types of state,ents but accept original definitions as a
parameter.
(ipa_sra_modify_function_body): Use FOR_EACH_SSA_DEF_OPERAND to
iterate over definitions.
testsuite/
* gcc.dg/ipa/ipa-sra-10.c: Nw test.
* gcc.dg/torture/pr67794.c: Likewise.
From-SVN: r228654
for gcc/ChangeLog
PR middle-end/67766
* function.c (expand_function_end): Move return value
promotion past the handling of PARALLELs and CONCATs.
From-SVN: r228651
2015-10-09 Richard Biener <rguenther@suse.de>
* genmatch.c (print_operand): Fix formatting.
(dt_node::append_simplify): Warn for multiple simplifiers
that match the same pattern.
* match.pd (log (exp @0)): Remove duplicates.
From-SVN: r228648
This patch by Richard allows for movmisalign optabs to be supported
in gimple-fold.c. This caused a bit of pain in the testsuite with strlenopt-8.c
in conjunction with the ARM support for movmisalign_optabs as the test
was coded up to do different things depending on whether the target
supported misaligned access or not. However now with unaligned access
being allowed for different levels of the architecture in the arm backend,
the concept of the helper function non_strict_align mapping identically
to the definition of STRICT_ALIGNMENT disappears.
Adjusted thusly for ARM. The testsuite/lib changes were tested with an
arm-none-eabi multilib that included architecture variants that did not
support unaligned access and architecture variants that did.
The testing matrix for this patch was:
1. x86_64 bootstrap and regression test - no regressions.
2. armhf bootstrap and regression test - no regressions.
3. arm-none-eabi cross build and regression test for
{-marm/-march=armv7-a/-mfpu=vfpv3-d16/-mfloat-abi=softfp}
{-mthumb/-march=armv8-a/-mfpu=crypto-neon-fp-armv8/-mfloat-abi=hard}
{-marm/-mcpu=arm7tdmi/-mfloat-abi=soft}
{-mthumb/-mcpu=arm7tdmi/-mfloat-abi=soft}
with no regressions.
Ok to apply ?
2015-10-09 Richard Biener <rguenth@suse.de>
PR target/67366
* gimple-fold.c (optabs-query.h): Include
(gimple_fold_builtin_memory_op): Allow unaligned stores
when movmisalign_optabs are available.
2015-10-09 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
PR target/67366
* lib/target-supports.exp (check_effective_target_non_strict_align):
Adjust for arm*-*-*.
* gcc.target/arm/pr67366.c: New test.
From-SVN: r228644
This adds movmisalignhi and movmisalignsi expanders when unaligned
access is allowed by the architecture. This allows the mid-end
to expand to misaligned loads and stored.
Compared code generated for the Linux kernel and
it changes code generation for a handful of files all for the better
basically by reducing the stack usage.
Tested by :
1. armhf bootstrap and regression test - no regressions.
2.. arm-none-eabi cross build and regression test for
{-marm/-march=armv7-a/-mfpu=vfpv3-d16/-mfloat-abi=softfp}
{-mthumb/-march=armv8-a/-mfpu=crypto-neon-fp-armv8/-mfloat-abi=hard}
{-marm/-mcpu=arm7tdmi/-mfloat-abi=soft}
{-mthumb/-mcpu=arm7tdmi/-mfloat-abi=soft}
Will apply to trunk once 2/2 is approved.
regards
Ramana
2015-10-09 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
PR target/67366
* config/arm/arm.md (movmisalign<mode>): New.
* config/arm/iterators.md (HSI): New.
From-SVN: r228643
* gcc-interface/Make-lang.in: Make sure that GNAT1_OBJS and not just
GNAT1_ADA_OBJS are compiled only after generated files are created.
From-SVN: r228636
* value-prof.c (gimple_ic): Add missing calls to unlink_stmt_vdef
and release_ssa_name in two places.
(gimple_stringop_fixed_value): Similarly.
From-SVN: r228632
There is is no point to round up the SSE register save area to 16 bytes if
the incoming stack boundary is less than 16 bytes.
* config/i386/i386.c (ix86_compute_frame_layout): Round up the
SSE register save area to 16 bytes only if the incoming stack
boundary is no less than 16 bytes.
From-SVN: r228621
* config/nvptx/nvptx.h (struct machine_function): Add comment.
* config/nvptx/nvptx.c (nvptx_declare_function_name): Functions
may return pointer as well as in memory.
(nvptx_output_return): Likewise.
From-SVN: r228618
This patch moves the sqrt and cbrt simplification rules to match.pd.
builtins.c now only does the constant folding.
Bootstrapped & regression-tested on x86_64-linux-gnu.
gcc/
* builtins.c (fold_builtin_sqrt, fold_builtin_cbrt): Delete.
(fold_builtin_1): Update accordingly. Handle constant arguments here.
* match.pd: Add rules previously handled by fold_builtin_sqrt
and fold_builtin_cbrt.
gcc/testsuite/
* gcc.dg/builtins-47.c: Test the optimized dump instead.
From-SVN: r228616
The upcoming patch to move sqrt and cbrt simplifications to match.pd
caused a regression because the (abs @0)->@0 simplification didn't
trigger for:
(abs (convert (abs X)))
The simplification is based on tree_expr_nonnegative_p, which at
the moment just gives up if it sees an SSA_NAME.
This patch makes tree_expr_nonnegative_p recurse into SSA name
definitions, but limits the depth of recursion to a small number
for the reason mentioned in the comment (adapted from an existing
comment in gimple_val_nonnegative_real_p). The patch reuses code
in tree-vrp.c, moving it to gimple-fold.c. It also replaces calls
to gimple_val_nonnegative_real_p with calls to tree_expr_nonnegative_p.
A knock-on effect is that we can now prove _i_589 < 0 is false in
sequences like:
i_1917 = ASSERT_EXPR <i_1075, i_1075 == 0>;
_i_589 = (const int) i_1917;
_i_1507 = ASSERT_EXPR <_i_589, _i_589 < 0>;
This defeats an assert in tree-vrp.c that ASSERT_EXPR conditions
are never known to be false. Previously the assert only ever used
local knowledge and so would be limited to cases like x != x for
integer x. Now that we use global knowledge it's possible to prove
the assertion condition is false in blocks that are in practice
unreachable. The patch therefore removes the assert.
Bootstrapped & regression-tested on x86_64-linux-gnu. I didn't write
a specific test because this is already covered by the testsuite if
the follow-on patch is also applied.
gcc/
* params.def (PARAM_MAX_SSA_NAME_QUERY_DEPTH): New param.
* doc/invoke.texi (--param max-ssa-name-query-depth): Document.
* fold-const.h (tree_unary_nonnegative_warnv_p)
(tree_single_nonnegative_warnv_p, tree_call_nonnegative_warnv_p)
(tree_expr_nonnegative_warnv_p): Add depth parameters.
* fold-const.c: Include gimple-fold.h and params.h.
(tree_ssa_name_nonnegative_warnv_p): New function.
(tree_unary_nonnegative_warnv_p, tree_binary_nonnegative_warnv_p)
(tree_single_nonnegative_warnv_p, tree_call_nonnegative_warnv_p)
(tree_invalid_nonnegative_warnv_p, tree_expr_nonnegative_warnv_p):
Add a depth parameter and increment it for recursive calls to
tree_expr_nonnegative_warnv_p. Use tree_ssa_name_nonnegative_warnv_p
to handle SSA names.
* gimple-fold.h (gimple_val_nonnegative_real_p): Delete.
(gimple_stmt_nonnegative_warnv_p): Declare.
* tree-vrp.c (remove_range_assertions): Remove assert that condition
cannot be proven false.
(gimple_assign_nonnegative_warnv_p, gimple_call_nonnegative_warnv_p)
(gimple_stmt_nonnegative_warnv_p): Move to...
* gimple-fold.c: ...here. Add depth parameters and pass them
down to the tree routines. Accept statements that aren't
assignments or calls but just return false for them.
(gimple_val_nonnegative_real_p): Delete.
* tree-ssa-math-opts.c (gimple_expand_builtin_pow): Use
tree_expr_nonnegative_p instead of gimple_val_nonnegative_real_p.
Check HONOR_NANs first.
From-SVN: r228614