1. 20 Sep, 2016 26 commits
  2. 19 Sep, 2016 14 commits
    • re PR c++/77434 (warn about suspicious precedence of ternary operator (?:)) · 144a96e4
      gcc:
      2016-09-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
      
              PR c++/77434
              * doc/invoke.texi: Document -Wint-in-bool-context.
      
      c-family:
      2016-09-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
      
              PR c++/77434
              * c.opt (Wcond-in-bool-context): New warning.
              * c-common.c (c_common_truthvalue_conversion): Warn on integer
              constants in boolean context.
      
      cp:
      2016-09-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
      
              PR c++/77434
              * cvt.c (cp_convert_and_check): Suppress Wint-in-bool-context here.
      
      testsuite:
      2016-09-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
      
              PR c++/77434
              * c-c++-common/Wint-in-bool-context.c: New test.
      
      From-SVN: r240251
      Bernd Edlinger committed
    • re PR other/77421 (Bugs found in GCC with the help of PVS-Studio) · 3385d437
      2016-09-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
      
              PR middle-end/77421
              * dwarf2out.c (output_loc_operands): Fix an assertion.
      
      From-SVN: r240250
      Bernd Edlinger committed
    • Define TS 18661-1 CR_DECIMAL_DIG in <float.h>. · 1f2071fa
      TS 18661-1 defines a macro CR_DECIMAL_DIG in <float.h>, for the number
      of decimal digits for which conversions between decimal character
      strings and (IEEE) binary formats, in both directions, are correctly
      rounded.  This patch implements support for this macro in GCC's
      <float.h>.
      
      The definition __UINTMAX_MAX__ is the right one for GCC's conversions
      of floating constants, since I made those use MPFR to make them
      correctly rounding.  The macro also covers standard library functions
      such as strtod and printf.  The definition is also correct for current
      glibc.  If any targets' libcs support correct rounding in a way that
      conforms to TS 18661-1 with a smaller value of CR_DECIMAL_DIG, making
      <float.h> reflect that could not be done in isolation without changes
      to the interpretation of floating constants as well, since a smaller
      CR_DECIMAL_DIG requires double rounding of floating constants (first
      to CR_DECIMAL_DIG decimal digits, then to the desired binary format).
      
      Boostrapped with no regressions on x86_64-pc-linux-gnu.
      
      gcc:
      	* ginclude/float.h [__STDC_WANT_IEC_60559_BFP_EXT__]
      	(CR_DECIMAL_DIG): New macro.
      
      gcc/testsuite:
      	* gcc.dg/cr-decimal-dig-1.c: New test.
      
      From-SVN: r240249
      Joseph Myers committed
    • Make max_align_t respect _Float128. · 63012d9a
      The _FloatN, _FloatNx, _DecimalN and _DecimalNx types are specified in
      such a way that they are basic types, meaning that max_align_t must be
      at least as aligned as those types.
      
      On 32-bit x86, max_align_t is currently 8-byte aligned, but
      _Decimal128 and _Float128 are 16-byte aligned, so the alignment of
      max_align_t needs to increase to meet the standard requirements for
      these types.
      
      This patch implements such an increase.  Because max_align_t needs to
      be usable for C++ as well as for C, <stddef.h> can't actually refer to
      _Float128, but needs to use __float128 (or some other notation for the
      type) instead.  And since __float128 is architecture-specific, there
      isn't a preprocessor conditional that means "__float128 is available"
      (whereas one could test __FLT128_MANT_DIG__ to see if _Float128 is
      available; __SIZEOF_FLOAT128__ is available on x86 only).  But I
      believe the only case that actually has an alignment problem here is
      32-bit x86, and <stddef.h> already has lots of conditional specific to
      particular architectures or OSes, so this patch uses a conditional on
      __i386__; that also is the minimal change that ensures neither size
      nor alignment of max_align_t is changed in any case other than where
      it is necessary.  If any other architectures turn out to have such an
      issue, it will show up as failures of one of the testcases added by
      this patch.
      
      Such an increase is of course an ABI change, but a reasonably safe
      one, in that max_align_t doesn't tend to appear in library interfaces
      (rather, it's something to use when writing allocators and similar
      code; most matches found on codesearch.debian.net look like copies of
      the gnulib stddef.h module rather than anything actually using
      max_align_t at all).
      
      max_align_t_align has a corresponding change (adding _Float128 to the
      types considered).
      
      (I think glibc malloc alignment should also increase to 16-byte on
      32-bit x86 so it works for allocating objects of these types, which is
      now straightforward given the fix made for 32-bit powerpc.)
      
      Bootstrapped with no regressions on x86_64-pc-linux-gnu, and
      spot-tested with -m32 that the new float128-align.c test now compiles
      where previously it didn't.
      
      gcc:
      	* ginclude/stddef.h (max_align_t) [__i386__]: Add __float128
      	element.
      
      gcc/c-family:
      	* c-common.c (max_align_t_align): Also consider alignment of
      	float128_type_node.
      
      gcc/testsuite:
      	* gcc.dg/float128-align.c, gcc.dg/float128x-align.c,
      	gcc.dg/float16-align.c, gcc.dg/float32-align.c,
      	gcc.dg/float32x-align.c, gcc.dg/float64-align.c,
      	gcc.dg/float64x-align.c, gcc.dg/floatn-align.h: New tests.
      
      From-SVN: r240248
      Joseph Myers committed
    • re PR rtl-optimization/77416 (LRA rematerializing use of CA reg across function call) · 02410826
      2016-09-19  Vladimir Makarov  <vmakarov@redhat.com>
      
      	PR rtl-optimization/77416
      	* lra-remat.c (operand_to_remat): Process hard coded insn
      	registers.
      
      2016-09-19  Vladimir Makarov  <vmakarov@redhat.com>
      
      	PR rtl-optimization/77416
      	* gcc.target/powerpc/pr77416.c: New.
      
      From-SVN: r240247
      Vladimir Makarov committed
    • Fix PR c++/77639 (ICE during error recovery) · 6101a7ab
      gcc/cp/ChangeLog:
      
      	PR c++/77639
      	* parser.c (cp_parser_class_head): When
      	processing_template_parmlist, don't assume that the
      	class-head may start an explicit specialization.
      
      gcc/testsuite/ChangeLog:
      
      	PR c++/77639
      	* g++.dg/template/error-recovery4.C: New test.
      
      From-SVN: r240245
      Patrick Palka committed
    • libstdc++/77645 fix deque and vector xmethods for Python 3 · d0f59435
      	PR libstdc++/77645
      	* python/libstdcxx/v6/xmethods.py (DequeWorkerBase.__init__)
      	(DequeWorkerBase.index, VectorWorkerBase.get): Cast results of
      	division to int to work with Python 3.
      
      From-SVN: r240241
      Jonathan Wakely committed
    • pr57558-1.c: Use unsigned int instead of unsigned long. · 1993ff76
      	gcc/testsuite
      	* gcc.dg/vect/pr57558-1.c: Use unsigned int instead of unsigned long.
      
      From-SVN: r240239
      Bin Cheng committed
    • [simplify-rtx] (GTU (PLUS a C) (C - 1)) --> (LTU a -C) · 5fa9e644
      	* simplify-rtx.c (simplify_relational_operation_1): Add transformation
      	(GTU (PLUS a C) (C - 1)) --> (LTU a -C).
      
      	* gcc.target/aarch64/gtu_to_ltu_cmp_1.c: New test.
      	* gcc.target/aarch64/gtu_to_ltu_cmp_2.c: New test.
      
      From-SVN: r240238
      Kyrylo Tkachov committed
    • Make libstdc++ tests FAIL on Python errors · ee1ab3e3
      	* testsuite/lib/gdb-test.exp (gdb-test): Fail if Python error occurs.
      
      From-SVN: r240237
      Jonathan Wakely committed
    • Fix lra_p text · f37cb70b
      
      	* target.def (lra_p): Wordsmithing.
      	* doc/tm.texi: Regenerate.
      
      From-SVN: r240236
      Segher Boessenkool committed
    • Improve pretty printer for std::variant · a0a1009a
      	* python/libstdcxx/v6/printers.py (SingleObjContainerPrinter): Allow
      	display_hint to be set by subclasses.
      	(StdVariantPrinter): Use array for display_hint. Adjust output to be
      	more similar to std::any and std::optional output.
      	(register_type_printers): Add type printers for basic_string_view
      	typedefs and experimental::any. Adjust type printers for
      	fundamentals_v1 templates to match fundamentals_v2 and later.
      	* testsuite/libstdc++-prettyprinters/cxx17.cc: New.
      
      From-SVN: r240234
      Jonathan Wakely committed
    • libstdc++/77645 Fix xmethods for std::list · 019270bc
      	PR libstdc++/77645
      	* python/libstdcxx/v6/xmethods.py (DequeWorkerBase.index): Rename
      	argument.
      	(ListWorkerBase.get_value_from_node): Define new method.
      	(ListFrontWorker.__call__, ListBackWorker.__call__): Use it.
      
      From-SVN: r240233
      Jonathan Wakely committed
    • re PR ipa/77587 (C compiler produces incorrect stack alignment with __attribute__((weak))) · fc15d9ec
      	PR target/77587
      	* cgraph.c (cgraph_node::rtl_info): Pass &avail to
      	ultimate_alias_target call, return NULL if avail < AVAIL_AVAILABLE.
      	Call ultimate_alias_target just once, not up to 4 times.
      
      	* gcc.dg/pr77587.c: New test.
      	* gcc.dg/pr77587a.c: New file.
      
      Co-Authored-By: Jan Hubicka <jh@suse.cz>
      
      From-SVN: r240232
      Jakub Jelinek committed