2017-08-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Backport from trunk
PR fortran/80164
* trans-stmt.c (gfc_trans_call): If no code expr, use code->loc
as warning/error locus.
* gfortran.dg/array_temporaries_4.f90: New test.
From-SVN: r251189
Backport from mainline
2017-08-17 Maxim Ostapenko <m.ostapenko@samsung.com>
PR target/81861
* config/i386/i386.c (ix86_option_override_internal): Save target
specific options after ix86_stack_protector_guard_reg was changed.
From-SVN: r251162
[gcc]
2017-08-16 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
Backport from mainline
2017-08-08 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/81354
* gimple-ssa-strength-reduction.c (create_add_on_incoming_edge):
Insert on edges rather than explicitly creating landing pads.
(analyze_candidates_and_replace): Commit edge inserts.
[gcc/testsuite]
2017-08-16 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
Backport from mainline
2017-08-08 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/81354
* g++.dg/torture/pr81354.C: New file.
From-SVN: r251120
GCC mainline built for sh4-linux-gnu runs out of memory building a
glibc test, which calls strncmp with very large constant size
argument, resulting in the SH inline strncmp expansion trying to
inline a fully unrolled expansion of strncmp for that size.
This patch limits that fully unrolled expansion to the case of less
than 32 bytes. This is explicitly *not* trying to be optimal in any
way (very likely a lower threshold makes sense), just to limit enough
to avoid the out-of-memory issue in the glibc testsuite.
I have *not* run the GCC testsuite for SH. I have verified that this
allows the glibc testsuite to build OK, with both GCC mainline and GCC
7 branch (and that the included test builds quickly with patched GCC,
runs out of memory with unpatched GCC).
PR target/78460
PR target/67712
gcc:
* config/sh/sh-mem.cc (sh_expand_cmpnstr): Only unroll for
constant count if that count is less than 32.
gcc/testsuite:
* gcc.c-torture/compile/string-large-1.c: New test.
From-SVN: r251109
Backport from mainline
2017-08-09 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/79820
PR libstdc++/81751
* config/io/basic_file_stdio.cc (sys_open(FILE*, ios_base::openmode)):
Call fflush on the stream instead of calling sync() while _M_cfile is
null. Restore original value of errno.
* testsuite/ext/stdio_filebuf/char/79820.cc: New.
* testsuite/ext/stdio_filebuf/char/81751.cc: New.
From-SVN: r251090
2017-08-08 Richard Biener <rguenther@suse.de>
PR middle-end/81766
* function.c (thread_prologue_and_epilogue_insns): Restore
behavior of always calling find_many_sub_basic_blocks on
the inserted prologue.
* gcc.target/i386/pr81766.c: New testcase.
From-SVN: r250958
When finalizing the methods of a named struct type, we used to
finalize all the field types first. That can fail if the field types
refer indirectly to the named type. Change it to just finalize the
embedded field types first, and the rest of the fields later.
Fixesgolang/go#21253
Reviewed-on: https://go-review.googlesource.com/52570
From-SVN: r250833
PR tree-optimization/81655
PR tree-optimization/81588
* gcc.dg/tree-ssa/pr81588.c: Use -mbranch-cost=2 where possible,
don't run the test on branch-cost=1 targets.
From-SVN: r250819
PR middle-end/79499
* function.c (thread_prologue_and_epilogue_insns): Determine blocks
for find_many_sub_basic_blocks bitmap by looking up BLOCK_FOR_INSN
of first NONDEBUG_INSN_P in each of the split_prologue_seq and
prologue_seq sequences - if any.
* gcc.dg/pr79499.c: New test.
From-SVN: r250815
PR target/81641
* config/i386/i386.c (ix86_print_operand_address_as): For -masm=intel
print "ds:" only for immediates in generic address space.
testsuite/ChangeLog:
PR target/81641
* gcc.target/i386/pr81641.c: New test.
From-SVN: r250801
PR target/81622
* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): For
__builtin_vec_cmpne verify both arguments are compatible vectors
before looking at TYPE_MODE on the element type. For __builtin_vec_ld
verify arg1_type is a pointer or array type. For __builtin_vec_st,
move computation of aligned to after checking the argument types.
Formatting fixes.
* gcc.target/powerpc/pr81622.c: New test.
From-SVN: r250787
2017-08-01 Martin Liska <mliska@suse.cz>
Backport from mainline
2017-07-26 Martin Liska <mliska@suse.cz>
PR gcov-profile/81561
* gcov.c (unblock): Make unblocking safe as we need to preserve
index correspondence of blocks and block_lists.
From-SVN: r250782
2017-08-01 Richard Biener <rguenther@suse.de>
PR tree-optimization/71752
PR tree-optimization/81633
* tree-vect-slp.c (vect_get_slp_defs): Handle null operands
in the original suggested way.
* gcc.dg/vect/pr81633.c: New testcase.
From-SVN: r250779
2017-08-01 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
PR tree-optimization/80769
* tree-ssa-strlen.c (strinfo): Document that "stmt" is also used
for malloc and calloc. Document the new invariant that all related
strinfos have delayed lengths or none do.
(get_next_strinfo): New function.
(verify_related_strinfos): Move earlier in file.
(set_endptr_and_length): New function, split out from...
(get_string_length): ...here. Also set the lengths of related
strinfos.
gcc/testsuite/
PR tree-optimization/80769
* gcc.dg/strlenopt-31.c: New test.
* gcc.dg/strlenopt-31g.c: Likewise.
From-SVN: r250772
PR tree-optimization/81588
* tree-ssa-reassoc.c (optimize_range_tests_var_bound): If
ranges[i].in_p, invert comparison code ccode. For >/>=,
swap rhs1 and rhs2 and comparison code unconditionally,
for </<= don't do that. Don't swap rhs1/rhs2 again if
ranges[i].in_p, instead invert comparison code ccode if
opcode or oe->rank is BIT_IOR_EXPR.
* gcc.dg/tree-ssa/pr81588.c: New test.
* gcc.dg/pr81588.c: New test.
* gcc.c-torture/execute/pr81588.c: New test.
From-SVN: r250761