2017-01-18 Louis Krupp <louis.krupp@zoho.com>
PR fortran/50069
PR fortran/55086
* gfortran.dg/pr50069_1.f90: New test.
* gfortran.dg/pr50069_2.f90: New test.
* gfortran.dg/pr55086_1.f90: New test.
* gfortran.dg/pr55086_1_tfat.f90: New test.
* gfortran.dg/pr55086_2.f90: New test.
* gfortran.dg/pr55086_2_tfat.f90: New test.
* gfortran.dg/pr55086_aliasing_dummy_4_tfat.f90: New test.
2017-01-18 Louis Krupp <louis.krupp@zoho.com>
PR fortran/50069
PR fortran/55086
* trans-expr.c (gfc_conv_variable): Don't treat temporary variables
as function arguments.
* trans-stmt.c (forall_make_variable_temp,
generate_loop_for_temp_to_lhs, gfc_trans_assign_need_temp,
gfc_trans_forall_1): Don't adjust offset of forall temporary
for array sections, make forall temporaries work for substring
expressions, improve test coverage by adding -ftest-forall-temp
option to request usage of temporary array in forall code.
* lang.opt: Add -ftest-forall-temp option.
* invoke.texi: Add -ftest-forall-temp option.
From-SVN: r244601
2017-01-18 Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
* config/rs6000/rs6000-protos.h (expand_strn_compare): Add arg.
* config/rs6000/rs6000.c (expand_strn_compare): Add ability to expand
strcmp. Fix bug where comparison didn't stop with zero byte. Fix
case where N arg is SIZE_MAX.
* config/rs6000/rs6000.md (cmpstrnsi): Args to expand_strn_compare.
(cmpstrsi): Add pattern.
2017-01-18 Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
* gcc.dg/strcmp-1.c: New test.
* gcc.dg/strncmp-1.c: Add test for a bug that escaped.
From-SVN: r244598
DejaGnu's <dejagnu.h> provides decls of various inline functions,
of which the jit testsuite uses "pass", "fail" and "note".
The jit testcase test-threads.c jumps through some hoops to make
these functions threadsafe, using macros to rename the implementation
in dejagnu.h, giving them a "dejagnu_" prefix, then reimplementing
the names with wrappers that use a mutex.
The DejaGnu functions gained a "static" modifier in
ad36659ffa984a0541cfc2bd27f393e0d7d173a7, which appears to be in
DejaGnu 1.5.2 onwards.
Unfortunately, jit.dg/test-threads.c has forward decls of
"dejagnu_pass" etc, and these don't have "static", leading to conflicts
with later versions of DejaGnu for which "pass" etc have "static".
This patch fixes things by removing the forward decls of
"dejagnu_pass", moving the usage of them to a point at which dejagnu.h
has been included, which ought to work with both earlier and later
versions of DejaGnu.
Fixes compilation of test-threads.c in jit testsuite.
gcc/testsuite/ChangeLog:
* jit.dg/test-threads.c (dejagnu_pass): Remove decl.
(dejagnu_fail): Likewise.
(dejagnu_note): Likewise.
(pass): Provide forward decl, moving true decl to after #include
of harness.h.
(fail): Likewise.
(note): Likewise.
From-SVN: r244597
PR c++/78488
* call.c (build_over_call): When checking ellipsis conversions for
an inherited ctor, make sure there is at least one conversion.
* g++.dg/cpp1z/inh-ctor37.C: New.
From-SVN: r244592
gcc/testsuite/ChangeLog:
2017-01-18 Andre Vehreschild <vehre@gcc.gnu.org>
* gfortran.dg/coarray_alloc_with_implicit_sync_2.f90: New test.
Also fixed date in gcc/testsuite/ChangeLog on my previous commit.
gcc/fortran/ChangeLog:
2017-01-18 Andre Vehreschild <vehre@gcc.gnu.org>
* primary.c (caf_variable_attr): Improve figuring whether the current
component is the last one refed.
* trans-stmt.c (gfc_trans_allocate): Do not generate sync_all calls
when allocating pointer or allocatable components.
From-SVN: r244590
gcc/fortran/ChangeLog:
2017-01-18 Andre Vehreschild <vehre@gcc.gnu.org>
* gfortran.texi: Add missing parameters to caf-API functions. Correct
typos and clarify some descriptions.
Adjusted date of my previous commit.
From-SVN: r244589
SHA1H instructions may be scheduled after a SHA1C instruction
that uses the same input register. However SHA1C updates its input,
so if SHA1H is scheduled after it, it requires an extra move.
Increase the priority of SHA1H to ensure it gets scheduled
earlier, avoiding the move.
gcc/
* config/aarch64/aarch64.c (aarch64_sched_adjust_priority)
New function.
(TARGET_SCHED_ADJUST_PRIORITY): Define target hook.
From-SVN: r244586
PR target/77416
* gcc.target/powerpc/pr77416.c Guard the test only for ilp32 effective
target. Use powerpc* instead of powerpc64* in targets. Remove -m32
from dg-options.
* gcc.target/powerpc/pr64205.c: Remove -m32 from dg-options of ilp32
guarded test.
* gcc.target/powerpc/fusion4.c: Likewise.
* gcc.target/powerpc/pr63491.c: Remove -m64 from dg-options of lp64
guarded test.
* gcc.target/powerpc/pr58673-1.c: Likewise.
* gcc.target/powerpc/pr58673-2.c: Likewise.
* gcc.target/powerpc/pr59054.c: Likewise.
From-SVN: r244585
[gcc]
2016-01-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* config/rs6000/altivec.h (vec_bperm): Change #define.
* config/rs6000/altivec.md (UNSPEC_VBPERMD): New enum constant.
(altivec_vbpermq2): New define_insn.
(altivec_vbpermd): Likewise.
* config/rs6000/rs6000-builtin.def (VBPERMQ2): New monomorphic
function interface.
(VBPERMD): Likewise.
(VBPERM): New polymorphic function interface.
* config/rs6000/r6000-c.c (altivec_overloaded_builtins_table):
Add entries for P9V_BUILTIN_VEC_VBPERM.
* doc/extend.texi: Add interfaces for vec_bperm.
[gcc/testsuite]
2016-01-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* gcc.target/powerpc/p8vector-builtin-8.c: Add new form for
vec_bperm.
* gcc.target/powerpc/p9-vbpermd.c: New file.
From-SVN: r244578
2017-01-17 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/79004
* gcc.target/powerpc/pr79004.c: Add -mfloat128 to the test
options. Fix up the syntax for using \m and \M.
From-SVN: r244561
Currently, on PowerPC, code compiled with -fstack-protector will load
the canary from -0x7010(13) (for -m64) or from -0x7008(2) (for -m32)
if GCC was compiled against GNU libc 2.4 or newer or some other libc
that supports -fstack-protector, and from the global variable
__stack_chk_guard otherwise.
This does not work well for Linux and other OS kernels and similar.
For such non-standard applications, this patch creates a few new
command-line options. The relevant new use cases are:
-mstack-protector-guard=global
Use the __stack_chk_guard variable, no matter how this GCC was
configured.
-mstack-protector-guard=tls
Use the canary from TLS. This will error out if this GCC was built
with a C library that does not support it.
-mstack-protector-guard=tls -mstack-protector-register=<reg>
-mstack-protector-offset=<offset>
Load the canary from offset <off> from base register <reg>.
PR target/78875
* config/rs6000/rs6000-opts.h (stack_protector_guard): New enum.
* config/rs6000/rs6000.c (rs6000_option_override_internal): Handle
the new options.
* config/rs6000/rs6000.md (stack_protect_set): Handle the new more
flexible settings.
(stack_protect_test): Ditto.
* config/rs6000/rs6000.opt (mstack-protector-guard=,
mstack-protector-guard-reg=, mstack-protector-guard-offset=): New
options.
* doc/invoke.texi (Option Summary) [RS/6000 and PowerPC Options]:
Add -mstack-protector-guard=, -mstack-protector-guard-reg=, and
-mstack-protector-guard-offset=.
(RS/6000 and PowerPC Options): Ditto.
gcc/testsuite/
* gcc.target/powerpc/ssp-1.c: New testcase.
* gcc.target/powerpc/ssp-2.c: New testcase.
From-SVN: r244556
* config/i386/i386.h (MASK_CLASS_P): New define.
* config/i386/i386.c (inline_secondary_memory_needed): Ensure that
there are no registers from different register sets also when
mask registers are used. Update function comment.
* config/i386/i386.md (*movsi_internal): Split (*k/*krm) alternative
to (*k/*r) and (*k/*km) alternatives.
From-SVN: r244548
This patch simplifies the handling of EH return. We force the use of the
frame pointer so the return location is always at FP + 8. This means we
can emit a simple volatile access in EH_RETURN_HANDLER_RTX without needing md
patterns, splitters and frame offset calculations. The new implementation also
fixes various bugs in aarch64_final_eh_return_addr, which does not work with
-fomit-frame-pointer, alloca or outgoing arguments.
gcc/
* config/aarch64/aarch64.md (eh_return): Remove pattern and splitter.
* config/aarch64/aarch64.h (AARCH64_EH_STACKADJ_REGNUM): Remove.
(EH_RETURN_HANDLER_RTX): New define.
* config/aarch64/aarch64.c (aarch64_frame_pointer_required):
Force frame pointer in EH return functions.
(aarch64_expand_epilogue): Add barrier for eh_return.
(aarch64_final_eh_return_addr): Remove.
(aarch64_eh_return_handler_rtx): New function.
* config/aarch64/aarch64-protos.h (aarch64_final_eh_return_addr):
Remove.
(aarch64_eh_return_handler_rtx): New prototype.
testsuite/
* gcc.target/aarch64/eh_return.c: New test.
From-SVN: r244547
[gcc]
2017-01-17 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* config/rs6000/altivec.h (vec_rlmi): New #define.
(vec_vrlnm): Likewise.
(vec_rlnm): Likewise.
* config/rs6000/altivec.md (UNSPEC_VRLMI): New UNSPEC enum value.
(UNSPEC_VRLNM): Likewise.
(VIlong): New mode iterator.
(altivec_vrl<VI_char>mi): New define_insn.
(altivec_vrl<VI_char>nm): Likewise.
* config/rs6000/rs6000-builtin.def (VRLWNM): New monomorphic
function entry.
(VRLDNM): Likewise.
(RLNM): New polymorphic function entry.
(VRLWMI): New monomorphic function entry.
(VRLDMI): Likewise.
(RLMI): New polymorphic function entry.
* config/rs6000/r6000-c.c (altivec_overloaded_builtin_table): Add
new entries for P9V_BUILTIN_VEC_RLMI and P9V_BUILTIN_VEC_RLNM.
* doc/extend.texi: Add description of vec_rlmi, vec_rlnm, and
vec_vrlnm.
[gcc/testsuite]
2017-01-17 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* vec-rlmi-rlnm.c: New file.
From-SVN: r244546
PR debug/78839
* dwarf2out.c (field_byte_offset): Restore the
PCC_BITFIELD_TYPE_MATTERS behavior for INTEGER_CST DECL_FIELD_OFFSET
and DECL_FIELD_BIT_OFFSET. Use fold_build2 instead of build2 + fold.
(analyze_variants_discr, gen_variant_part): Use fold_build2 instead
of build2 + fold.
From-SVN: r244545
PR c++/61636
* cp-tree.h (maybe_generic_this_capture): Declare.
* lambda.c (resolvable_dummy_lambda): New, broken out of ...
(maybe_resolve_dummy): ... here. Call it.
(maybe_generic_this_capture): New.
* parser.c (cp_parser_postfix_expression): Speculatively capture
this in generic lambda in unresolved member function call.
* pt.c (tsubst_copy_and_build): Force hard error from failed
member function lookup in generic lambda.
PR c++/61636
* g++.dg/cpp1y/pr61636-1.C: New.
* g++.dg/cpp1y/pr61636-2.C: New.
* g++.dg/cpp1y/pr61636-3.C: New.
From-SVN: r244544
* config/rs6000/rs6000.c (rs6000_emit_move): Also use a TOC reference
after forcing to constant memory when the code model is medium.
From-SVN: r244541