2016-10-09 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
* ipa-prop.c (ipcp_transform_function): Set fields m_vr and bits to NULL of
(*ipcp_transformations)][node->uid].
From-SVN: r240903
Many POSIX systems have the bad habit of not restarting interrupted
syscalls. On these systems it's up to the user to check for an error
with errno == EINTR and restart manually. This patch does this for
libgfortran, so that GFortran users don't have to do it.
2016-10-09 Janne Blomqvist <jb@gcc.gnu.org>
PR libfortran/67585
* io/io.h: TEMP_FAILURE_RETRY: Define macro if not found.
* io/unix.c (raw_read): Handle EINTR.
(raw_write): Check for return value -1.
(raw_seek): Handle EINTR.
(raw_tell): Likewise.
(raw_size): Likewise.
(raw_truncate): Likewise.
(raw_close): Likewise.
(buf_flush): Call raw_seek instead of lseek.
(buf_read): Likewise.
(buf_write): Likewise.
(fd_to_stream): Handle EINTR.
(tempfile_open): Likewise.
(regular_file2): Likewise.
(compare_file_filename): Likewise.
(find_file): Likewise.
(inquire_sequential): Likewise.
(inquire_direct): Likewise.
(inquire_formatted): Likewise.
From-SVN: r240902
PR tree-optimization/77901
* tree-ssa-reassoc.c (optimize_range_tests_var_bound): Only optimize
if ranges[i].exp is SSA_NAME when looking for >= and only when
ranges[i].exp is NULL or SSA_NAME when looking for the other
comparison.
* gcc.c-torture/compile/pr77901.c: New test.
From-SVN: r240899
2016-10-08 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
* diagnostic-core.h (warning_at_rich_loc_n): Declare.
* diagnostic.c (warning_at_rich_loc_n): New function.
(diagnostic_n_impl_richloc): Likewise.
(diagnostic_n_impl): Move most of the function to
diagnostic_n_impl_richloc and call it.
From-SVN: r240891
* call.c (build_user_type_conversion_1): Consider conversions from
a single element in an initializer-list.
(build_temp): Undo early_elide_copy change.
(build_over_call): Check that we don't try to copy a TARGET_EXPR
in C++17 mode. Set user_conv_p here.
(convert_like_real): Not here.
(check_self_delegation): Split out from...
(build_special_member_call): ...here. Handle C++17 copy elision.
* cvt.c (early_elide_copy): Remove.
(ocp_convert): Undo early_elide_copy change.
* except.c (build_throw): Likewise.
* init.c (expand_default_init): Likewise.
* typeck.c (cp_build_modify_expr): Likewise.
From-SVN: r240889
* c-lex.c (c_lex_with_flags) <case CPP_COMMENT>: For CPP_COMMENT
token with PREV_FALLTHROUGH, skip all following CPP_PADDING and
CPP_COMMENT tokens and set add_flags to PREV_FALLTHROUGH afterwards.
* doc/invoke.texi (-Wimplicit-fallthrough): Document the accepted
FALLTHRU comment styles.
* lex.c (fallthrough_comment_p): Fix off-by-one size comparison
errors, cleanup.
(_cpp_lex_direct): Allow arbitrary comments in between
fallthrough_comment_p comment and following token.
* c-c++-common/Wimplicit-fallthrough-23.c: New test.
* c-c++-common/Wimplicit-fallthrough-24.c: New test.
From-SVN: r240884
2016-10-07 Fritz Reese <fritzoreese@gmail.com>
Fix ICE due to map typespecs with different sized charlens being copied.
gcc/fortran/
* interface.c (compare_components): Check charlen for BT_CHAR.
gcc/testsuite/gfortran.dg/
* dec_union_11.f90: New testcase.
From-SVN: r240875
[gcc]
2016-10-06 Michael Meissner <meissner@linux.vnet.ibm.com>
* config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Split
-mfloat128 into -mfloat128-type that enables the IEEE 128-bit
floating point type infrastructre, and -mfloat128 that enables the
keyword. Define __FLOAT128__ if -mfloat128, and __FLOAT128_TYPE__
if -mfloat128-type. Define __ibm128 to be long double by default.
* config/rs6000/rs6000.c (rs6000_debug_reg_global): Print whether
the IEEE 128-bit floating point type infrastructure should
automatically be enabled.
(rs6000_init_hard_regno_mode_ok): Switch to use -mfloat128-type
instead of -mfloat128 to enable KFmode.
(rs6000_option_override_internal): Split the option -mfloat128
into -mfloat128-type and -mfloat128. On Linux PowerPC 64-bit
systems, automatically set -mfloat128-type, but don't enable it on
other operating systems. Move setting the long double size and
IEEE quad support before the IEEE 128-bit floating point changes.
(rs6000_init_builtins): Do not create a unique type for __ibm128
if long double is IBM extended double, instead rely on __ibm128
being defined as 'long double'. If -mfloat128-type and not
-mfloat128, create the KFmode type with an undocumented __ieee128
keyword.
(rs6000_init_libfuncs): Use -mfloat128-type instead of
-mfloat128 for tests about the types, but keep tests for
-mfloat128 to enable the keyword support.
(rs6000_complex_function_value): Likewise.
(rs6000_scalar_mode_supported_p): Likewise.
(rs6000_floatn_mode): Likewise.
(rs6000_c_mode_for_suffix): Likewise.
(rs6000_opt_masks): Add -mfloat128-type.
* config/rs6000/rs6000-cpus.def (POWERPC_MASKS): Add support for
-mfloat128-type being split from -mfloat128. Add
-mfloat128-hardware, which was missing.
* config/rs6000/rs6000.opt (-mfloat128): Split -mfloat128 into
-mfloat128 and -mfloat128-type:
(-mfloat128-type): Likewise.
* config/rs6000/linux64.h (TARGET_FLOAT128_ENABLE_TYPE): Define so
that 64-bit Linux systems with enable -mfloat128-type by default
on VSX systems.
* config/rs6000/rs6000.h (TARGET_FLOAT128_ENABLE_TYPE): Likewise.
(FLOAT128_VECTOR_P): Switch IEEE 128-bit floating points to use
-mfloat128-type instead of -mfloat128.
(FLOAT128_2REG_P): Likewise.
(MASK_FLOAT128_TYPE): Likewise.
(ALTIVEC_ARG_MAX_RETURN): Likewise.
(RS6000_BTM_FLOAT128): Likewise.
(TARGET_FLOAT128): Poison old identifiers.
(OPTION_MASK_FLOAT128): Likewise.
(MASK_FLOAT128): Likewise.
* config/rs6000/rs6000.md (FP): Likewise.
(FLOAT128): Likewise.
(fix_trunc<mode>di2): Likewise.
(fixuns_trunc<IEEE128:mode><SDI:mode>2): Likewise.
(floatdi<mode>2): Likewise.
(floatuns<SDI:mode><IEEE128:mode>2): Likewise.
(neg<mode>2, FLOAT128 iterator): Likewise.
(abs<mode>2, FLOAT128 iterator): Likewise.
(ieee_128bit_negative_zero): Likewise.
(ieee_128bit_vsx_neg<mode>2): Likewise.
(ieee_128bit_vsx_neg<mode>2_internal): Likewise.
(ieee_128bit_vsx_abs<mode>2): Likewise.
(ieee_128bit_vsx_abs<mode>2_internal): Likewise.
(ieee_128bit_vsx_nabs<mode>2): Likewise.
(ieee_128bit_vsx_nabs<mode>2_internal): Likewise.
(extendiftf2): Likewise.
(extendifkf2): Likewise.
(extendtfkf2): Likewise.
(trunciftf2): Likewise.
(truncifkf2): Likewise.
(trunckftf2): Likewise.
(trunctfif2): Likewise.
(extendkftf2): Likewise.
(trunctfkf2): Likewise.
[gcc/testsuite]
2016-10-06 Michael Meissner <meissner@linux.vnet.ibm.com>
* gcc.target/powerpc/float128-type-1.c: New test to check that
PowerPC 64-bit Linux enables -mfloat128-type by default.
* gcc.target/powerpc/float128-type-2.c: Likewise.
* gcc.target/powerpc/float128-mix.c: Change error message to
reflect that __ibm128 is now #define'ed to be long double.
From-SVN: r240872
2016-10-07 Richard Biener <rguenther@suse.de>
* tree-ssa-propagate.c (replace_phi_args_in): Remove no longer
required hack.
(substitute_and_fold_dom_walker::before_dom_children):
Substitute and fold before pass specific folding to avoid
feeding that with SSA names that will be later released.
* tree-ssa-ccp.c (get_value_for_expr): Guard for new SSA names
introduced by folding and visited by evaluate_stmt called during
ccp_fold_stmt.
(likely_value): Likewise.
(evaluate_stmt): Likewise.
* tree-vrp.c (simplify_truth_ops_using_ranges): Fold modified stmt.
(simplify_div_or_mod_using_ranges): Likewise.
(simplify_min_or_max_using_ranges): Likewise.
(simplify_abs_using_ranges): Likewise.
(simplify_conversion_using_ranges): Likewise.
(simplify_float_conversion_using_ranges): Likewise.
(simplify_stmt_using_ranges): Likewise.
* gcc.dg/tree-ssa/vrp01.c: Adjust.
* gcc.dg/tree-ssa/vrp34.c: Likewise.
From-SVN: r240865
c/
PR c++/69733
* c-decl.c (smallest_type_quals_location): New static function.
(grokdeclarator): Try to find the correct location for an ignored
qualifier.
cp/
PR c++/69733
* decl.c (grokdeclarator): Try to find the correct location for an
ignored qualifier.
testsuite/
PR c++/69733
* c-c++-common/pr69733.c: New test.
* gcc.dg/pr69733.c: New test.
* gcc.target/i386/pr69733.c: New test.
From-SVN: r240863
2016-10-07 Richard Biener <rguenther@suse.de>
* bitmap.c (bitmap_elem_to_freelist): Set indx to -1.
* bitmap.h (bmp_iter_set): When advancing to the next element
check that we didn't remove the current one.
(bmp_iter_and): Likewise.
(bmp_iter_and_compl): Likewise.
* tree-ssa.c (release_defs_bitset): Do not remove worklist bit
we currently iterate on but keep a one-level queue.
* sched-deps.c (remove_from_deps): Do not clear current bit
but keep a one-level queue.
From-SVN: r240859
PR tree-optimization/77664
* tree-ssa-reassoc.c (update_range_test): Also clear low and high
for the other ranges.
(optimize_range_tests_diff): Fix up formatting.
(optimize_range_tests_var_bound): New function.
(optimize_range_tests): Use it.
* gcc.dg/tree-ssa/pr77664.c: New test.
* gcc.dg/pr77664.c: New test.
From-SVN: r240858
2016-10-07 Richard Biener <rguenther@suse.de>
* gimple-low.c (lower_gimple_bind): Clear DECL_CHAIN of
vars in gimple_bind_vars but not in BLOCK_VARS.
From-SVN: r240855
During the lowering phase, the variable arguments to a varargs call are
packaged up into a temporary slice object; the storage for this slice
was being unconditionally allocated on the heap. Heap allocation is not
necessary, however, if the varargs call correspond to an "append", since
the append runtime routine only reads the slice storage (as opposed to
stashing away the storage pointer). Enhance the lowering code to keep
the slice storage on the stack for append() calls, to improve
performance.
Addresses issue golang/go#17304.
Reviewed-on: https://go-review.googlesource.com/30136
From-SVN: r240853
* config/rs6000/rs6000.c (rs6000_elf_asm_out_constructor)
(rs6000_elf_asm_out_destructor): increase size of buf to avoid
possible overflow.
From-SVN: r240852