Re: [C++ PATCH] For -gdwarf-5 emit DW_TAG_variable instead of DW_TAG_member for C++ static data members

2017-02-18 Thread Jakub Jelinek
On Fri, Feb 17, 2017 at 09:37:09PM -0500, Jason Merrill wrote:
> On Fri, Feb 17, 2017 at 1:52 PM, Jakub Jelinek  wrote:
> > -  && die->die_tag != DW_TAG_member)
> > +  && die->die_tag != DW_TAG_member
> > +  && (die->die_tag != DW_TAG_variable || !class_scope_p 
> > (die->die_parent)))
> 
> How about we only check class_scope_p (die->die_parent), and don't
> consider the TAG at all?  DW_TAG_member should only appear at class
> scope.

That wouldn't work, because that would avoid adding linkage attributes to
methods.  I could use:
  && (die->die_tag == DW_TAG_subprogram || !class_scope_p (die->die_parent))
(not 100% sure if some other tag than those can make it here)
or
  && ((die->die_tag != DW_TAG_member || die->die_tag != DW_TAG_variable)
  || !class_scope_p (die->die_parent))
or just use
  && (!VAR_P (decl) || !class_scope_p (die->die_parent))
or similar.

> > - if (old_die->die_tag == DW_TAG_member)
> > + if (old_die->die_tag == DW_TAG_member
> > + || (dwarf_version >= 5 && class_scope_p 
> > (old_die->die_parent)))
> 
> Likewise here.

This spot probably can be changed as you wrote, it is in gen_variable_die,
so methods shouldn't appear there.

Jakub


Re: [PATCH] Don't ICE on invalid operands in i?86 inline asm (PR target/79559)

2017-02-18 Thread Uros Bizjak
On Fri, Feb 17, 2017 at 7:32 PM, Jakub Jelinek  wrote:
> Hi!
>
> Asserts don't work really well on something we can't control in inline asm.
> output_operand_lossage takes care to ICE outside of inline asm and error out
> inside inline asm.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> 2017-02-17  Jakub Jelinek  
>
> PR target/79559
> * config/i386/i386.c (ix86_print_operand): Use output_operand_lossage
> instead of gcc_assert for K, r and R code checks.  Formatting fixes.
>
> * gcc.target/i386/pr79559.c: New test.

OK for trunk and branches.

Thanks,
Uros.

> --- gcc/config/i386/i386.c.jj   2017-02-14 20:34:49.0 +0100
> +++ gcc/config/i386/i386.c  2017-02-17 11:11:27.636114439 +0100
> @@ -17844,8 +17844,8 @@ ix86_print_operand (FILE *file, rtx x, i
>   break;
>
> default:
> - output_operand_lossage
> -   ("invalid operand size for operand code 'O'");
> + output_operand_lossage ("invalid operand size for operand "
> + "code 'O'");
>   return;
> }
>
> @@ -17879,15 +17879,14 @@ ix86_print_operand (FILE *file, rtx x, i
>   return;
>
> default:
> - output_operand_lossage
> -   ("invalid operand size for operand code 'z'");
> + output_operand_lossage ("invalid operand size for operand "
> + "code 'z'");
>   return;
> }
> }
>
>   if (GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT)
> -   warning
> - (0, "non-integer operand used with operand code 'z'");
> +   warning (0, "non-integer operand used with operand code 'z'");
>   /* FALLTHRU */
>
> case 'Z':
> @@ -17949,13 +17948,12 @@ ix86_print_operand (FILE *file, rtx x, i
> }
>   else
> {
> - output_operand_lossage
> -   ("invalid operand type used with operand code 'Z'");
> + output_operand_lossage ("invalid operand type used with "
> + "operand code 'Z'");
>   return;
> }
>
> - output_operand_lossage
> -   ("invalid operand size for operand code 'Z'");
> + output_operand_lossage ("invalid operand size for operand code 
> 'Z'");
>   return;
>
> case 'd':
> @@ -18154,7 +18152,12 @@ ix86_print_operand (FILE *file, rtx x, i
>   break;
>
> case 'K':
> - gcc_assert (CONST_INT_P (x));
> + if (!CONST_INT_P (x))
> +   {
> + output_operand_lossage ("operand is not an integer, invalid "
> + "operand code 'K'");
> + return;
> +   }
>
>   if (INTVAL (x) & IX86_HLE_ACQUIRE)
>  #ifdef HAVE_AS_IX86_HLE
> @@ -18177,8 +18180,12 @@ ix86_print_operand (FILE *file, rtx x, i
>   return;
>
> case 'r':
> - gcc_assert (CONST_INT_P (x));
> - gcc_assert (INTVAL (x) == ROUND_SAE);
> + if (!CONST_INT_P (x) || INTVAL (x) != ROUND_SAE)
> +   {
> + output_operand_lossage ("operand is not a specific integer, "
> + "invalid operand code 'r'");
> + return;
> +   }
>
>   if (ASSEMBLER_DIALECT == ASM_INTEL)
> fputs (", ", file);
> @@ -18191,7 +18198,12 @@ ix86_print_operand (FILE *file, rtx x, i
>   return;
>
> case 'R':
> - gcc_assert (CONST_INT_P (x));
> + if (!CONST_INT_P (x))
> +   {
> + output_operand_lossage ("operand is not an integer, invalid "
> + "operand code 'R'");
> + return;
> +   }
>
>   if (ASSEMBLER_DIALECT == ASM_INTEL)
> fputs (", ", file);
> @@ -18306,7 +18318,7 @@ ix86_print_operand (FILE *file, rtx x, i
>   return;
>
> default:
> -   output_operand_lossage ("invalid operand code '%c'", code);
> + output_operand_lossage ("invalid operand code '%c'", code);
> }
>  }
>
> --- gcc/testsuite/gcc.target/i386/pr79559.c.jj  2017-02-17 11:16:18.949176256 
> +0100
> +++ gcc/testsuite/gcc.target/i386/pr79559.c 2017-02-17 11:17:10.514479159 
> +0100
> @@ -0,0 +1,11 @@
> +/* PR target/79559 */
> +/* { dg-do compile } */
> +
> +void
> +foo (int x)
> +{
> +  __asm__ volatile ("# %K0" : : "r" (x));  /* { dg-error "invalid 
> operand code" } */
> +  __asm__ volatile ("# %r0" : : "r" (x));  /* { dg-error "invalid 
> operand code" } */
> +  __asm__ volatile ("# %r0" : : "n" (129));/* { dg-error "invalid 
> operand code" } */
> +  __asm__ volatile ("# %R0" : : "r" (x));  /* { dg-error "invalid 
> operand code" } */
> +}
>
> Jakub


[libstdc++,doc] Remove extraneous http:// in doc/xml/manual/profile_mode.xml

2017-02-18 Thread Gerald Pfeifer
This link turned out to be a little http:// heavy after revision
r245277. ;-)

Fixed thusly,
Gerald

2017-02-18  Gerald Pfeifer  

* doc/xml/manual/profile_mode.xml: Fix link.

Index: doc/xml/manual/profile_mode.xml
===
--- doc/xml/manual/profile_mode.xml (revision 245516)
+++ doc/xml/manual/profile_mode.xml (working copy)
@@ -26,7 +26,7 @@
   various components at interesting entry/exit points to/from the standard
   library.  Process trace, recognize suboptimal patterns, give advice.
   For details, see the
-  http://www.w3.org/1999/xlink"; 
xlink:href="http://http://ieeexplore.ieee.org/document/4907670/";>Perflint
+  http://www.w3.org/1999/xlink"; 
xlink:href="http://ieeexplore.ieee.org/document/4907670/";>Perflint
   paper presented at CGO 2009.
   
   


Re: [PATCH] Fix -m3dnowa (PR target/79569)

2017-02-18 Thread Uros Bizjak
On Fri, Feb 17, 2017 at 7:34 PM, Jakub Jelinek  wrote:
> Hi!
>
> -m3dnowa is an undocumented option that always errors out.
> The following patch fixes it and makes it do the obvious thing.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> 2017-02-17  Jakub Jelinek  
>
> PR target/79569
> * config/i386/i386.opt (m3dnowa): Replace Undocumented with Report.
> * common/config/i386/i386-common.c (OPTION_MASK_ISA_3DNOW_A_SET): 
> Define.
> (ix86_handle_option): Handle OPT_m3dnowa.
> * doc/invoke.texi (-m3dnowa): Document.
> * doc/extend.texi (__builtin_ia32_pmulhuw, __builtin_ia32_pf2iw): Use
> -m3dnowa instead of -m3dnow -march=athlon.
>
> * gcc.target/i386/3dnowA-3.c: New test.

OK for trunk and (at your opinion) gcc-6 branch.

Thanks,
Uros.

> --- gcc/config/i386/i386.opt.jj 2017-01-16 12:28:35.0 +0100
> +++ gcc/config/i386/i386.opt2017-02-17 11:23:06.674671212 +0100
> @@ -614,7 +614,7 @@ Target Report Mask(ISA_3DNOW) Var(ix86_i
>  Support 3DNow! built-in functions.
>
>  m3dnowa
> -Target Undocumented Mask(ISA_3DNOW_A) Var(ix86_isa_flags) Save
> +Target Report Mask(ISA_3DNOW_A) Var(ix86_isa_flags) Save
>  Support Athlon 3Dnow! built-in functions.
>
>  msse
> --- gcc/common/config/i386/i386-common.c.jj 2017-01-12 22:29:00.0 
> +0100
> +++ gcc/common/config/i386/i386-common.c2017-02-17 10:55:20.023152107 
> +0100
> @@ -35,6 +35,8 @@ along with GCC; see the file COPYING3.
>  #define OPTION_MASK_ISA_MMX_SET OPTION_MASK_ISA_MMX
>  #define OPTION_MASK_ISA_3DNOW_SET \
>(OPTION_MASK_ISA_3DNOW | OPTION_MASK_ISA_MMX_SET)
> +#define OPTION_MASK_ISA_3DNOW_A_SET \
> +  (OPTION_MASK_ISA_3DNOW_A | OPTION_MASK_ISA_3DNOW_SET)
>
>  #define OPTION_MASK_ISA_SSE_SET OPTION_MASK_ISA_SSE
>  #define OPTION_MASK_ISA_SSE2_SET \
> @@ -291,7 +293,17 @@ ix86_handle_option (struct gcc_options *
>return true;
>
>  case OPT_m3dnowa:
> -  return false;
> +  if (value)
> +   {
> + opts->x_ix86_isa_flags |= OPTION_MASK_ISA_3DNOW_A_SET;
> + opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_3DNOW_A_SET;
> +   }
> +  else
> +   {
> + opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_3DNOW_A_UNSET;
> + opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_3DNOW_A_UNSET;
> +   }
> +  return true;
>
>  case OPT_msse:
>if (value)
> --- gcc/doc/invoke.texi.jj  2017-02-16 12:00:36.0 +0100
> +++ gcc/doc/invoke.texi 2017-02-17 11:31:38.772731527 +0100
> @@ -1188,9 +1188,9 @@ See RS/6000 and PowerPC Options.
>  -mavx512bw  -mavx512dq  -mavx512ifma  -mavx512vbmi  -msha  -maes @gol
>  -mpclmul  -mfsgsbase  -mrdrnd  -mf16c  -mfma @gol
>  -mprefetchwt1  -mclflushopt  -mxsavec  -mxsaves @gol
> --msse4a  -m3dnow  -mpopcnt  -mabm  -mbmi  -mtbm  -mfma4  -mxop  -mlzcnt @gol
> --mbmi2  -mfxsr  -mxsave  -mxsaveopt  -mrtm  -mlwp  -mmpx  -mmwaitx @gol
> --mclzero  -mpku  -mthreads @gol
> +-msse4a  -m3dnow  -m3dnowa  -mpopcnt  -mabm  -mbmi  -mtbm  -mfma4  -mxop @gol
> +-mlzcnt  -mbmi2  -mfxsr  -mxsave  -mxsaveopt  -mrtm  -mlwp  -mmpx  @gol
> +-mmwaitx  -mclzero  -mpku  -mthreads @gol
>  -mms-bitfields  -mno-align-stringops  -minline-all-stringops @gol
>  -minline-stringops-dynamically  -mstringop-strategy=@var{alg} @gol
>  -mmemcpy-strategy=@var{strategy}  -mmemset-strategy=@var{strategy} @gol
> @@ -25004,6 +25004,9 @@ preferred alignment to @option{-mpreferr
>  @itemx -m3dnow
>  @opindex m3dnow
>  @need 200
> +@itemx -m3dnowa
> +@opindex m3dnowa
> +@need 200
>  @itemx -mpopcnt
>  @opindex mpopcnt
>  @need 200
> @@ -25053,7 +25056,7 @@ These switches enable the use of instruc
>  SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER, AVX512CD,
>  SHA, AES, PCLMUL, FSGSBASE, RDRND, F16C, FMA, SSE4A, FMA4, XOP, LWP, ABM,
>  AVX512VL, AVX512BW, AVX512DQ, AVX512IFMA AVX512VBMI, BMI, BMI2, FXSR,
> -XSAVE, XSAVEOPT, LZCNT, RTM, MPX, MWAITX, PKU or 3DNow!@:
> +XSAVE, XSAVEOPT, LZCNT, RTM, MPX, MWAITX, PKU, 3DNow!@: or enhanced 3DNow!@:
>  extended instruction sets.  Each has a corresponding @option{-mno-} option
>  to disable use of these instructions.
>
> --- gcc/doc/extend.texi.jj  2017-02-13 12:20:51.0 +0100
> +++ gcc/doc/extend.texi 2017-02-17 12:02:22.195884349 +0100
> @@ -19513,9 +19513,8 @@ v2si __builtin_ia32_psradi (v2si, int)
>  @end smallexample
>
>  The following built-in functions are made available either with
> -@option{-msse}, or with a combination of @option{-m3dnow} and
> -@option{-march=athlon}.  All of them generate the machine
> -instruction that is part of the name.
> +@option{-msse}, or with @option{-m3dnowa}.  All of them generate
> +the machine instruction that is part of the name.
>
>  @smallexample
>  v4hi __builtin_ia32_pmulhuw (v4hi, v4hi)
> @@ -20615,9 +20614,8 @@ v2sf __builtin_ia32_pi2fd (v2si)
>  v4hi __builtin_ia32_pmulhrw (v4hi, v4hi)
>  @end smallexample
>
> -The following built-in functions are availab

Re: [PATCH][DOC][OBVIOUS] Document default value for use-after-scope-direct-emission-threshold

2017-02-18 Thread Gerald Pfeifer
On Fri, 3 Feb 2017, Martin Liška wrote:
>> Yes, but...

>> (I'm still not quite sure what this option does, and whether we 
>> could say "poison and unpoison it", for example?  Can you advise?)
> I'm sending enhancement of that. Basically: direct poisoning = emitting
> instructions that touch shadow memory vs. runtime callbacks = function
> that does that :)
>
> I welcome help with that.

How about the following, Martin, which tries to combine our two
sets of changes (and adds some editorial changes)?

Let me know whether this looks fine to you, and I'll commit.

Gerald


2017-02-05  Gerald Pfeifer  
Martin Liška  

* doc/invoke.texi (use-after-scope-direct-emission-threshold):
Fix typos and grammar, use active voice, and clarify.

Index: doc/invoke.texi
===
--- doc/invoke.texi (revision 245559)
+++ doc/invoke.texi (working copy)
@@ -10478,9 +10478,9 @@
 @option{--param asan-instrumentation-with-call-threshold=0}.
 
 @item use-after-scope-direct-emission-threshold
-If size of a local variable in bytes is smaller or equal to this number,
-direct instruction emission is utilized to poison and unpoison local variables.
-Default value in 256.
+If the size of a local variable in bytes is smaller or equal to this
+number, directly poison (or unpoison) shadow memory instead of using
+run-time callbacks.  The default value is 256.
 
 @item chkp-max-ctor-size
 Static constructors generated by Pointer Bounds Checker may become very

Re: [PATCH] Fix fixincludes for canadian cross builds

2017-02-18 Thread Bernd Edlinger
On 02/18/17 00:37, Bruce Korb wrote:
> On 02/06/17 10:44, Bernd Edlinger wrote:
>> I tested this change with different arm-linux-gnueabihf cross
>> compilers, and verified that mkheaders still works on the host system.
>>
>> Bootstrapped and reg-tested on x86_64-pc-linux-gnu.
>> Is it OK for trunk?
>
> As long as you certify that this is correct for all systems we care about:
>
> +BUILD_SYSTEM_HEADER_DIR = `
> +echo $(CROSS_SYSTEM_HEADER_DIR) | \
> +sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta`
>
> that is pretty obtuse sed-speak to me.  I suggest a comment
> explaining what sed is supposed to be doing.  What should
> "$(CROSS_SYSTEM_HEADER_DIR)" look like?
>

I took it just from a few lines above, so I thought that comment would
sufficiently explain the syntax:

# autoconf sets SYSTEM_HEADER_DIR to one of the above.
# Purge it of unnecessary internal relative paths
# to directories that might not exist yet.
# The sed idiom for this is to repeat the search-and-replace until it 
doesn't match, using :a ... ta.
# Use single quotes here to avoid nested double- and backquotes, this
# macro is also used in a double-quoted context.
SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e 
's,[^/]*/\.\.\/,,' -e ta`

But I guess it would not hurt to just repeat "Purge it of unnecessary
internal relative paths" here as well.

CROSS_SYSTEM_HEADER_DIR is where the target system headers are located
on the build system (IOW the system root), that can be something like
"CROSS_SYSTEM_HEADER_DIR = $(gcc_tooldir)/sys-include"

Which may expand to something like that:
"/home/ed/gnu/arm-linux-gnueabihf-cross/lib/gcc/arm-linux-gnueabihf/7.0.1/../../../../arm-linux-gnueabihf/sys-include"

which the sed script changes then to
"/home/ed/gnu/arm-linux-gnueabihf-cross/arm-linux-gnueabihf/sys-include"

And in deed, I have put the target header files there on the build
machine.

But on the target system the include files are simply at "/usr/include"
which is the value of SYSTEM_HEADER_DIR, thus SYSTEM_HEADER_DIR is not
a path where the headers are visible at the build system, only code
that executes on the target system should use SYSTEM_HEADER_DIR.


Thanks
Bernd.


Re: PR79286, ira combine_and_move_insns in loops

2017-02-18 Thread Dominique d'Humières
> I'm slightly concerned about the test and how it'll behave on targets with 
> small address spaces. If it's a problem we can fault in adjustments.

The test fails on x86_64-apple-darwin16 with -m32 and -O1 and above.

TIA

Dominique



[committed] xfail g++.dg/tls/thread_local-order2.C on hppa*-*-hpux*

2017-02-18 Thread John David Anglin
I don't believe this test is fixable on hpux due to the way destructors are 
handled on hpux.  Test used to be
xfailed everywhere.

Committed to trunk.

Dave
--
John David Anglin   dave.ang...@bell.net


2017-02-18  John David Anglin  

* g++.dg/tls/thread_local-order2.C: xfail on hppa*-*-hpux*.

Index: g++.dg/tls/thread_local-order2.C
===
--- g++.dg/tls/thread_local-order2.C(revision 245405)
+++ g++.dg/tls/thread_local-order2.C(working copy)
@@ -6,7 +6,7 @@
 // { dg-require-effective-target c++11 }
 // { dg-add-options tls }
 // { dg-require-effective-target tls_runtime }
-// { dg-xfail-run-if "" { *-*-solaris* } }
+// { dg-xfail-run-if "" { hppa*-*-hpux* *-*-solaris* } }
 
 extern "C" void abort();
 extern "C" int printf (const char *, ...);


[PATCH] Fix PR libstdc++/68739 on hpux

2017-02-18 Thread John David Anglin
The attached change fixes the fails noted in PR 68730.  Okay for trunk?

Dave
--
John David Anglin   dave.ang...@bell.net


2016-02-18  John David Anglin  

PR libstdc++/68739
testsuite/util/testsuite_common_types.h: Adjust template type.

Index: testsuite/util/testsuite_common_types.h
===
--- testsuite/util/testsuite_common_types.h (revision 245405)
+++ testsuite/util/testsuite_common_types.h (working copy)
@@ -700,7 +700,7 @@
   struct _Concept<_Tp, true>
   {
void __constraint()
-   { constexpr _Tp __obj; }
+   { static _Tp __obj; }
   };
 
 // Non-literal type, declare local static and verify no


Re: [PATCH] Fix PR libstdc++/68739 on hpux

2017-02-18 Thread Jonathan Wakely

On 18/02/17 09:45 -0500, John David Anglin wrote:

The attached change fixes the fails noted in PR 68730.  Okay for trunk?


No, the whole point of that test type is to check that the type can be
declared as a constexpr variable.

The problem is that types like std::mutex can't be constexpr for some
targets:

#ifdef __GTHREAD_MUTEX_INIT
   constexpr
#endif
   mutex() noexcept = default;

We need to disable the tests for those targets, not weaken the tests
so they don't check the condition for any targets.




Re: [PATCH] Emit column info even in .debug_line section

2017-02-18 Thread Jakub Jelinek
On Fri, Feb 17, 2017 at 09:33:07PM -0500, Jason Merrill wrote:
> Looks fine.

Passed bootstrap/regtest, I've committed both -gcolumn-info patches; thanks
for review.

Comparing the cc1plus debug info sizes between standard bootstrap and
one with hacked default -gcolumn-info shows:
-gno-column-info (default):
  [31] .debug_info   PROGBITS 1d9e948 5ae23f3 00
  0   0  1
  [32] .debug_abbrev PROGBITS 7880d3b 1b1dac 00 
 0   0  1
  [33] .debug_line   PROGBITS 7a32ae7 68ab1b 00 
 0   0  1
-gcolumn-info:
  [31] .debug_info   PROGBITS 1d9e948 5d72ddb 00
  0   0  1
  [32] .debug_abbrev PROGBITS 7b11723 1d9ec9 00 
 0   0  1
  [33] .debug_line   PROGBITS 7ceb5ec 9bf412 00 
 0   0  1
All other sections have the same size.
So it is 2.8% growth in .debug_info, 9.2% growth in .debug_abbrev and 49%
growth in .debug_line.

Jakub


New French PO file for 'gcc' (version 7.1-b20170101)

2017-02-18 Thread Translation Project Robot
Hello, gentle maintainer.

This is a message from the Translation Project robot.

A revised PO file for textual domain 'gcc' has been submitted
by the French team of translators.  The file is available at:

http://translationproject.org/latest/gcc/fr.po

(This file, 'gcc-7.1-b20170101.fr.po', has just now been sent to you in
a separate email.)

All other PO files for your package are available in:

http://translationproject.org/latest/gcc/

Please consider including all of these in your next release, whether
official or a pretest.

Whenever you have a new distribution with a new version number ready,
containing a newer POT file, please send the URL of that distribution
tarball to the address below.  The tarball may be just a pretest or a
snapshot, it does not even have to compile.  It is just used by the
translators when they need some extra translation context.

The following HTML page has been updated:

http://translationproject.org/domain/gcc.html

If any question arises, please contact the translation coordinator.

Thank you for all your work,

The Translation Project robot, in the
name of your translation coordinator.




Re: [v3 PATCH] Implement C++17 GB50 resolution

2017-02-18 Thread Dinka Ranns
Comments addressed. Please find the new diff attached to this e-mail.

Changelog after review comments :

2017-02-18 Dinka Ranns 

C++17 GB50 resolution
* include/std/chrono:
(duration::operator++()): Add _GLIBCXX17_CONSTEXPR.
(duration::operator++(int)): Likewise
(duration::operator--()): Likewise
(duration::operator--(int)): Likewise
(duration::operator+=(const duration&)): Likewise
(duration::operator-=(const duration&)): Likewise
(duration::operator*=(const rep&)): Likewise
(duration::operator/=(const rep&)): Likewise
(duration::operator%=(const rep&)): Likewise
(duration::operator%=(const duration&)): Likewise
(time_point::operator+=(const duration&)): Likewise
(time_point::operator-=(const duration&)): Likewise

* testsuite/20_util/duration/arithmetic/constexpr_c++17.cc: new tests
* testsuite/20_util/time_point/arithmetic/constexpr.cc: new tests




On 15 February 2017 at 09:35, Jonathan Wakely  wrote:
> Hi, Dinka, thanks for the patch.
>
> On 14/02/17 21:22 +, Dinka Ranns wrote:
>>
>> diff --git a/libstdc++-v3/include/std/chrono
>> b/libstdc++-v3/include/std/chrono
>> index ceae7f8..6a6995c 100644
>> --- a/libstdc++-v3/include/std/chrono
>> +++ b/libstdc++-v3/include/std/chrono
>> @@ -349,50 +349,50 @@ _GLIBCXX_END_NAMESPACE_VERSION
>> operator-() const
>> { return duration(-__r); }
>>
>> -   duration&
>> +   constexpr duration&
>
>
> This needs to use _GLIBCXX17_CONSTEXPR instead of 'constexpr'
>
> These functions aren't constexpr in C++11 and C++14, and the standard
> (annoyingly) forbids us from adding constexpr anywhere it isn't
> present in the standard.
>
> The macro _GLIBCXX17_CONSTEXPR expands to 'constexpr' if __cplusplus >
> 201402L, and expands to nothing otherwise.
>
> Each new 'constexpr' you've added needs to use that macro.
>
>> diff --git
>> a/libstdc++-v3/testsuite/20_util/duration/arithmetic/constexpr.cc
>> b/libstdc++-v3/testsuite/20_util/duration/arithmetic/constexpr.cc
>> index 285f941..1128a52 100644
>> --- a/libstdc++-v3/testsuite/20_util/duration/arithmetic/constexpr.cc
>> +++ b/libstdc++-v3/testsuite/20_util/duration/arithmetic/constexpr.cc
>> @@ -19,11 +19,31 @@
>>
>> #include 
>> #include 
>
>
> There should be a blank line before and after this function, however
> ...
>
>> +constexpr auto test_operators()
>> +{
>> +  std::chrono::nanoseconds d1 { };
>> +  d1++;
>
>
> This new function uses C++14 return type deduction, so will fail if
> the test is run in C++11 mode (the default is C++14, but it can be
> overridden on the command-line).
>
>> +  ++d1;
>> +  d1--;
>> +  --d1;
>
>
> Also once you change the new 'constexpr' specifiers to use the
> _GLIBCXX17_CONSTEXPR macro this test will fail in C++14 mode. I think
> this new function needs to be moved to a new test file, such as
> testsuite/20_util/duration/arithmetic/constexpr_c++17.cc
>
> That should contain just your new test_operators() function, because
> the rest of the class will be tested by the existing constexpr.cc test
> file. So something like:
>
> // { dg-options "-std=gnu++17" }
> // { dg-do compile { target c++1z } }
>
> // Copyright etc. etc.
> // ...
>
> #include 
>
> constexpr auto test_operators()
> {
>  // ...
> }
>
> constexpr auto d4 = test_operators();
>
>
> Note that the "dg-do compile" line should use the c++1z target instead
> of c++11, and needs to override the default dialect with a dg-options
> line.
>
> This test doesn't need a "main" function because it's a "dg-do
> compile" test, so isn't linked. (The existing test that you modified
> didn't need one either, but it doesn't do any harm leaving it there).
>
>
>> diff --git
>> a/libstdc++-v3/testsuite/20_util/time_point/arithmetic/constexpr.cc
>> b/libstdc++-v3/testsuite/20_util/time_point/arithmetic/constexpr.cc
>> new file mode 100644
>> index 000..e87a226
>> --- /dev/null
>> +++ b/libstdc++-v3/testsuite/20_util/time_point/arithmetic/constexpr.cc
>> @@ -0,0 +1,39 @@
>> +// { dg-do compile { target c++11 } }
>
>
> Since the time_point member functions will only be constexpr in C++17
> this test also needs to use c++1z instead of c++11, and needs to
> override the default C++14 dialect, i.e.
>
> // { dg-options "-std=gnu++17" }
> // { dg-do compile { target c++1z } }
>
diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono
index 2c33be0..d05eaaf 100644
--- a/libstdc++-v3/include/std/chrono
+++ b/libstdc++-v3/include/std/chrono
@@ -349,50 +349,50 @@ _GLIBCXX_END_NAMESPACE_VERSION
operator-() const
{ return duration(-__r); }
 
-   duration&
+   _GLIBCXX17_CONSTEXPR duration&
operator++()
{
  ++__r;
  return *this;
}
 
-   duration
+   _GLIBCXX17_CONSTEXPR duration
operator++(int)
{ return duration(__r++); }
 
-   duration&
+   _GLIBCXX17_CONSTEXPR duration&
operator

[libstdc++,doc] doc/xml/manual/io.xml - update link to groups.google.com

2017-02-18 Thread Gerald Pfeifer
I will admit I am impressed how Google provides redirects for such
older links.  And while I was at it, I tweaked the link description
from "this" to at least "this post".

Applied (revision 245565).

Gerald

2017-02-18  Gerald Pfeifer  

* doc/xml/manual/io.xml: Update link to groups.google.com.
Tweak link description.

Index: doc/xml/manual/io.xml
===
--- doc/xml/manual/io.xml   (revision 245564)
+++ doc/xml/manual/io.xml   (working copy)
@@ -576,8 +576,8 @@

   An instructive thread from comp.lang.c++.moderated delved off into
   this topic starting more or less at
-  http://www.w3.org/1999/xlink"; 
xlink:href="http://groups.google.com/group/comp.std.c++/browse_thread/thread/f87b4abd7954a87/946a3eb9921e382d?q=comp.std.c%2B%2B+binary+iostream#946a3eb9921e382d";>this
-  post and continuing to the end of the thread. (The subject heading is 
"binary iostreams" on both comp.std.c++
+  http://www.w3.org/1999/xlink"; 
xlink:href="https://groups.google.com/forum/#!topic/comp.std.c++/D4e0q9eVSoc";>this
 post
+  and continuing to the end of the thread. (The subject heading is "binary 
iostreams" on both comp.std.c++
   and comp.lang.c++.moderated.) Take special note of the replies by James 
Kanze and Dietmar Kühl.

 Briefly, the problems of byte ordering and type sizes mean that

[wwwdocs] Convert searchbox.ihtml to using CSS

2017-02-18 Thread Gerald Pfeifer
When converting gcc.gnu.org to solely use CSS for markup last year, 
this is one of the last bits I did not get to yet.

Committed, and gcc.gnu.org rebuilt (by running /www/gcc/bin/preprocess ).

Gerald

Index: searchbox.ihtml
===
RCS file: /cvs/gcc/wwwdocs/htdocs/searchbox.ihtml,v
retrieving revision 1.16
retrieving revision 1.19
diff -u -r1.16 -r1.19
--- searchbox.ihtml 1 Jul 2014 16:02:45 -   1.16
+++ searchbox.ihtml 18 Feb 2017 21:48:10 -  1.19
@@ -1,21 +1,23 @@
-
+
 
 https://gcc.gnu.org/cgi-bin/search.cgi";>
-
+
 
-
+
 
-Match: 
+Match: 
   All words
   Any word
   Boolean expression
   
-Sort by: 
+Sort by: 
   Newest
   Best Match
   
 
 
+There is also a
+detailed search form.
+
 
 
-There is also a detailed search form.


Re: [PATCH][AArch64][wwwdocs] Summarise some more AArch64 changes for GCC6

2017-02-18 Thread Gerald Pfeifer
Hi Sandra,

On Sun, 24 Apr 2016, Sandra Loosemore wrote:
> I haven't done a careful review of the whole section of existing text, 
> but I did notice a few things in text not being touched by this patch:

I noticed not all of the changes you recommended actually have been
made, of which I now take care by applying the patch below (finally).

Thanks for your, as usual, good feedback!

Gerald

Index: gcc-6/changes.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-6/changes.html,v
retrieving revision 1.92
diff -u -r1.92 changes.html
--- gcc-6/changes.html  2 Feb 2017 21:48:31 -   1.92
+++ gcc-6/changes.html  18 Feb 2017 22:13:42 -
@@ -723,8 +723,8 @@
 
 The new command-line options -march=native,
   and -mtune=native are now available on native IBM
-  z Systems.  Specifying these options will cause GCC to
-  auto-detect the host CPU and rewrite these options to the
+  z Systems.  Specifying these options causes GCC to
+  auto-detect the host CPU and choose the
   optimal setting for that system.  If GCC is unable to detect
   the host CPU these options have no effect.