1. 15 Nov, 2017 35 commits
    • i386: Add X86_TUNE_EMIT_VZEROUPPER · 348188bf
      Add X86_TUNE_EMIT_VZEROUPPER to indicate if vzeroupper instruction should
      be inserted before a transfer of control flow out of the function.  It is
      turned on by default unless we are tuning for KNL.  Users can always use
      -mzeroupper or -mno-zeroupper to override X86_TUNE_EMIT_VZEROUPPER.
      
      gcc/
      
      	PR target/82990
      	* config/i386/i386.c (pass_insert_vzeroupper::gate): Remove
      	TARGET_AVX512ER check.
      	(ix86_option_override_internal): Set MASK_VZEROUPPER if
      	neither -mzeroupper nor -mno-zeroupper is used and
      	TARGET_EMIT_VZEROUPPER is set.
      	* config/i386/i386.h (TARGET_EMIT_VZEROUPPER): New.
      	* config/i386/x86-tune.def: Add X86_TUNE_EMIT_VZEROUPPER.
      
      gcc/testsuite/
      
      	PR target/82990
      	* gcc.target/i386/pr82942-2.c: Add -mtune=knl.
      	* gcc.target/i386/pr82990-1.c: New test.
      	* gcc.target/i386/pr82990-2.c: Likewise.
      	* gcc.target/i386/pr82990-3.c: Likewise.
      	* gcc.target/i386/pr82990-4.c: Likewise.
      	* gcc.target/i386/pr82990-5.c: Likewise.
      	* gcc.target/i386/pr82990-6.c: Likewise.
      	* gcc.target/i386/pr82990-7.c: Likewise.
      
      From-SVN: r254783
      H.J. Lu committed
    • rs6000.c (rs6000_gimple_fold_builtin): Add support for folding of vector compares. · 41e18197
      
      2017-11-15  Will Schmidt  <will_schmidt@vnet.ibm.com>
      
      [gcc]
      
      	* config/rs6000/rs6000.c (rs6000_gimple_fold_builtin): Add support for
      	folding of vector compares.
      	(fold_build_vec_cmp): New helper function.
      	(fold_compare_helper): New helper function.
      	(builtin_function_type): Add compare builtins to the list of functions
      	having unsigned arguments.  Cosmetic updates to comment indentation.
      	* config/rs6000/vsx.md (vcmpneb, vcmpneh, vcmpnew): Update to specify
      	the not+eq combination.
      
      [testsuite]
      
      	* gcc.target/powerpc/builtins-3-p9.c: Add -O1, update
      	expected codegen checks.
      	* gcc.target/powerpc/vec-cmp-sel.c: Mark vars as volatile.
      	* gcc.target/powerpc/vsu/vec-cmpne-0.c: Add -O1.
      	* gcc.target/powerpc/vsu/vec-cmpne-1.c: Add -O1.
      	* gcc.target/powerpc/vsu/vec-cmpne-2.c: Add -O1.
      	* gcc.target/powerpc/vsu/vec-cmpne-3.c: Add -O1.
      	* gcc.target/powerpc/vsu/vec-cmpne-4.c: Add -O1.
      	* gcc.target/powerpc/vsu/vec-cmpne-5.c: Add -O1.
      	* gcc.target/powerpc/vsu/vec-cmpne-6.c: Add -O1.
      
      From-SVN: r254782
      Will Schmidt committed
    • Minor improvements to Filesystem tests · 4e6c4298
      	* testsuite/27_io/filesystem/iterators/directory_iterator.cc: Leave
      	error_code unset.
      	* testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc:
      	Check for past-the-end before dereferencing.
      	* testsuite/experimental/filesystem/iterators/
      	recursive_directory_iterator.cc: Likewise.
      
      From-SVN: r254781
      Jonathan Wakely committed
    • re PR fortran/78240 (ICE in match_clist_expr, at fortran/decl.c:728) · 54b6c06b
      2017-11-15  Steven G. Kargl  <kargl@gcc.gnu.org>
      
      	PR fortran/78240
      	gfortran.dg/pr78240.f90: Prune run-on errors.
      
      From-SVN: r254780
      Steven G. Kargl committed
    • Add noexcept to generic std::size, std::empty and std::data · 19491228
      	* include/bits/range_access.h (size, empty, data): Add conditional
      	noexcept to generic overloads.
      
      From-SVN: r254779
      Jonathan Wakely committed
    • re PR tree-optimization/82726 (ICE in verify_ssa during GIMPLE pass: pcom) · bd9cc42b
      	PR tree-optimization/82726
      	PR tree-optimization/70754
      	* tree-predcom.c (order_drefs_by_pos): New function.
      	(combine_chains): Move code setting has_max_use_after to...
      	(try_combine_chains): ...here.  New parameter.  Sort combined chains
      	according to position information.
      	(tree_predictive_commoning_loop): Update call to above function.
      	(update_pos_for_combined_chains, pcom_stmt_dominates_stmt_p): New.
      
      	gcc/testsuite
      	* gcc.dg/tree-ssa/pr82726.c: New test.
      
      From-SVN: r254778
      Bin Cheng committed
    • re PR tree-optimization/82726 (ICE in verify_ssa during GIMPLE pass: pcom) · 1ad3d8aa
      	PR tree-optimization/82726
      	Revert
      	2017-01-23  Bin Cheng  <bin.cheng@arm.com>
      
      	PR tree-optimization/70754
      	* tree-predcom.c (stmt_combining_refs): New parameter INSERT_BEFORE.
      	(reassociate_to_the_same_stmt): New parameter INSERT_BEFORE.  Insert
      	combined stmt before it if not NULL.
      	(combine_chains): Process refs reversely and compute dominance point
      	for root ref.
      
      	Revert
      	2017-02-23  Bin Cheng  <bin.cheng@arm.com>
      
      	PR tree-optimization/79663
      	* tree-predcom.c (combine_chains): Process refs in reverse order
      	only for ZERO length chains, and add explaining comment.
      
      From-SVN: r254777
      Bin Cheng committed
    • arm-cpus.in (armv8_3, [...]): New · 1ad9b03f
      2017-11-15  Tamar Christina  <tamar.christina@arm.com>
      
              * config/arm/arm-cpus.in (armv8_3, ARMv8_3a, armv8.3-a): New
              * config/arm/arm-tables.opt (armv8.3-a): Regenerated.
              * doc/invoke.texi (ARM Options): Add armv8.3-a.
      
      From-SVN: r254776
      Tamar Christina committed
    • arm.h (TARGET_DOTPROD): Add arm_arch8_2. · 82896b22
      2017-11-15  Tamar Christina  <tamar.christina@arm.com>
      
      	* config/arm/arm.h (TARGET_DOTPROD): Add arm_arch8_2.
      
      From-SVN: r254775
      Tamar Christina committed
    • RISC-V: Add Jim Wilson as a maintainer · f804ba3e
      Jim has recently started working at SiFive, where he'll be contributing
      to our GCC port.  Andrew, Kito and I would like him to be a mainatiner.
      My understand is that this is the right place to ask.
      
      I've also changed my address to my SiFive one, where I also work -- it
      seems cleaner to have everyone use our proper email address.
      
      ChangeLog
      
      2017-11-15  Palmer Dabbelt  <palmer@sifive.com>
      
              * MAINTAINERS (RISC-V): Add Jim Wilson as a maintainer.
              Use my SiFive email address.
      
      From-SVN: r254774
      Palmer Dabbelt committed
    • [ARM] Fix more -Wreturn-type fallout · a53cb18d
      This patch fixes a couple of more tests that are giving out warnings with -Wreturn-type:
      - g++.dg/ext/pr57735.C
      - gcc.target/arm/pr54300.C
      
      *** gcc/testsuite/ChangeLog ***
      
      2017-11-10  Sudakshina Das  <sudi.das@arm.com>
      
              * g++.dg/ext/pr57735.C: Add -Wno-return-type for test.
              * gcc.target/arm/pr54300.C (main): Add return type and
              return a value.
      
      From-SVN: r254773
      Sudakshina Das committed
    • Compile strncpy-fix-1.c with -Wno-stringop-truncation · 519fdbb5
      2017-11-15  Tom de Vries  <tom@codesourcery.com>
      
      	* gcc.dg/strncpy-fix-1.c: Add -Wno-stringop-truncation to dg-options.
      
      From-SVN: r254772
      Tom de Vries committed
    • pr81706.c: Adjust asm for darwin. · 45161185
      2017-11-15  Dominique d'Humieres  <dominiq@lps.ens.fr>
      
      	* gcc.target/i386/pr81706.c: Adjust asm for darwin.
      	* g++.dg/ext/pr81706.C: Likewise.
      
      From-SVN: r254770
      Dominique d'Humieres committed
    • Add libgomp.oacc-c-c++-common/f-asyncwait-{1,2,3}.c · a7cf2612
      2017-11-15  Tom de Vries  <tom@codesourcery.com>
      
      	* testsuite/libgomp.oacc-c-c++-common/f-asyncwait-1.c: New test, copied
      	from asyncwait-1.f90.  Rewrite into C.  Rewrite from float to int.
      	* testsuite/libgomp.oacc-c-c++-common/f-asyncwait-2.c: New test, copied
      	from asyncwait-2.f90.  Rewrite into C.  Rewrite from float to int.
      	* testsuite/libgomp.oacc-c-c++-common/f-asyncwait-3.c: New test, copied
      	from asyncwait-3.f90.  Rewrite into C.  Rewrite from float to int.
      
      From-SVN: r254769
      Tom de Vries committed
    • [PR c++/81574] lambda capture of function reference · 03ab2eb7
      https://gcc.gnu.org/ml/gcc-patches/2017-11/msg01200.html
      	PR c++/81574
      	* lambda.c (lambda_capture_field_type): Function references are
      	always catured by reference.
      
      	PR c++/81574
      	* g++.dg/cpp1y/pr81574.C: New.
      
      From-SVN: r254768
      Nathan Sidwell committed
    • re PR tree-optimization/82985 (ICC: in vn_nary_build_or_lookup_1, at tree-ssa-sccvn.c:1722) · 17bae2ca
      2017-11-15  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/82985
      	* g++.dg/torture/pr82985.C: Likewise.
      
      From-SVN: r254767
      Richard Biener committed
    • Fix fallout of -fsanitize=vptr. · 86a9e738
      2017-11-15  Martin Liska  <mliska@suse.cz>
      
      	* decl.c (begin_destructor_body): Use cp_build_fold_indirect_ref
      	instead of cp_build_indirect_ref.
      
      From-SVN: r254765
      Martin Liska committed
    • Disable -Wreturn-type by default in all languages other from C++. · 134d2354
      2017-11-15  Martin Liska  <mliska@suse.cz>
      
      	* tree-cfg.c (pass_warn_function_return::execute):
      	Compare warn_return_type for greater than zero.
      2017-11-15  Martin Liska  <mliska@suse.cz>
      
      	* options.c (gfc_post_options):
      	Do not set default value of warn_return_type.
      	* trans-decl.c (gfc_trans_deferred_vars):
      	Compare warn_return_type for greater than zero.
      	(generate_local_decl): Likewise
      	(gfc_generate_function_code): Likewise.
      
      From-SVN: r254764
      Martin Liska committed
    • Fix PR82941 and PR82942 by adding proper vzeroupper generation on SKX. · e6f146d2
      2017-11-15  Sebastian Peryt  <sebastian.peryt@intel.com>
      
      gcc/
      
      	PR target/82941
      	PR target/82942
      	* config/i386/i386.c (pass_insert_vzeroupper): Modify gate condition
      	to return true on Xeon and not on Xeon Phi.
      	(ix86_check_avx256_register): Changed to ...
      	(ix86_check_avx_upper_register): ... this. Add extra check for
      	VALID_AVX512F_REG_OR_XI_MODE.
      	(ix86_avx_u128_mode_needed): Changed
      	ix86_check_avx256_register to ix86_check_avx_upper_register.
      	(ix86_check_avx256_stores): Changed to ...
      	(ix86_check_avx_upper_stores): ... this. Changed
      	ix86_check_avx256_register to ix86_check_avx_upper_register.
      	(ix86_avx_u128_mode_after): Changed
      	avx_reg256_found to avx_upper_reg_found. Changed
      	ix86_check_avx256_stores to ix86_check_avx_upper_stores.
      	(ix86_avx_u128_mode_entry): Changed
      	ix86_check_avx256_register to ix86_check_avx_upper_register.
      	(ix86_avx_u128_mode_exit): Ditto.
      	* config/i386/i386.h: (host_detect_local_cpu): New define.
      
      2017-11-15  Sebastian Peryt  <sebastian.peryt@intel.com>
      	
      gcc/testsuite/
      
      	PR target/82941
      	PR target/82942
      	* gcc.target/i386/pr82941-1.c: New test.
      	* gcc.target/i386/pr82941-2.c: New test.
      	* gcc.target/i386/pr82942-1.c: New test.
      	* gcc.target/i386/pr82942-2.c: New test.
      
      From-SVN: r254763
      Sebastian Peryt committed
    • MAINTAINERS (write after approval): Add myself. · 8744c9bf
      * MAINTAINERS (write after approval): Add myself.
      
      From-SVN: r254762
      Sebastian Peryt committed
    • Fix -Wreturn-type fallout in g++.dg/cpp0x/rv-trivial-bug.C on Solaris 10 · f46e6332
      	* g++.dg/cpp0x/rv-trivial-bug.C (test2): Return a value.
      
      From-SVN: r254760
      Rainer Orth committed
    • [AArch64] Improve scheduling model for X-Gene · 1e46ecae
      2017-11-15  Dominik Infuehr  <dominik.infuehr@theobroma-systems.com>
      
      	* config/arm/xgene1.md (xgene1): Split into automatons
      	xgene1_main, xgene1_decoder, xgene1_div, xgene1_simd.
      	(xgene1_f_load): Adjust reservations and/or types.
      	(xgene1_f_store): Likewise.
      	(xgene1_load_pair): Likewise.
      	(xgene1_store_pair): Likewise.
      	(xgene1_fp_load1): Likewise.
      	(xgene1_load1): Likewise.
      	(xgene1_store1): Likewise.
      	(xgene1_move): Likewise.
      	(xgene1_alu): Likewise.
      	(xgene1_simd): Likewise.
      	(xgene1_bfm): Likewise.
      	(xgene1_neon_load1): Likewise.
      	(xgene1_neon_store1): Likewise.
      	(xgene1_neon_logic): Likewise.
      	(xgene1_neon_st1): Likewise.
      	(xgene1_neon_ld1r): Likewise.
      	(xgene1_alu_cond): Added.
      	(xgene1_shift_reg): Likwise.
      	(xgene1_bfx): Likewise.
      	(xgene1_mul): Split into xgene1_mul32, xgene1_mul64.
      
      From-SVN: r254759
      Dominik Infuehr committed
    • re PR target/82981 (unnecessary __multi3 call for mips64r6 linux kernel) · 0b99f253
      	PR target/82981
      	* internal-fn.c: Include gimple-ssa.h, tree-phinodes.h and
      	ssa-iterators.h.
      	(can_widen_mult_without_libcall): New function.
      	(expand_mul_overflow): If only checking unsigned mul overflow,
      	not result, and can do efficiently MULT_HIGHPART_EXPR, emit that.
      	Don't use WIDEN_MULT_EXPR if it would involve a libcall, unless
      	no other way works.  Add MULT_HIGHPART_EXPR + MULT_EXPR support.
      	(expand_DIVMOD): Formatting fix.
      	* expmed.h (expand_mult): Add NO_LIBCALL argument.
      	* expmed.c (expand_mult): Likewise.  Use OPTAB_WIDEN rather
      	than OPTAB_LIB_WIDEN if NO_LIBCALL is true, and allow it to fail.
      
      	* gcc.target/mips/pr82981.c: New test.
      
      From-SVN: r254758
      Jakub Jelinek committed
    • re PR tree-optimization/82977 (AddressSanitizer: heap-use-after-free in… · 65205a11
      re PR tree-optimization/82977 (AddressSanitizer: heap-use-after-free in strlen_optimize_stmt .././../gcc/tree-ssa-strlen.c:2971)
      
      	PR tree-optimization/82977
      	* tree-ssa-strlen.c (strlen_optimize_stmt): Pass a reference to a copy
      	constructed temporary to strlen_to_stridx.put.
      
      From-SVN: r254757
      Jakub Jelinek committed
    • Coverage: remove -fkeep-inline-functions from coverage_flags. · 9879232c
      2017-11-15  Martin Liska  <mliska@suse.cz>
      
      	* configure.ac: Remove -fkeep-inline-functions from coverage_flags.
      	* configure: Regenerate.
      
      From-SVN: r254756
      Martin Liska committed
    • Use proper probability (PR target/82927) · 6463f681
      2017-11-15  Martin Liska  <mliska@suse.cz>
      
      	PR target/82927
      	* config/sh/sh-mem.cc: Use proper probability for
      	REG_BR_PROB_NOTE.
      
      From-SVN: r254755
      Martin Liska committed
    • Zero vptr in dtor for -fsanitize=vptr. · 896f6b3d
      2017-11-15  Martin Liska  <mliska@suse.cz>
      
      	* decl.c (begin_destructor_body): In case of VPTR sanitization
      	(with disabled recovery), zero vptr in order to catch virtual calls
      	after lifetime of an object.
      2017-11-15  Martin Liska  <mliska@suse.cz>
      
      	* g++.dg/ubsan/vptr-12.C: New test.
      
      From-SVN: r254754
      Martin Liska committed
    • explow.c (anti_adjust_stack_and_probe_stack_clash): Avoid probing the red zone… · 2a6fc987
      explow.c (anti_adjust_stack_and_probe_stack_clash): Avoid probing the red zone for stack_clash_protection_final_dynamic_probe...
      
      	* explow.c (anti_adjust_stack_and_probe_stack_clash): Avoid probing
      	the red zone for stack_clash_protection_final_dynamic_probe targets
      	when the total dynamic stack size is zero bytes.
      
      From-SVN: r254753
      Jeff Law committed
    • tree-ssa-threadupdate.c (thread_through_all_blocks): Thread blocks is post order. · 611a7c7e
      	* tree-ssa-threadupdate.c (thread_through_all_blocks): Thread
      	blocks is post order.
      
      From-SVN: r254752
      Jeff Law committed
    • introduce TDF_compare_debug, omit OBJ_TYPE_REF casts with it · 171a55e7
      for  gcc/ChangeLog
      
      	* dumpfile.h (TDF_COMPARE_DEBUG): New.
      	* final.c (rest_of_clean_state): Set it for the
      	-fcompare-debug dump.
      	* tree-pretty-print.c (dump_generic_node): Omit OBJ_TYPE_REF
      	class when TDF_COMPARE_DEBUG is set.
      
      From-SVN: r254751
      Alexandre Oliva committed
    • Use compare-debug for bootstrap-debug-lean to ignore != DW_AT_producer · 3267bd36
      Unlike bootstrap-debug, bootstrap-debug-lean used to pass compare using
      the traditional compare command, because it compiled both stage2 and
      stage3 with options that used to generate identical output
      (-fcompare-debug= in stage2 vs -fcompare-debug in stage3).
      
      Since we started adding relevant command-line flags to DW_AT_producer,
      this is no longer the case, and stages 2 and 3 object files that differ
      in nothing but the DW_AT_producer strings.
      
      
      -fcompare-debug is short for -fcompare-debug=-gtoggle, so stage3
      compiles twice, once with the normal options, once with toggled -g, to
      then compare the temporary final dumps.  When enabled, both compilations
      get from the driver an additional -frandom-seed flag (if none is given
      explicitly).
      
      -fcompare-debug= is short for -fno-compare-debug, disabling the second
      compilation.
      
      
      The difference between the DW_AT_producer lines are the different
      -fcompare-debug flags, and the presence of the -frandom-seed flag in the
      stage3 compilation.
      
      It is easy and sensible enough to filter the -fcompare-debug flags out
      of the DW_AT_producer string.  This option should never affect the
      compilation output, it just determines whether or not to perform an
      additional compilation that should produce the same executable output.
      
      However, dropping -frandom-seed is not quite correct, in that it might
      have other consequences on the compilation.  So, it makes little sense
      to make the effort to drop it when it's implicit; for those comparing
      compiler output differences, it might even hint at what causes, and
      could fix, difficult to explain differences, namely, explicitly
      supplying -frandom-seed options.
      
      They don't seem to matter for compiler bootstraps, though, at least
      for now, so we can safely refrain from issuing -frandom-seed (or maybe
      we already issue it where needed :-), and then, for
      bootstrap-debug-lean, use the compare-debug script, that strips out
      debug information before comparing the object files.
      
      
      for  config/ChangeLog
      
      	* bootstrap-debug-lean.mk (do-compare): Use the
      	contrib/compare-debug script.
      
      for  gcc/ChangeLog
      
      	* dwarf2out.c (gen_producer_string): Discard
      	OPT_fcompare_debug.
      
      From-SVN: r254750
      Alexandre Oliva committed
    • Add __builtin_tgmath for better tgmath.h implementation (bug 81156). · 3ca0dc60
      Various implementations of C99/C11 <tgmath.h> have the property that
      their macro expansions contain many copies of the macro arguments, so
      resulting in exponential blowup of the size of macro expansions where
      a call to such a macro contains other such calls in the macro
      arguments.
      
      This patch adds a (C-only) language feature __builtin_tgmath designed
      to avoid this problem by implementing the <tgmath.h> function
      selection rules directly in the compiler.  The effect is that
      type-generic macros can be defined simply as
      
      #define pow(a, b) __builtin_tgmath (powf, pow, powl, \
                                          cpowf, cpow, cpowl, a, b)
      
      as in the example added to the manual, with each macro argument
      expanded exactly once.  The details of __builtin_tgmath are as
      described in the manual.  This is C-only since C++ uses function
      overloading and just defines <ctgmath> to include <ccomplex> and
      <cmath>.
      
      __builtin_tgmath handles C99/C11 type-generic macros, and _FloatN,
      _FloatNx and decimal floating-point types (following the proposed
      resolution to the floating-point TS DR#9 that makes the rules for
      finding a common type from arguments to a type-generic macro follow
      the usual arithmetic conversions after adjustment of integer arguments
      to _Decimal64 or double - or to _Complex double in the case of GNU
      complex integer arguments).
      
      Type-generic macros for functions from TS 18661 that round their
      results to a narrower type are handled, but there are still some
      unresolved questions regarding such macros so further changes in that
      regard may be needed in future.  The current implementation follows an
      older version of the DR#13 resolution (allowing a function for a
      wide-enough argument type to be selected if no exactly-matching
      function is available), but with appropriate calls to __builtin_tgmath
      is still fully compatible with the latest version of the resolution
      (not yet in the DR log), and allowing such not-exactly-matching
      argument types to be chosen in that case avoids needing another
      special case to treat integers as _Float64 instead of double in
      certain cases.
      
      Regarding other possible language/library features, not currently
      implemented in GCC:
      
      * Imaginary types could be naturally supported by allowing cases where
        the type-generic type is an imaginary type T and arguments or return
        types may be T (as at present), or the corresponding real type to T
        (as at present), or (new) the corresponding real type if T is real
        or imaginary but T if T is complex.  (tgmath.h would need a series
        of functions such as
      
        static inline _Imaginary double
        __sin_imag (_Imaginary double __x)
        {
          return _Imaginary_I * sinh (__imag__ __x);
        }
      
        to be used in __builtin_tgmath calls.)
      
      * __builtin_tgmath would use the constant rounding direction in the
        presence of support for the FENV_ROUND / FENV_DEC_ROUND pragmas.
        Support for those would also require a new __builtin_<something> to
        cause a non-type-generic call to use the constant rounding
        direction (it seems cleaner to add a new __builtin_<something> when
        required than to make __builtin_tgmath handle a non-type-generic
        case with only one function argument).
      
      * TS 18661-5 __STDC_TGMATH_OPERATOR_EVALUATION__ would require new
        __builtin_<something> that evaluates with excess range and precision
        like arithmetic operators do.
      
      * The proposed C bindings for IEEE 754-2018 augmented arithmetic
        operations involve struct return types.  As currently implemented
        __builtin_tgmath does not handle those, but support could be added.
      
      There are many error cases that the implementation diagnoses.  I've
      tried to ensure reasonable error messages for erroneous uses of
      __builtin_tgmath, but the errors for erroneous uses of the resulting
      type-generic macros (that is, when the non-function arguments have
      inappropriate types) are more important as they are more likely to be
      seen by users.
      
      GCC's own tgmath.h, as used for some targets, is updated in this
      patch.  I've tested those changes minimally, via adjusting
      gcc.dg/c99-tgmath-* locally to use that tgmath.h version.  I've also
      run the glibc testsuite (which has much more thorough tests of
      correctness of tgmath.h function selection) with a glibc patch to use
      __builtin_tgmath in glibc's tgmath.h.
      
      Bootstrapped with no regressions on x86_64-pc-linux-gnu.
      
      	PR c/81156
      
      gcc:
      	* doc/extend.texi (Other Builtins): Document __builtin_tgmath.
      	* ginclude/tgmath.h (__tg_cplx, __tg_ldbl, __tg_dbl, __tg_choose)
      	(__tg_choose_2, __tg_choose_3, __TGMATH_REAL_1_2)
      	(__TGMATH_REAL_2_3): Remove macros.
      	(__TGMATH_CPLX, __TGMATH_CPLX_2, __TGMATH_REAL, __TGMATH_REAL_2)
      	(__TGMATH_REAL_3, __TGMATH_CPLX_ONLY): Define using
      	__builtin_tgmath.
      	(frexp, ldexp, nexttoward, scalbn, scalbln): Define using
      	__TGMATH_REAL_2.
      	(remquo): Define using __TGMATH_REAL_3.
      
      gcc/c:
      	* c-parser.c (check_tgmath_function): New function.
      	(enum tgmath_parm_kind): New enum.
      	(c_parser_postfix_expression): Handle __builtin_tgmath.
      
      gcc/c-family:
      	* c-common.c (c_common_reswords): Add __builtin_tgmath.
      	* c-common.h (enum rid): Add RID_BUILTIN_TGMATH.
      
      gcc/testsuite:
      	* gcc.dg/builtin-tgmath-1.c, gcc.dg/builtin-tgmath-2.c,
      	gcc.dg/builtin-tgmath-err-1.c, gcc.dg/builtin-tgmath-err-2.c,
      	gcc.dg/dfp/builtin-tgmath-dfp-err.c,
      	gcc.dg/dfp/builtin-tgmath-dfp.c: New tests.
      
      From-SVN: r254749
      Joseph Myers committed
    • compiler: remove LHS/RHS context determination for var exprs · f60bea11
          
          Remove the code that determined LHS/RHS context for var expressions
          (was needed previously for some instances of the back end). LHS/RHS
          context is computed by the back end in all cases, so no need to have
          this code in the front end any more.
          
          Reviewed-on: https://go-review.googlesource.com/77510
      
      	* go-gcc.cc (var_expression): Remove Varexpr_context parameter.
      
      From-SVN: r254748
      Than McIntosh committed
    • vr-values.c: New file with contents extracted from tree-vrp.c. · c2ad9885
      	* vr-values.c: New file with contents extracted from tree-vrp.c.
      	* Makefile.in (OBJS): Add vr-values.o
      	* tree-vrp.h (set_value_range_to_nonnull): Prototype.
      	(set_value_range, set_and_canonicalize_value_range): Likewise.
      	(vrp_bitmap_equal_p, range_is_nonnull): Likewise.
      	(value_range_constant_singleton, symbolic_range_p): Likewise.
      	(compare_values, compare_values_warnv, vrp_val_is_min): Likewise.
      	(vrp_val_is_max, copy_value_range, set_value_range_to_value): Likewise.
      	(extract_range_from_binary_expr_1, vrp_val_min, vrp_val_max): Likewise.
      	(set_value_range_to_null, range_int_cst_p, opreand_less_p): Likewise.
      	(find_case_label_range, find_case_label_index): Likewise.
      	(zero_nonzero_bits_from_vr, overflow_comparison_p): Likewise.
      	(range_int_cst_singleton_p, value_inside_range): Likewise.
      	(get_single_symbol): Likewise.
      	(switch_update): Move structure definition here.
      	(to_remove_edges, to_update_switch_stmts): Provide externs.
      	* tree-vrp.c: Move all methods for vr-values class to vr-values.c
      	(vrp_val_max, vrp_val_min, vrp_val_is_max): Make externally visible.
      	(vrp_val_is_min, set_value_range): Likewise.
      	(set_and_canonicalize_value_range, copy_value_range): Likewise.
      	(set_value_range_to_value, set_value_range_to_nonnull): Likewise.
      	(set_value_range_to_null, vrp_bitmap_equal_p): Likewise.
      	(range_is_nonnull, range_int_cst_p): Likewwise.
      	(range_int_cst_singleton_p, symbolic_range_p): Likewise.
      	(get_single_symbol, operand_less_p): Likewise
      	(compare_values_warnv, compare_values): Likewise.
      	(value_inside_range, value_range_constant_singleton): Likewise.
      	(zero_nonzero_bitgs_from_vr): Likewise.
      	(extract_range_from_binary_expr_1): Likewise.
      	(overflow_comparison_p): Likewise.
      	(to_remove_edges, to_update_switch_stmts): Likewise.
      	(find_case_label-index, find_case_label_range): Likewise.
      	(switch_update, set_value_range_to_nonnegative): Remove.
      	(set_value_range_to_truthvalue): Likewise.
      	(symbolic_range_based_on_p, gimple_assign_nonzero_p): Likewise.
      	(gimple_stmt_nonzero_p, compare_ranges): Likewise.
      	(compare_range_with_value, vrp_valueize, vrp_valueize_1): Likewise.
      	(find_case_label_ranges, test_for_singularity): Likewise.
      	(range_fits_type_p, simplify_conversion_using_ranges): LIkewise.
      	(x_vr_values): Move to its remaining use site.
      
      From-SVN: r254747
      Jeff Law committed
    • Daily bump. · 09ef7f4e
      From-SVN: r254746
      GCC Administrator committed
  2. 14 Nov, 2017 5 commits
    • rs6000.md (bswapdi2): On 32-bit ISA 3.0, don't generate the XXBRD instruction. · ec0c1fab
      2017-11-14  Michael Meissner  <meissner@linux.vnet.ibm.com>
      
      	* config/rs6000/rs6000.md (bswapdi2): On 32-bit ISA 3.0, don't
      	generate the XXBRD instruction.
      
      From-SVN: r254742
      Michael Meissner committed
    • rs6000-c.c (is_float128_p): New helper function. · cdb4b7aa
      [gcc]
      2017-11-14  Michael Meissner  <meissner@linux.vnet.ibm.com>
      
      	* config/rs6000/rs6000-c.c (is_float128_p): New helper function.
      	(rs6000_builtin_type_compatible): Treat _Float128 and long double
      	as being compatible if -mabi=ieeelongdouble.
      	* config/rs6000/rs6000-builtin.def (BU_FLOAT128_HW_1): New macros
      	to setup float128 built-ins with hardware support.
      	(BU_FLOAT128_HW_2): Likewise.
      	(BU_FLOAT128_HW_3): Likewise.
      	(BU_FLOAT128_HW_VSX_1): Likewise.
      	(BU_FLOAT128_HW_VSX_2): Likewise.
      	(scalar_extract_expq): Change float128 built-in functions to
      	accommodate having both KFmode and TFmode functions.  Use the
      	KFmode variant as the default.
      	(scalar_extract_sigq): Likewise.
      	(scalar_test_neg_qp): Likewise.
      	(scalar_insert_exp_q): Likewise.
      	(scalar_insert_exp_qp): Likewise.
      	(scalar_test_data_class_qp): Likewise.
      	(sqrtf128_round_to_odd): Delete processing the round to odd
      	built-in functions as special built-in functions, and define them
      	as float128 built-ins.  Use the KFmode variant as the default.
      	(truncf128_round_to_odd): Likewise.
      	(addf128_round_to_odd): Likewise.
      	(subf128_round_to_odd): Likewise.
      	(mulf128_round_to_odd): Likewise.
      	(divf128_round_to_odd): Likewise.
      	(fmaf128_round_to_odd): Likewise.
      	* config/rs6000/rs6000.c (rs6000_expand_binop_builtin): Add
      	support for KFmode and TFmode xststdcqp calls.
      	(rs6000_expand_builtin): If long double is IEEE 128-bit floating
      	point, switch the built-in handlers for the get/set float128
      	exponent, get float128 mantissa, float128 test built-ins, and the
      	float128 round to odd built-in functions.  Eliminate creating the
      	float128 round to odd built-in functions as special built-ins.
      	(rs6000_init_builtins): Eliminate special creation of the float128
      	round to odd built-in functions.
      	* config/rs6000/vsx.md (xsxexpqp_<mode>): Change float128 built-in
      	function insns to support both TFmode and KFmode variants.
      	(xsxsigqp_<mode>): Likewise.
      	(xsiexpqpf_<mode>): Likewise.
      	(xsiexpqp_<mode>): Likewise.
      	(xststdcqp_<mode>): Likewise.
      	(xststdcnegqp_<mode>): Likewise.
      	(xststdcqp_<mode>): Likewise.
      
      [gcc/testsuite]
      2017-11-14  Michael Meissner  <meissner@linux.vnet.ibm.com>
      
      	* gcc.target/powerpc/float128-hw4.c: New test.
      
      From-SVN: r254740
      Michael Meissner committed
    • tree-ssa-threadupdate.c (compute_path_counts): Remove unused path_in_freq_ptr parameter. · 9684f222
      
      	* tree-ssa-threadupdate.c (compute_path_counts): Remove
      	unused path_in_freq_ptr parameter.
      	(ssa_fix_duplicate_block_edges): Do not pass around path_in_freq
      
      From-SVN: r254739
      Jan Hubicka committed
    • ipa-inline.c (edge_badness): Dump sreal frequency. · 30632c7a
      
      	* ipa-inline.c (edge_badness): Dump sreal frequency.
      	(compute_inlined_call_time): Match natural implementaiton ...
      	* ipa-fnsummary.c (estimate_edge_size_and_time): ... here; remove
      	forgotten division by CGRAPH_FREQ_BASE.
      
      From-SVN: r254738
      Jan Hubicka committed
    • Adapt Solaris 12 references · f021f1d3
      	libgcc:
      	* config.host (*-*-solaris2*): Adapt comment for Solaris 12
      	renaming.
      	* config/sol2/crtpg.c (__start_crt_compiler): Likewise.
      	* configure.ac (libgcc_cv_solaris_crts): Likewise.
      	* configure: Regenerate.
      
      	gcc:
      	* config.gcc (*-*-solaris2*): Enable default_use_cxa_atexit since
      	Solaris 11.  Update comment.
      	* configure.ac (gcc_cv_ld_pid): Adapt comment for Solaris 12
      	renaming.
      	* config/sol2.h (STARTFILE_SPEC): Likewise.
      	* configure: Regenerate.
      
      	gcc/testsuite:
      	* lib/target-supports.exp (check_effective_target_pie): Adapt
      	comment for Solaris 12 renaming.
      
      	* gcc.dg/torture/pr60092.c: Remove *-*-solaris2.11* dg-xfail-run-if.
      
      From-SVN: r254737
      Rainer Orth committed