PR rtl-optimization/77452
* explow.c (plus_constant) <case MEM>: Extract scalar constant from
inner-mode reference to a CONST_VECTOR constant in the constant pool.
testsuite/ChangeLog:
PR rtl-optimization/77452
* gcc.target/i386/pr77452.c: New test.
From-SVN: r239989
2016-09-04 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77391
* resolve.c (deferred_requirements): New function to check F2008:C402.
(resolve_fl_variable,resolve_fl_parameter): Use it.
2016-09-04 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77391
* gfortran.dg/pr77391.f90: New test.
From-SVN: r239982
2016-09-04 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77460
* simplify.c (simplify_transformation_to_scalar): On error, result
may be NULL, simply return.
2016-09-04 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77460
* gfortran.dg/pr77460.f90: New test.
From-SVN: r239979
* src/pa/ffi.c (ffi_struct_type): Put type declaration on separate line.
(ffi_prep_args_pa32): Likewise.
(ffi_size_stack_pa32): Likewise.
(ffi_prep_cif_machdep): Likewise.
(ffi_call): Likewise. Rename to ffi_call_int. Add closure argument
and update call to ffi_call_pa32.
(ffi_call, ffi_call_go, ffi_prep_go_closure): New.
(ffi_closure_inner_pa32): Update to handle go closures.
* src/pa/ffitarget.h (FFI_GO_CLOSURES): Define.
* src/pa/hpux32.S (ffi_call_pa32): Pass go closure argument in static
chain register (%ret1).
(ffi_closure_pa32): Set closure type argument to zero.
(ffi_go_closure_pa32): New function. Add unwind data for it.
* src/pa/linux.S: Likewise. Use cfi directives for unwind data.
* testsuite/libffi.go/static-chain.h (STATIC_CHAIN_REG): Define for
hppa.
From-SVN: r239978
2016-09-04 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/71902
* frontend-passes.c (realloc_string_callback): Also check for the
lhs being deferred. Name temporary variable "realloc_string".
2016-09-04 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/71902
* gfortran.dg/dependency_47.f90: New test.
* gfortran.dg/dependency_49.f90: New test.
From-SVN: r239977
2016-09-04 Tom de Vries <tom@codesourcery.com>
revert:
2016-08-29 Tom de Vries <tom@codesourcery.com>
* c-common.c (build_va_arg): Replace first argument type error
with assert.
From-SVN: r239975
gcc/ChangeLog:
* common.opt (fdiagnostics-generate-patch): New option.
* diagnostic.c: Include "edit-context.h".
(diagnostic_initialize): Initialize context->edit_context_ptr.
(diagnostic_finish): Delete context->edit_context_ptr.
(diagnostic_report_diagnostic): Add fix-it hints from the
diagnostic to context->edit_context_ptr, if any.
* diagnostic.h (class edit_context): Add forward decl.
(struct diagnostic_context): Add field "edit_context_ptr".
* doc/invoke.texi (Diagnostic Message Formatting Options): Add
-fdiagnostics-generate-patch.
(-fdiagnostics-generate-patch): New item.
* toplev.c: Include "edit-context.h".
(process_options): Set global_dc->edit_context_ptr to a new
edit_context if the options need one.
(toplev::main): Handle -fdiagnostics-generate-patch by using
global_dc->edit_context_ptr.
gcc/testsuite/ChangeLog:
* gcc.dg/plugin/diagnostic-test-show-locus-generate-patch.c: New
test case.
* gcc.dg/plugin/plugin.exp (plugin_test_list): Add
diagnostic-test-show-locus-generate-patch.c to the sources
for diagnostic_plugin_test_show_locus.c.
From-SVN: r239965
PR tree-optimization/77444
* tree-ssa-loop-ivopts.c (cand_value_at): For pointers use sizetype
as steptype, remove redundant initialization.
Co-Authored-By: Richard Biener <rguenther@suse.de>
From-SVN: r239962
PR sanitizer/77396
* sanopt.c: Include gimple-ssa.h, tree-phinodes.h and ssa-iterators.h.
(sanopt_optimize_walker): Optimize away
__asan_before_dynamic_init (...) followed by
__asan_after_dynamic_init () without intervening memory loads/stores.
* ipa-pure-const.c (special_builtin_state): Handle
BUILT_IN_ASAN_BEFORE_DYNAMIC_INIT and
BUILT_IN_ASAN_AFTER_DYNAMIC_INIT.
* decl2.c (do_static_initialization_or_destruction): Only
call asan_dynamic_init_call if INITP is true.
* g++.dg/asan/pr77396.C: New test.
From-SVN: r239961
This patch adds foreach, max and min methods to
class typed_splay_tree, along with the start of a selftest
suite.
gcc/ChangeLog:
* Makefile.in (OBJS): Add typed-splay-tree.o.
* selftest-run-tests.c (selftest::run_tests): Call
typed_splay_tree_c_tests.
* selftest.h (typed_splay_tree_c_tests): New decl.
* typed-splay-tree.c: New file.
* typed-splay-tree.h (typed_splay_tree::foreach_fn): New typedef.
(typed_splay_tree::max): New method.
(typed_splay_tree::min): New method.
(typed_splay_tree::foreach): New method.
(typed_splay_tree::closure): New struct.
(typed_splay_tree::inner_foreach_fn): New function.
From-SVN: r239958
* acinclude.m4 (GLIBCXX_CONFIGURE_TESTSUITE): Check for presence of
setrlimit on both native and cross targets.
* configure: Regenerate.
From-SVN: r239955
gcc/c-family/ChangeLog:
* c-ada-spec.c (dump_ada_function_declaration): Increase buffer
size to guarantee it fits the output of the formatted function
regardless of its arguments.
gcc/cp/ChangeLog:
* mangle.c: Increase buffer size to guarantee it fits the output
of the formatted function regardless of its arguments.
gcc/go/ChangeLog:
* gofrontend/expressions.cc: Increase buffer size to guarantee
it fits the output of the formatted function regardless of its
arguments.
gcc/java/ChangeLog:
* decl.c (give_name_to_locals): Increase buffer size to guarantee
it fits the output of the formatted function regardless of its
arguments.
* mangle_name.c (append_unicode_mangled_name): Same.
gcc/ChangeLog:
* genmatch.c (parser::parse_expr): Increase buffer size to guarantee
it fits the output of the formatted function regardless of its
arguments.
* gcc/genmodes.c (parser::parse_expr): Same.
* gimplify.c (gimplify_asm_expr): Same.
* passes.c (pass_manager::register_one_dump_file): Same.
* print-tree.c (print_node): Same.
From-SVN: r239949
Various patterns use "register_operand" "l" (or "=l") although those
patterns are only created refering to LR_REGNO directly. This patch
changes those patterns to use the hard regs as well.
* config/rs6000/rs6000.md (*restore_gpregs_<mode>_r11,
*restore_gpregs_<mode>_r12, *restore_gpregs_<mode>_r1,
*return_and_restore_gpregs_<mode>_r11,
*return_and_restore_gpregs_<mode>_r12,
*return_and_restore_gpregs_<mode>_r1,
*return_and_restore_fpregs_<mode>_r11,
*return_and_restore_fpregs_<mode>_r12,
*return_and_restore_fpregs_<mode>_r1): Use the hard register LR_REGNO
directly instead of via the "l" constraint. Renumber operands.
Fix whitespace.
From-SVN: r239942
Many places still use 65 instead of the symbolic constant LR_REGNO. This
fixes them all (I looked for the string "65" only, in config/rs6000/ only,
I didn't read all code :-) )
I left it in *restore_world because Iain will remove it there soon.
* config/rs6000/altivec.md (*save_world, *save_vregs_<mode>_r11,
save_vregs_<mode>_r12, *restore_vregs_<mode>_r11,
*restore_vregs_<mode>_r12): Use LR_REGNO instead of 65.
* config/rs6000/darwin.md (load_macho_picbase, load_macho_picbase_si,
load_macho_picbase_di, *call_indirect_nonlocal_darwin64,
*call_nonlocal_darwin64, *call_value_indirect_nonlocal_darwin64,
*call_value_nonlocal_darwin64, reload_macho_picbase,
reload_macho_picbase_si, reload_macho_picbase_di): Ditto.
* config/rs6000/rs6000.h (RETURN_ADDR_IN_PREVIOUS_FRAME): Ditto.
* config/rs6000/rs6000.md (*save_gpregs_<mode>_r11,
*save_gpregs_<mode>_r12, *save_gpregs_<mode>_r1,
*save_fpregs_<mode>_r11, *save_fpregs_<mode>_r12,
*save_fpregs_<mode>_r1): Ditto.
* config/rs6000/spe.md (*save_gpregs_spe, *restore_gpregs_spe,
*return_and_restore_gpregs_spe): Ditto.
From-SVN: r239941
This should fix r239866 for AIX. I missed two patterns that refer to LR
as "register_operand" "l" instead of as reg:P LR_REGNO.
* config/rs6000/rs6000.md
(define_insn "*return_and_restore_fpregs_aix_<mode>_r11"): Delete
the use of the link register.
(define_insn "*return_and_restore_fpregs_aix_<mode>_r1"): Ditto.
From-SVN: r239940
2016-09-01 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/72827
* config/rs6000/rs6000.c (rs6000_legitimize_address): Avoid
reg+reg addressing for TImode.
(rs6000_legitimate_address_p): Only allow register indirect
addressing for TImode, even without TARGET_QUAD_MEMORY.
Co-Authored-By: Michael Meissner <meissner@linux.vnet.ibm.com>
From-SVN: r239938
2016-09-01 Richard Biener <rguenther@suse.de>
PR middle-end/77436
* tree-chrec.c (tree_fold_binomial): Use widest_int, properly
check whether the result fits the desired result type.
* gcc.dg/torture/pr77436.c: New testcase.
From-SVN: r239937
This patch adds legitimize_address_displacement hook so that stack accesses
with large offsets are split into a more efficient sequence. Unaligned and
TI/TFmode use a 256-byte range, byte and halfword accesses use a 4KB range,
wider accesses use a 16KB range to maximise the available addressing range
and increase opportunities to share the base address.
int f(int x)
{
int arr[8192];
arr[4096] = 0;
arr[6000] = 0;
arr[7000] = 0;
arr[8191] = 0;
return arr[x];
}
Now generates:
sub sp, sp, #32768
add x1, sp, 16384
str wzr, [x1]
str wzr, [x1, 7616]
str wzr, [x1, 11616]
str wzr, [x1, 16380]
ldr w0, [sp, w0, sxtw 2]
add sp, sp, 32768
ret
gcc/
* config/aarch64/aarch64.c (aarch64_legitimize_address_displacement):
New function.
(TARGET_LEGITIMIZE_ADDRESS_DISPLACEMENT): Define.
From-SVN: r239923
* config/aarch64/aarch64.md (*ands<mode>_compare0): New pattern.
* config/aarch64/aarch64.c (aarch64_select_cc_mode): Return CC_NZmode
for comparisons of integer ZERO_EXTEND against zero.
* gcc.target/aarch64/ands_3.c: New test.
From-SVN: r239919