Re: [wwwdocs, coding conventions] Mention OVERRIDE/FINAL

2017-01-22 Thread Gerald Pfeifer
Hi David,

On Fri, 14 Oct 2016, David Malcolm wrote:
> I propose that we update our coding conventions to mention the OVERRIDE
> and FINAL macros in the paragraph that discusses virtual funcs.
> 
> The attached patch (to the website) does so.
> 
> OK to commit?

I saw that Pedro agreed, but none of our global reviewers (such as
Bernd) chimed in.

So, while this looks fine from a pure wwwdocs perspective, I did
not feel comfortable approving it without larger concensus.  If
you want to push this, perhaps send a note/request to gcc@ proposing
this?

GeraldIndex: htdocs/codingconventions.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/codingconventions.html,v
retrieving revision 1.77
diff -u -p -r1.77 codingconventions.html
--- htdocs/codingconventions.html	18 Sep 2016 13:55:17 -	1.77
+++ htdocs/codingconventions.html	14 Oct 2016 21:22:44 -
@@ -902,7 +902,10 @@ Its use with data-carrying classes is mo
 
 Think carefully about the size and performance impact
 of virtual functions and virtual bases
-before using them.
+before using them.  If you do use virtual functions, use the
+OVERRIDE and FINAL macros from
+include/ansidecl.h to annotate the code for a human reader,
+and to allow sufficiently modern C++ compilers to detect mistakes.
 
 
 


[patch, fortran] Warn about integer**(negative integer)

2017-01-22 Thread Thomas Koenig

Hello world,

a reacent thread on c.l.f showed another common error - expecting
10**(-3) to expect something different from zero.  The attached
patch warns about this result if -Winteger-division is active.

Why -Winteger-division?  Two reasons:  First, 10**(-3) ist just
a shorthand for integer division.  Second, I did not want to add
yet another warning flag.

Regression-tested.  OK for trunk?

Thomas

2017-01-22  Thomas Koenig  

* arith.c (arith_power):  If simplifying integer power expression
to zero, warn if -Winteger-division is given.

2017-01-22  Thomas Koenig  

* gfortran.dg/integer_exponentiation_7.f90:  New test.
Index: arith.c
===
--- arith.c	(Revision 244747)
+++ arith.c	(Arbeitskopie)
@@ -874,6 +874,11 @@ arith_power (gfc_expr *op1, gfc_expr *op2, gfc_exp
 		  {
 		/* if op2 < 0, op1**op2 == 0  because abs(op1) > 1.  */
 		mpz_set_si (result->value.integer, 0);
+		if (warn_integer_division)
+		  gfc_warning_now (OPT_Winteger_division, "Integer "
+   "exponentiation truncated to constant "
+   "%qs at %L", "0", &result->where);
+   
 		  }
 		else if (gfc_extract_int (op2, &power))
 		  {
! { dg-do compile }
! { dg-options "-Winteger-division" }
program main
  print *,10**(-3) ! { dg-warning "Integer exponentiation truncated to constant" }
end program main


Re: [PATCH] Use INCLUDE_xxx macros in gcov.c for pulling in standard C++ headers

2017-01-22 Thread Jan Hubicka
> Honza, Nathan,
> 
> On Sat, 21 Jan 2017, Dimitry Andric wrote:
> > As discussed with the FreeBSD gcc ports maintainer [1], building trunk
> > gcc with libc++ requires standard C++ headers to be included *before*
> > gcc/system.h, otherwise the redefinition of abort() to fancy_abort()
> > will cause trouble.
> > 
> > In r235362, most gcc C++ sources were updated to define INCLUDE_xxx
> > macros before including gcc/system.h, which fixes the incompatibility
> > with libc++.  However, gcc/gcov.c was apparently missed.  Attached is a
> > patch to update it.
> 
> can you approve this as gcov maintainers?
> 
> Without this, GCC 7 will fail to build with newer versions of 
> Clang/libc++.
> 
> Below you find Dimitry's patch with a ChangeLog I created.  Bootstrapped 
> on x86_64-unknown-freebsd11.0, and I can take care of committing.
> 
> Gerald
> 
> 2017-01-21  Dimitry Andric 
> 
>   * gcov.c (INCLUDE_ALGORITHM): Define.
>   (INCLUDE_VECTOR): Define.
>   No longer include  and .

OK

Honza


[PATCH] README.Portability: remove Irix6 limitation

2017-01-22 Thread Gerald Pfeifer
Looking through README.Portability I noticed what feels like
an obsolete reference to Irix 6.  Do we really support that,
or versions that feature this issue, any longer?

Rainer, I think you may have been the last Irix contributor/
tester we've had?

(The last entry I could find was in gcc-4.7/buildstat.html .)

Gerald

Index: gcc/README.Portability
===
--- gcc/README.Portability  (revision 244756)
+++ gcc/README.Portability  (working copy)
@@ -21,14 +21,6 @@
 String literals
 ---
 
-Irix6 "cc -n32" and OSF4 "cc" have problems with constant string
-initializers with parens around it, e.g.
-
-const char string[] = ("A string");
-
-This is unfortunate since this is what the GNU gettext macro N_
-produces.  You need to find a different way to code it.
-
 Some compilers like MSVC++ have fairly low limits on the maximum
 length of a string literal; 509 is the lowest we've come across.  You
 may need to break up a long printf statement into many smaller ones.


Re: [PATCH] README.Portability: remove Irix6 limitation

2017-01-22 Thread Rainer Orth
Hi Gerald,

> Looking through README.Portability I noticed what feels like
> an obsolete reference to Irix 6.  Do we really support that,
> or versions that feature this issue, any longer?
>
> Rainer, I think you may have been the last Irix contributor/
> tester we've had?
>
> (The last entry I could find was in gcc-4.7/buildstat.html .)

right, both IRIX and Tru64 UNIX support were removed after GCC 4.7, so
this can certainly go.

Thanks for noticing.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


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

2017-01-22 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.




[v3 PATCH] PR libstdc++/78420

2017-01-22 Thread Ville Voutilainen
Tested on Linux-x64.

The tests apparently would never fail unless the arrays are global
and the pointer arithmetic local. However, these tests should
ensure that the results are the same regardless of optimizations,
and these test fail with the current compiler unless the specializations
are present.

2017-01-22  Ville Voutilainen  

PR libstdc++/78420
* include/bits/stl_function.h (): New include in C++11 mode
and above.
(greater<_Tp*>): New specialization in C++11 mode and above.
(less<_Tp*>): Likewise.
(greater_equal<_Tp*>): Likewise.
(less_equal<_Tp*>): Likewise.
* testsuite/20_util/function_objects/pointer_comparison.cc: New.
* testsuite/20_util/function_objects/pointer_comparison.inl: Likewise.
* testsuite/20_util/function_objects/pointer_comparison_opt.cc:
Likewise.
diff --git a/libstdc++-v3/include/bits/stl_function.h 
b/libstdc++-v3/include/bits/stl_function.h
index 4fbcdb9..5b36b8b 100644
--- a/libstdc++-v3/include/bits/stl_function.h
+++ b/libstdc++-v3/include/bits/stl_function.h
@@ -60,6 +60,10 @@
 #include 
 #endif
 
+#if __cplusplus >= 201103L
+#include 
+#endif
+
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -386,6 +390,26 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   { return __x < __y; }
 };
 
+#if __cplusplus >= 201103L
+  template
+struct greater<_Tp*> : public binary_function<_Tp*, _Tp*, bool>
+{
+  _GLIBCXX14_CONSTEXPR
+  bool
+  operator()(_Tp* __x, _Tp* __y) const
+  { return uintptr_t(__x) > uintptr_t(__y); }
+};
+
+  template
+struct less<_Tp*> : public binary_function<_Tp*, _Tp*, bool>
+{
+  _GLIBCXX14_CONSTEXPR
+  bool
+  operator()(_Tp* __x, _Tp* __y) const
+  { return uintptr_t(__x) < uintptr_t(__y); }
+};
+#endif
+
   /// One of the @link comparison_functors comparison functors@endlink.
   template
 struct greater_equal : public binary_function<_Tp, _Tp, bool>
@@ -406,6 +430,26 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   { return __x <= __y; }
 };
 
+#if __cplusplus >= 201103L
+  template
+struct greater_equal<_Tp*> : public binary_function<_Tp*, _Tp*, bool>
+{
+  _GLIBCXX14_CONSTEXPR
+  bool
+  operator()(_Tp* __x, _Tp* __y) const
+  { return uintptr_t(__x) >= uintptr_t(__y); }
+};
+
+  template
+struct less_equal<_Tp*> : public binary_function<_Tp*, _Tp*, bool>
+{
+  _GLIBCXX14_CONSTEXPR
+  bool
+  operator()(_Tp* __x, _Tp* __y) const
+  { return uintptr_t(__x) <= uintptr_t(__y); }
+};
+#endif
+
 #if __cplusplus > 201103L
   /// One of the @link comparison_functors comparison functors@endlink.
   template<>
diff --git 
a/libstdc++-v3/testsuite/20_util/function_objects/pointer_comparison.cc 
b/libstdc++-v3/testsuite/20_util/function_objects/pointer_comparison.cc
new file mode 100644
index 000..5ab28dc
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/function_objects/pointer_comparison.cc
@@ -0,0 +1,26 @@
+// { dg-options "-O0" }
+// { dg-do run { target c++11 } }
+
+// Copyright (C) 2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// .
+
+// 20.9.5-20.9.9
+
+#include 
+#include 
+
+#include "pointer_comparison.inl"
diff --git 
a/libstdc++-v3/testsuite/20_util/function_objects/pointer_comparison.inl 
b/libstdc++-v3/testsuite/20_util/function_objects/pointer_comparison.inl
new file mode 100644
index 000..532cc38
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/function_objects/pointer_comparison.inl
@@ -0,0 +1,47 @@
+int b[8];
+int a[8];
+
+
+void test01()
+{
+  auto p = a + 8;
+  std::less lt;
+  VERIFY((lt(p, b) && !lt(b, p) && !(!lt(p, b) && !lt(b, p)))
+|| (!lt(p, b) && lt(b, p) && !(!lt(p, b) && !lt(b, p)))
+|| (!lt(p, b) && !lt(b, p) && (!lt(p, b) && !lt(b, p;
+}
+
+void test02()
+{
+  auto p = a + 8;
+  std::greater gt;
+  VERIFY((gt(p, b) && !gt(b, p) && !(!gt(p, b) && !gt(b, p)))
+|| (!gt(p, b) && gt(b, p) && !(!gt(p, b) && !gt(b, p)))
+|| (!gt(p, b) && !gt(b, p) && (!gt(p, b) && !gt(b, p;
+}
+
+void test03()
+{
+  auto p = a + 8;
+  std::less_equal le;
+  VERIFY((le(p, b) && !le(b, p) && !(le(p, b) && le(b, p)))
+|| (!le(p, b) && le(b, p) && !(le(p, b) && le(b, p)))
+|| (le(p, b) && le(b, p) && !(!le(p, b) && !le(

Re: [PATCH] Use INCLUDE_xxx macros in gcov.c for pulling in standard C++ headers

2017-01-22 Thread Gerald Pfeifer
On Sun, 22 Jan 2017, Jan Hubicka wrote:
>> Below you find Dimitry's patch with a ChangeLog I created.  Bootstrapped 
>> on x86_64-unknown-freebsd11.0, and I can take care of committing.

>> 2017-01-21  Dimitry Andric 
>> 
>>  * gcov.c (INCLUDE_ALGORITHM): Define.
>>  (INCLUDE_VECTOR): Define.
>>  No longer include  and .
> OK

Thanks!  To be on the safe side, I also did another bootstrap on
x86_64-pc-linux-gnu, and committed this now.

Thanks, Dimitry!

Gerald


Re: [PATCH] README.Portability: remove Irix6 limitation

2017-01-22 Thread Gerald Pfeifer
On Sun, 22 Jan 2017, Rainer Orth wrote:
> right, both IRIX and Tru64 UNIX support were removed after GCC 4.7, 
> so this can certainly go.

Thanks for the quick response and confirmation, Rainer!

I got a little confused since https://gcc.gnu.org/gcc-4.7/changes.html
mentions deprecations, but https://gcc.gnu.org/gcc-4.8/changes.html then
does not have anything on actual removals (and I wasn't sure whether
IRIX 6.5 was the final version).

I applied the change with the following ChangeLog:

  2017-01-22  Gerald Pfeifer   
 
* README.Portability: Remove note on an Irix compatibility issue.

Gerald


Re: [v3 PATCH] PR libstdc++/78420

2017-01-22 Thread Tim Song
On Sun, Jan 22, 2017 at 10:42 AM, Ville Voutilainen
 wrote:
> +  _GLIBCXX14_CONSTEXPR
> +  bool
> +  operator()(_Tp* __x, _Tp* __y) const
> +  { return uintptr_t(__x) > uintptr_t(__y); }

These reinterpret_casts can't possibly be constexpr.

Simple test case:

#include 

constexpr bool g() {
int a[10] = {};
return std::greater{}(a, a+5);
}

static_assert(!g(), "");


Re: [v3 PATCH] PR libstdc++/78420

2017-01-22 Thread Ville Voutilainen
On 22 January 2017 at 17:57, Tim Song  wrote:
> On Sun, Jan 22, 2017 at 10:42 AM, Ville Voutilainen
>  wrote:
>> +  _GLIBCXX14_CONSTEXPR
>> +  bool
>> +  operator()(_Tp* __x, _Tp* __y) const
>> +  { return uintptr_t(__x) > uintptr_t(__y); }
>
> These reinterpret_casts can't possibly be constexpr.

Indeed. Jason, some front-end help in the form of an intrinsic, perhaps? :)


[wwwdocs] gcc-3.1/changes.html: http://www.x86-64.org is dead

2017-01-22 Thread Gerald Pfeifer
http://www.x86-64.org has been dead for a while, so keep the
textual reference, but remove the link.

Committed.

Gerald

Index: gcc-3.1/changes.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-3.1/changes.html,v
retrieving revision 1.70
diff -u -r1.70 changes.html
--- gcc-3.1/changes.html22 Aug 2016 12:27:31 -  1.70
+++ gcc-3.1/changes.html22 Jan 2017 16:14:54 -
@@ -281,7 +281,7 @@
   SuSE Labs developers Jan
   Hubicka, Bo Thorsen and Andreas Jaeger have contributed a port to
   the AMD x86-64 architecture.  For more information on x86-64 see
-  http://www.x86-64.org/";>http://www.x86-64.org.
+  http://www.x86-64.org.
   
   The compiler now supports MMX, 3DNow!, SSE, and SSE2 instructions.
   Options -mmmx, -m3dnow, -msse,


Re: [libstdc++,doc] Use canonical address for C++ ABI

2017-01-22 Thread Gerald Pfeifer
On Sun, 1 Jan 2017, Gerald Pfeifer wrote:
> When I updated those URLs in June 2015, I must have missed these
> references in libstdc++ land.
> 
> Fixed thusly (via revision 244001), and I plan on backporting to 
> GCC 6 and possibly GCC 5 later.
> 
> Gerald
> 
> 2017-01-01  Gerald Pfeifer  
> 
>   * doc/xml/faq.xml: Update address of C++ ABI link.
>   * doc/xml/manual/abi.xml: Ditto.

Pushed to the GCC 6 and GCC 5 branches now.

Jonathan, this is the last one I had in my list of backports touching 
libstdc++ docs; there likely will be more I'll be doing for mainline
in the coming days/weeks (and some of those may be suitable for back-
ports then).

Gerald


Re: [libstdc++,doc] Use canonical address for C++ ABI

2017-01-22 Thread Markus Trippelsdorf
On 2017.01.22 at 17:20 +0100, Gerald Pfeifer wrote:
> On Sun, 1 Jan 2017, Gerald Pfeifer wrote:
> > When I updated those URLs in June 2015, I must have missed these
> > references in libstdc++ land.
> > 
> > Fixed thusly (via revision 244001), and I plan on backporting to 
> > GCC 6 and possibly GCC 5 later.
> > 
> > Gerald
> > 
> > 2017-01-01  Gerald Pfeifer  
> > 
> > * doc/xml/faq.xml: Update address of C++ ABI link.
> > * doc/xml/manual/abi.xml: Ditto.
> 
> Pushed to the GCC 6 and GCC 5 branches now.
> 
> Jonathan, this is the last one I had in my list of backports touching 
> libstdc++ docs; there likely will be more I'll be doing for mainline
> in the coming days/weeks (and some of those may be suitable for back-
> ports then).

Please note that they will move again soon, see:
http://sourcerytools.com/pipermail/cxx-abi-dev/2017-January/003021.html

-- 
Markus


Re: [PATCH] Delete GCJ

2017-01-22 Thread Gerald Pfeifer
On Fri, 30 Sep 2016, Andrew Haley wrote:
>> Note I did not include all the removed java/* contents.  Is there
>> anything particular you'd like to retain there?
> No, please delete it all.

Okay, so I (finally) went ahead and removed all of java/papers:

cvs commit: Examining java/papers
cvs commit: Examining java/papers/cni
Removing java/papers/README.sgml;
/cvs/gcc/wwwdocs/htdocs/java/papers/README.sgml,v  <--  README.sgml
new revision: delete; previous revision: 1.1
done
Removing java/papers/cni.sgml;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni.sgml,v  <--  cni.sgml
new revision: delete; previous revision: 1.5
done
Removing java/papers/compcon97.ps.gz;
/cvs/gcc/wwwdocs/htdocs/java/papers/compcon97.ps.gz,v  <--  compcon97.ps.gz
new revision: delete; previous revision: 1.1
done
Removing java/papers/compiling.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/compiling.html,v  <--  compiling.html
new revision: delete; previous revision: 1.3
done
Removing java/papers/compjava.pdf;
/cvs/gcc/wwwdocs/htdocs/java/papers/compjava.pdf,v  <--  compjava.pdf
new revision: delete; previous revision: 1.1
done
Removing java/papers/compjava.ps.gz;
/cvs/gcc/wwwdocs/htdocs/java/papers/compjava.ps.gz,v  <--  compjava.ps.gz
new revision: delete; previous revision: 1.1
done
Removing java/papers/esc97.sgml;
/cvs/gcc/wwwdocs/htdocs/java/papers/esc97.sgml,v  <--  esc97.sgml
new revision: delete; previous revision: 1.1
done
Removing java/papers/esc97w-slides.ps.gz;
/cvs/gcc/wwwdocs/htdocs/java/papers/esc97w-slides.ps.gz,v  <--  
esc97w-slides.ps.gz
new revision: delete; previous revision: 1.1
done
Removing java/papers/gcc-java.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/gcc-java.html,v  <--  gcc-java.html
new revision: delete; previous revision: 1.6
done
Removing java/papers/gcc-java.ps.gz;
/cvs/gcc/wwwdocs/htdocs/java/papers/gcc-java.ps.gz,v  <--  gcc-java.ps.gz
new revision: delete; previous revision: 1.1
done
Removing java/papers/native++.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/native++.html,v  <--  native++.html
new revision: delete; previous revision: 1.3
done
Removing java/papers/native++.sgml;
/cvs/gcc/wwwdocs/htdocs/java/papers/native++.sgml,v  <--  native++.sgml
new revision: delete; previous revision: 1.3
done
Removing java/papers/nosb.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/nosb.html,v  <--  nosb.html
new revision: delete; previous revision: 1.6
done
Removing java/papers/nosb.ps.gz;
/cvs/gcc/wwwdocs/htdocs/java/papers/nosb.ps.gz,v  <--  nosb.ps.gz
new revision: delete; previous revision: 1.1
done
Removing java/papers/page.png;
/cvs/gcc/wwwdocs/htdocs/java/papers/page.png,v  <--  page.png
new revision: delete; previous revision: 1.1
done
Removing java/papers/table.png;
/cvs/gcc/wwwdocs/htdocs/java/papers/table.png,v  <--  table.png
new revision: delete; previous revision: 1.1
done
Removing java/papers/cni/HTML.manifest;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/HTML.manifest,v  <--  HTML.manifest
new revision: delete; previous revision: 1.3
done
Removing java/papers/cni/t1.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/t1.html,v  <--  t1.html
new revision: delete; previous revision: 1.3
done
Removing java/papers/cni/t1178.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/t1178.html,v  <--  t1178.html
new revision: delete; previous revision: 1.2
done
Removing java/papers/cni/t1215.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/t1215.html,v  <--  t1215.html
new revision: delete; previous revision: 1.2
done
Removing java/papers/cni/t1262.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/t1262.html,v  <--  t1262.html
new revision: delete; previous revision: 1.3
done
Removing java/papers/cni/t1308.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/t1308.html,v  <--  t1308.html
new revision: delete; previous revision: 1.2
done
Removing java/papers/cni/t1324.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/t1324.html,v  <--  t1324.html
new revision: delete; previous revision: 1.2
done
Removing java/papers/cni/t1331.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/t1331.html,v  <--  t1331.html
new revision: delete; previous revision: 1.2
done
Removing java/papers/cni/t134.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/t134.html,v  <--  t134.html
new revision: delete; previous revision: 1.3
done
Removing java/papers/cni/t1405.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/t1405.html,v  <--  t1405.html
new revision: delete; previous revision: 1.2
done
Removing java/papers/cni/t1421.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/t1421.html,v  <--  t1421.html
new revision: delete; previous revision: 1.3
done
Removing java/papers/cni/t1431.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/t1431.html,v  <--  t1431.html
new revision: delete; previous revision: 1.2
done
Removing java/papers/cni/t1457.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/t1457.html,v  <--  t1457.html
new revision: delete; previous revision: 1.1
done
Removing java/papers/cni/t1467.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/t1467.html,v  <--  t1467.html
new revision: delete; previous revision: 1.2
d

Re: [patch] update zlib to the 1.2.10 release.

2017-01-22 Thread Matthias Klose
On 12.01.2017 22:39, Jeff Law wrote:
> On 01/12/2017 02:26 PM, Matthias Klose wrote:
>> On 12.01.2017 22:17, Jeff Law wrote:
>>> On 01/05/2017 07:45 AM, Matthias Klose wrote:
 These are the changes updating zlib from 1.2.8 to 1.2.10. It is only used 
 when
 building without a system zlib.  The new release includes fixes for 
 security
 issues CVE-2016-9840, CVE-2016-9841, CVE-2016-9842, CVE-2016-9843.

 Checked with a build with disabled system-zlib. Ok for the trunk?
>>> Were there any changes that we needed to carry forward or any changes you 
>>> needed
>>> to make to the upstream sources?
>>
>> I backed out the changes to the configure* and Makefile* changes (and only
>> these), which are completely different to zlib upstream. There are no
>> additions/deletions to zlib source files, so these build changes still work 
>> with
>> the updated zlib.
> One more note.  I think that, in general, backing out local changes which 
> don't
> have a strong need to be carried forward is absolutely the right thing to do. 
> The less hacking we do on these libraries we pull from other sources, the
> better, IMHO.

Committed the 1.2.10 changes on Jan 13.  1.2.11 was released a few days ago.
Updating the trunk with the new version, checked with a build without using a
system zlib.

NightStrike proposed to revert to the 1.2.8 release until zlib stabilizes again;
I'm open for that, but didn't want to stay with the 1.2.10 release.

Matthias

2017-01-22  Matthias Klose  

* Import zlib 1.2.11.
* configure: Regenerate.

Changes in 1.2.11 (15 Jan 2017)
- Fix deflate stored bug when pulling last block from window
- Permit immediate deflateParams changes before any deflate input


Index: zlib/CMakeLists.txt
===
--- zlib/CMakeLists.txt	(revision 244761)
+++ zlib/CMakeLists.txt	(working copy)
@@ -3,7 +3,7 @@
 
 project(zlib C)
 
-set(VERSION "1.2.10")
+set(VERSION "1.2.11")
 
 option(ASM686 "Enable building i686 assembly implementation")
 option(AMD64 "Enable building amd64 assembly implementation")
Index: zlib/ChangeLog
===
--- zlib/ChangeLog	(revision 244761)
+++ zlib/ChangeLog	(working copy)
@@ -1,6 +1,10 @@
 
 ChangeLog file for zlib
 
+Changes in 1.2.11 (15 Jan 2017)
+- Fix deflate stored bug when pulling last block from window
+- Permit immediate deflateParams changes before any deflate input
+
 Changes in 1.2.10 (2 Jan 2017)
 - Avoid warnings on snprintf() return value
 - Fix bug in deflate_stored() for zero-length input
Index: zlib/ChangeLog.gcj
===
--- zlib/ChangeLog.gcj	(revision 244761)
+++ zlib/ChangeLog.gcj	(working copy)
@@ -1,3 +1,8 @@
+2017-01-22  Matthias Klose  
+
+	* Import zlib 1.2.11.
+	* configure: Regenerate.
+
 2017-01-13  Matthias Klose  
 
 	* Import zlib 1.2.10.
Index: zlib/README
===
--- zlib/README	(revision 244761)
+++ zlib/README	(working copy)
@@ -3,7 +3,7 @@
 
 ZLIB DATA COMPRESSION LIBRARY
 
-zlib 1.2.10 is a general purpose data compression library.  All the code is
+zlib 1.2.11 is a general purpose data compression library.  All the code is
 thread safe.  The data format used by the zlib library is described by RFCs
 (Request for Comments) 1950 to 1952 in the files
 http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
@@ -34,7 +34,7 @@
 issue of Dr.  Dobb's Journal; a copy of the article is available at
 http://marknelson.us/1997/01/01/zlib-engine/ .
 
-The changes made in version 1.2.10 are documented in the file ChangeLog.
+The changes made in version 1.2.11 are documented in the file ChangeLog.
 
 Unsupported third party contributions are provided in directory contrib/ .
 
Index: zlib/contrib/delphi/ZLib.pas
===
--- zlib/contrib/delphi/ZLib.pas	(revision 244761)
+++ zlib/contrib/delphi/ZLib.pas	(working copy)
@@ -152,7 +152,7 @@
   const OutBuf: Pointer; BufSize: Integer);
 
 const
-  zlib_version = '1.2.10';
+  zlib_version = '1.2.11';
 
 type
   EZlibError = class(Exception);
Index: zlib/contrib/dotzlib/DotZLib/UnitTests.cs
===
--- zlib/contrib/dotzlib/DotZLib/UnitTests.cs	(revision 244761)
+++ zlib/contrib/dotzlib/DotZLib/UnitTests.cs	(working copy)
@@ -156,7 +156,7 @@
 public void Info_Version()
 {
 Info info = new Info();
-Assert.AreEqual("1.2.10", Info.Version);
+Assert.AreEqual("1.2.11", Info.Version);
 Assert.AreEqual(32, info.SizeOfUInt);
 Assert.AreEqual(32, info.SizeOfULong);
 Assert.AreEqual(32, info.SizeOfPointer);
Index: zlib/contrib/infback9/inftree9.c
===
--- zlib

Re: [patch] update zlib to the 1.2.10 release.

2017-01-22 Thread NightStrike
On Sun, Jan 22, 2017 at 1:00 PM, Matthias Klose  wrote:
> NightStrike proposed to revert to the 1.2.8 release until zlib stabilizes 
> again;
> I'm open for that, but didn't want to stay with the 1.2.10 release.

I don't recall making that proposal.  I thought I just suggested that
since modern zlib now supports having a separate build and source
directory (at least according to the December changelog: "Allow
building zlib outside of the source directory"), you should check to
see if the gcc build system had any hacks to accomplish the same thing
that could now be removed.


Re: [PATCH] Delete GCJ

2017-01-22 Thread Gerald Pfeifer
And here is more or less the last patch in this series, removing
java/libgcj2.html and two images (gcj.jpg and swingshot.png).

The only thing left in wwwdocs is a potential merge of java/news.html
into our general news.html that I am considering.  That'd take a bit
more time, and I'll see whether I can do that before the GCC 7.1 release.

Gerald

Index: java/libgcj2.html
===
RCS file: java/libgcj2.html
diff -N java/libgcj2.html
--- java/libgcj2.html   30 Jun 2014 09:29:09 -  1.12
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -1,38 +0,0 @@
-
-
-
-The libgcj home page
-
-
-
-
-The libgcj home page
-
-What is it?
-
-``libgcj'' is the runtime that goes along with the gcj front end to GCC.  libgcj includes parts
-of the Java Class Libraries, plus glue to connect the libraries to
-the compiler and the underlying OS.
-
-What you get
-
-libgcj eventually builds a couple of libraries (one for the
-runtime and one for the garbage collector), a ``zip'' version of
-the class libraries, and a program called ``jv-convert'' which can
-be used to do character encoding transformations.
-
-What is missing?
-
-The runtime is not yet fully complete.  Parts of the standard
-class libraries are missing (most notably AWT), though much of the
-equivalent of JDK 1.2 has been supported.
-Also, the bytecode interpreter available only on certain platforms.
-
-How to build it
-
-Just follow our https://gcc.gnu.org/install/";>installation
-instructions.
-
-
-
Index: java/gcj.jpg
===
RCS file: java/gcj.jpg
diff -N java/gcj.jpg
Binary files /tmp/cvseTgpza and /dev/null differ
Index: java/swingshot.png
===
RCS file: java/swingshot.png
diff -N java/swingshot.png
Binary files /tmp/cvsGkz1jF and /dev/null differ


Re: [PATCH] Delete GCJ

2017-01-22 Thread Per Bothner

In my opinion, all/most of these should be restored.

On 01/22/2017 08:51 AM, Gerald Pfeifer wrote:

On Fri, 30 Sep 2016, Andrew Haley wrote:

Note I did not include all the removed java/* contents.  Is there
anything particular you'd like to retain there?

No, please delete it all.


Okay, so I (finally) went ahead and removed all of java/papers:

cvs commit: Examining java/papers
cvs commit: Examining java/papers/cni
Removing java/papers/README.sgml;
/cvs/gcc/wwwdocs/htdocs/java/papers/README.sgml,v  <--  README.sgml
new revision: delete; previous revision: 1.1
done
Removing java/papers/cni.sgml;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni.sgml,v  <--  cni.sgml
new revision: delete; previous revision: 1.5
done
Removing java/papers/compcon97.ps.gz;
/cvs/gcc/wwwdocs/htdocs/java/papers/compcon97.ps.gz,v  <--  compcon97.ps.gz
new revision: delete; previous revision: 1.1
done
Removing java/papers/compiling.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/compiling.html,v  <--  compiling.html
new revision: delete; previous revision: 1.3
done
Removing java/papers/compjava.pdf;
/cvs/gcc/wwwdocs/htdocs/java/papers/compjava.pdf,v  <--  compjava.pdf
new revision: delete; previous revision: 1.1
done
Removing java/papers/compjava.ps.gz;
/cvs/gcc/wwwdocs/htdocs/java/papers/compjava.ps.gz,v  <--  compjava.ps.gz
new revision: delete; previous revision: 1.1
done
Removing java/papers/esc97.sgml;
/cvs/gcc/wwwdocs/htdocs/java/papers/esc97.sgml,v  <--  esc97.sgml
new revision: delete; previous revision: 1.1
done
Removing java/papers/esc97w-slides.ps.gz;
/cvs/gcc/wwwdocs/htdocs/java/papers/esc97w-slides.ps.gz,v  <--  
esc97w-slides.ps.gz
new revision: delete; previous revision: 1.1
done
Removing java/papers/gcc-java.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/gcc-java.html,v  <--  gcc-java.html
new revision: delete; previous revision: 1.6
done
Removing java/papers/gcc-java.ps.gz;
/cvs/gcc/wwwdocs/htdocs/java/papers/gcc-java.ps.gz,v  <--  gcc-java.ps.gz
new revision: delete; previous revision: 1.1
done
Removing java/papers/native++.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/native++.html,v  <--  native++.html
new revision: delete; previous revision: 1.3
done
Removing java/papers/native++.sgml;
/cvs/gcc/wwwdocs/htdocs/java/papers/native++.sgml,v  <--  native++.sgml
new revision: delete; previous revision: 1.3
done
Removing java/papers/nosb.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/nosb.html,v  <--  nosb.html
new revision: delete; previous revision: 1.6
done
Removing java/papers/nosb.ps.gz;
/cvs/gcc/wwwdocs/htdocs/java/papers/nosb.ps.gz,v  <--  nosb.ps.gz
new revision: delete; previous revision: 1.1
done
Removing java/papers/page.png;
/cvs/gcc/wwwdocs/htdocs/java/papers/page.png,v  <--  page.png
new revision: delete; previous revision: 1.1
done
Removing java/papers/table.png;
/cvs/gcc/wwwdocs/htdocs/java/papers/table.png,v  <--  table.png
new revision: delete; previous revision: 1.1
done
Removing java/papers/cni/HTML.manifest;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/HTML.manifest,v  <--  HTML.manifest
new revision: delete; previous revision: 1.3
done
Removing java/papers/cni/t1.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/t1.html,v  <--  t1.html
new revision: delete; previous revision: 1.3
done
Removing java/papers/cni/t1178.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/t1178.html,v  <--  t1178.html
new revision: delete; previous revision: 1.2
done
Removing java/papers/cni/t1215.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/t1215.html,v  <--  t1215.html
new revision: delete; previous revision: 1.2
done
Removing java/papers/cni/t1262.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/t1262.html,v  <--  t1262.html
new revision: delete; previous revision: 1.3
done
Removing java/papers/cni/t1308.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/t1308.html,v  <--  t1308.html
new revision: delete; previous revision: 1.2
done
Removing java/papers/cni/t1324.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/t1324.html,v  <--  t1324.html
new revision: delete; previous revision: 1.2
done
Removing java/papers/cni/t1331.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/t1331.html,v  <--  t1331.html
new revision: delete; previous revision: 1.2
done
Removing java/papers/cni/t134.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/t134.html,v  <--  t134.html
new revision: delete; previous revision: 1.3
done
Removing java/papers/cni/t1405.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/t1405.html,v  <--  t1405.html
new revision: delete; previous revision: 1.2
done
Removing java/papers/cni/t1421.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/t1421.html,v  <--  t1421.html
new revision: delete; previous revision: 1.3
done
Removing java/papers/cni/t1431.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/t1431.html,v  <--  t1431.html
new revision: delete; previous revision: 1.2
done
Removing java/papers/cni/t1457.html;
/cvs/gcc/wwwdocs/htdocs/java/papers/cni/t1457.html,v  <--  t1457.html
new revision: delete; previous revision: 1.1
done
Removing java/papers/cni/t1467.html;
/cvs/gcc/wwwdocs/ht

Re: [patch] update zlib to the 1.2.10 release.

2017-01-22 Thread Matthias Klose
On 22.01.2017 19:12, NightStrike wrote:
> On Sun, Jan 22, 2017 at 1:00 PM, Matthias Klose  wrote:
>> NightStrike proposed to revert to the 1.2.8 release until zlib stabilizes 
>> again;
>> I'm open for that, but didn't want to stay with the 1.2.10 release.
> 
> I don't recall making that proposal.  I thought I just suggested that
> since modern zlib now supports having a separate build and source
> directory (at least according to the December changelog: "Allow
> building zlib outside of the source directory"), you should check to
> see if the gcc build system had any hacks to accomplish the same thing
> that could now be removed.

sorry for wrongly citing you.  Please could you make the removal of zlib a goal
for GCC 8?  I may be a bit biased trying to keep the "ongoing" d/gdc merge alive
(libgphobos requiring a target zlib).

Matthias



[committed] Allow omp {declare {simd,target},simd} in PURE/ELEMENTAL (PR fortran/79154)

2017-01-22 Thread Jakub Jelinek
Hi!

OpenMP 4.5 allows !$omp declare simd, !$omp declare target and !$omp simd
in pure and elemental procedures.  Fixed thusly, bootstrapped/regtested on
x86_64-linux and i686-linux, committed to trunk.

2017-01-22  Jakub Jelinek  

PR fortran/79154
* parse.c (matchs, matcho, matchds, matchdo): Replace return st;
with { ret = st; goto finish; }.
(decode_omp_directive): Allow declare simd, declare target and
simd directives in PURE/ELEMENTAL procedures.  Only call
gfc_unset_implicit_pure on successful match of other procedures.

* gfortran.dg/gomp/pr79154-1.f90: New test.
* gfortran.dg/gomp/pr79154-2.f90: New test.

--- gcc/fortran/parse.c.jj  2017-01-01 12:45:47.0 +0100
+++ gcc/fortran/parse.c 2017-01-21 11:11:52.600886810 +0100
@@ -721,7 +721,10 @@ decode_oacc_directive (void)
goto do_spec_only;  \
   if (match_word_omp_simd (keyword, subr, &old_locus,  \
   &simd_matched) == MATCH_YES) \
-   return st;  \
+   {   \
+ ret = st; \
+ goto finish;  \
+   }   \
   else \
undo_new_statement ();  \
 } while (0);
@@ -736,7 +739,10 @@ decode_oacc_directive (void)
goto do_spec_only;  \
   else if (match_word (keyword, subr, &old_locus)  \
   == MATCH_YES)\
-   return st;  \
+   {   \
+ ret = st; \
+ goto finish;  \
+   }   \
   else \
undo_new_statement ();  \
 } while (0);
@@ -746,7 +752,10 @@ decode_oacc_directive (void)
 do {   \
   if (match_word_omp_simd (keyword, subr, &old_locus,  \
   &simd_matched) == MATCH_YES) \
-   return st;  \
+   {   \
+ ret = st; \
+ goto finish;  \
+   }   \
   else \
undo_new_statement ();  \
 } while (0);
@@ -758,7 +767,10 @@ decode_oacc_directive (void)
;   \
   else if (match_word (keyword, subr, &old_locus)  \
   == MATCH_YES)\
-   return st;  \
+   {   \
+ ret = st; \
+ goto finish;  \
+   }   \
   else \
undo_new_statement ();  \
 } while (0);
@@ -770,26 +782,18 @@ decode_omp_directive (void)
   char c;
   bool simd_matched = false;
   bool spec_only = false;
+  gfc_statement ret = ST_NONE;
+  bool pure_ok = true;
 
   gfc_enforce_clean_symbol_state ();
 
   gfc_clear_error ();  /* Clear any pending errors.  */
   gfc_clear_warning ();/* Clear any pending warnings.  */
 
-  if (gfc_pure (NULL))
-{
-  gfc_error_now ("OpenMP directives at %C may not appear in PURE "
-"or ELEMENTAL procedures");
-  gfc_error_recovery ();
-  return ST_NONE;
-}
-
   if (gfc_current_state () == COMP_FUNCTION
   && gfc_current_block ()->result->ts.kind == -1)
 spec_only = true;
 
-  gfc_unset_implicit_pure (NULL);
-
   old_locus = gfc_current_locus;
 
   /* General OpenMP directive matching: Instead of testing every possible
@@ -800,6 +804,33 @@ decode_omp_directive (void)
 
   /* match is for directives that should be recognized only if
  -fopenmp, matchs for directives that should be recognized
+ if either -fopenmp or -fopenmp-simd.
+ Handle only the directives allowed in PURE/ELEMENTAL procedures
+ first (those also shall not turn off implicit pure).  */
+  switch (c)
+{
+case 'd':
+  matchds ("declare simd", gfc_match_omp_declar

Re: [committed] Allow omp {declare {simd,target},simd} in PURE/ELEMENTAL (PR fortran/79154)

2017-01-22 Thread Paul Richard Thomas
Hi Jakub,

That's OK - thanks

Paul

On 22 January 2017 at 20:38, Jakub Jelinek  wrote:
> Hi!
>
> OpenMP 4.5 allows !$omp declare simd, !$omp declare target and !$omp simd
> in pure and elemental procedures.  Fixed thusly, bootstrapped/regtested on
> x86_64-linux and i686-linux, committed to trunk.
>
> 2017-01-22  Jakub Jelinek  
>
> PR fortran/79154
> * parse.c (matchs, matcho, matchds, matchdo): Replace return st;
> with { ret = st; goto finish; }.
> (decode_omp_directive): Allow declare simd, declare target and
> simd directives in PURE/ELEMENTAL procedures.  Only call
> gfc_unset_implicit_pure on successful match of other procedures.
>
> * gfortran.dg/gomp/pr79154-1.f90: New test.
> * gfortran.dg/gomp/pr79154-2.f90: New test.
>
> --- gcc/fortran/parse.c.jj  2017-01-01 12:45:47.0 +0100
> +++ gcc/fortran/parse.c 2017-01-21 11:11:52.600886810 +0100
> @@ -721,7 +721,10 @@ decode_oacc_directive (void)
> goto do_spec_only;  \
>if (match_word_omp_simd (keyword, subr, &old_locus,  \
>&simd_matched) == MATCH_YES) \
> -   return st;  \
> +   {   \
> + ret = st; \
> + goto finish;  \
> +   }   \
>else \
> undo_new_statement ();  \
>  } while (0);
> @@ -736,7 +739,10 @@ decode_oacc_directive (void)
> goto do_spec_only;  \
>else if (match_word (keyword, subr, &old_locus)  \
>== MATCH_YES)\
> -   return st;  \
> +   {   \
> + ret = st; \
> + goto finish;  \
> +   }   \
>else \
> undo_new_statement ();  \
>  } while (0);
> @@ -746,7 +752,10 @@ decode_oacc_directive (void)
>  do {   \
>if (match_word_omp_simd (keyword, subr, &old_locus,  \
>&simd_matched) == MATCH_YES) \
> -   return st;  \
> +   {   \
> + ret = st; \
> + goto finish;  \
> +   }   \
>else \
> undo_new_statement ();  \
>  } while (0);
> @@ -758,7 +767,10 @@ decode_oacc_directive (void)
> ;   \
>else if (match_word (keyword, subr, &old_locus)  \
>== MATCH_YES)\
> -   return st;  \
> +   {   \
> + ret = st; \
> + goto finish;  \
> +   }   \
>else \
> undo_new_statement ();  \
>  } while (0);
> @@ -770,26 +782,18 @@ decode_omp_directive (void)
>char c;
>bool simd_matched = false;
>bool spec_only = false;
> +  gfc_statement ret = ST_NONE;
> +  bool pure_ok = true;
>
>gfc_enforce_clean_symbol_state ();
>
>gfc_clear_error ();  /* Clear any pending errors.  */
>gfc_clear_warning ();/* Clear any pending warnings.  */
>
> -  if (gfc_pure (NULL))
> -{
> -  gfc_error_now ("OpenMP directives at %C may not appear in PURE "
> -"or ELEMENTAL procedures");
> -  gfc_error_recovery ();
> -  return ST_NONE;
> -}
> -
>if (gfc_current_state () == COMP_FUNCTION
>&& gfc_current_block ()->result->ts.kind == -1)
>  spec_only = true;
>
> -  gfc_unset_implicit_pure (NULL);
> -
>old_locus = gfc_current_locus;
>
>/* General OpenMP directive matching: Instead of testing every possible
> @@ -800,6 +804,33 @@ decode_omp_directive (void)
>
>/* match is for directives that should be recognized only if
>   -fopenmp, matchs for directives that should be re

[wwwdocs] readings.html -- update one PA-RISC reference

2017-01-22 Thread Gerald Pfeifer
There was a redirect put in place; let's follow that.

Committed.

Gerald

Index: readings.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/readings.html,v
retrieving revision 1.254
diff -u -r1.254 readings.html
--- readings.html   28 Dec 2016 01:55:36 -  1.254
+++ readings.html   22 Jan 2017 20:19:13 -
@@ -242,7 +242,7 @@
   http://h21007.www2.hp.com/portal/site/dspp/menuitem.1b39e60a9475acc915b49c108973a801/?chid=6dc55e210a66a010VgnVCM10275d6e10RCRD#topic_pa_risc_architecture";>PA-RISC
   is preferred over the older HPPA acronym
   (Hewlett-Packard Precision Architecture).
-  http://parisc-linux.org/documentation/index.html";>http://parisc-linux.org/documentation/index.html
+  https://parisc.wiki.kernel.org/index.php/Main_Page";>parisc.wiki.kernel.org
   is another good source of PA-RISC documention.
  
 


[wwwdocs] benchmarks/ -- cp2k.berlios.de/gfortran/ seems gone?

2017-01-22 Thread Gerald Pfeifer
Hi Joost, Fortran guys,

cp2k.berlios.de seems gone; do we need to remove this link on
https://gcc.gnu.org/benchmarks/ or is there an alternate address
we can use?

Gerald

Index: benchmarks/index.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/benchmarks/index.html,v
retrieving revision 1.36
diff -u -r1.36 index.html
--- benchmarks/index.html   22 Aug 2016 11:49:00 -  1.36
+++ benchmarks/index.html   22 Jan 2017 20:23:26 -
@@ -70,13 +70,6 @@
 
 
 
-Joost VandeVondele runs a CP2K benchmark with mainline GCC.
-Results can be found at
-http://cp2k.berlios.de/gfortran/";
->http://cp2k.berlios.de/gfortran/.
-
-
-
 A memory tester (maintained by Jan Hubicka) is periodically checking GCC memory
 usage.  The reports are sent to the https://gcc.gnu.org/ml/gcc-regression/";>gcc-regressions mailing list


[wwwdocs] install.texi - adjust opensource.apple.com link

2017-01-22 Thread Gerald Pfeifer
This avoid a redirect, and the trailing slash is technically not
needed (per the specification).

Applied, and not queued for a backport.

Gerald

2017-01-22  Gerald Pfeifer  
 
* doc/install.texi (Specific): opensource.apple.com uses https
now. Remove trailing slash.

Index: doc/install.texi
===
--- doc/install.texi(revision 244763)
+++ doc/install.texi(revision 244764)
@@ -4218,7 +4218,7 @@
 Pre-installed versions of Mac OS X may not include any developer tools,
 meaning that you will not be able to build GCC from source.  Tool
 binaries are available at
-@uref{http://opensource.apple.com/}.
+@uref{https://opensource.apple.com}.
 
 This version of GCC requires at least cctools-590.36.  The
 cctools-590.36 package referenced from



[libstdc++,doc] doc/xml/manual/test.xml - fix lint into gccint online manual

2017-01-22 Thread Gerald Pfeifer
Committed as revision 244765.

Gerald


2017-01-22  Gerald Pfeifer  

* doc/xml/manual/test.xml: Fix link into gccint online manual.

Index: doc/xml/manual/test.xml
===
--- doc/xml/manual/test.xml (revision 244759)
+++ doc/xml/manual/test.xml (working copy)
@@ -820,7 +820,7 @@
   
 In addition to the usual http://www.w3.org/1999/xlink";
-
xlink:href="https://gcc.gnu.org/onlinedocs/gccint/Require-support.html";>Variants
+
xlink:href="https://gcc.gnu.org/onlinedocs/gccint/Require-Support.html";>Variants
 of dg-require-support
 several more directives are available for use in libstdc++ tests,
 including the following:


contrib/warn_summary: review the -java option

2017-01-22 Thread Gerald Pfeifer
Applied, and that's about the last change related to the removal
of GCJ/libgcj from GCC.  Phew.

Gerald

2017-01-22  Gerald Pfeifer  

* warn_summary: Remove the -java option.

Index: warn_summary
===
--- warn_summary(revision 244759)
+++ warn_summary(working copy)
@@ -3,7 +3,7 @@
 # This script parses the output of a gcc bootstrap when using warning
 # flags and determines various statistics.
 # 
-# usage: warn_summary [-llf] [-s stage] 
[-nosub|-ch|-cp|-f|-fortran|-java|-ada|-intl|-fixinc]
+# usage: warn_summary [-llf] [-s stage] 
[-nosub|-ch|-cp|-f|-fortran|-ada|-intl|-fixinc]
 #  [-pass|-wpass] [file(s)]
 #
 # -llf
@@ -19,7 +19,7 @@
 #
 # -nosub
 # Only show warnings from the gcc top level directory.
-# -ch|-cp|-f|-fortran|-java|-ada|-intl|-fixinc
+# -ch|-cp|-f|-fortran|-ada|-intl|-fixinc
 # Only show warnings from the specified gcc subdirectory.
 # These override each other so only the last one passed takes effect.
 #
@@ -57,7 +57,7 @@
   else
 if test "$filter" = nosub ; then
   # Omit all subdirectories.
-  egrep -v '/gcc/(ch|cp|f|fortran|java|ada|intl|fixinc)/'
+  egrep -v '/gcc/(ch|cp|f|fortran|ada|intl|fixinc)/'
 else
   # Pass through only subdir $filter.
   grep "/gcc/$filter/"
@@ -136,7 +136,7 @@
 
 # Start the main section.
 
-usage="usage: `basename $0` [-llf] [-s stage] 
[-nosub|-ch|-cp|-f|-fortran|-java|-ada|-intl|-fixinc] [-pass|-wpass] [file(s)]"
+usage="usage: `basename $0` [-llf] [-s stage] 
[-nosub|-ch|-cp|-f|-fortran|-ada|-intl|-fixinc] [-pass|-wpass] [file(s)]"
 stageN=3
 tmpfile=/tmp/tmp-warn.$$
 
@@ -162,7 +162,7 @@
-s)  if test -z "$2"; then echo $usage 1>&2; exit 1; fi
stageN="$2"; shift 2 ;;
-s*) stageN="`expr $1 : '-s\(.*\)'`" ; shift ;;
-   -nosub|-ch|-cp|-f|-fortran|-java|-ada|-intl|-fixinc) filter="`expr $1 : 
'-\(.*\)'`" ; shift ;;
+   -nosub|-ch|-cp|-f|-fortran|-ada|-intl|-fixinc) filter="`expr $1 : 
'-\(.*\)'`" ; shift ;;
-pass) pass=1 ; shift ;;
-wpass) pass=w ; shift ;;
-*)  echo $usage 1>&2 ; exit 1 ;;


Re: [patch, fortran] Warn about integer**(negative integer)

2017-01-22 Thread FX
> 2017-01-22  Thomas Koenig  
> 
>* arith.c (arith_power):  If simplifying integer power expression
>to zero, warn if -Winteger-division is given.
> 
> 2017-01-22  Thomas Koenig  
> 
>* gfortran.dg/integer_exponentiation_7.f90:  New test.

The idea seems reasonable, but I am not sure about the wording (“truncated” in 
particular). “Integer exponentiation truncated to constant 0”? Why not 
“Negative integer exponent has result value zero”?

Other than that, OK to commit.

FX

Re: [PATCH] Delete GCJ

2017-01-22 Thread Gerald Pfeifer
On Sun, 2 Oct 2016, Andreas Schwab wrote:
> Things we may want to remove:
> 
> - references to java in contrib (download_ecj, gcc_update,
>   patch_tester.sh, update-copyright.py)

I have taken care of these (patch_tester.sh to follow shortly)...

> - GCJ, GCJ_FOR_BUILD, GCJ_FOR_TARGET in Makefiles.tpl and configure.ac
> - LIBGCJ_SONAME in config/i386/{cygwin.h,mingw32.h}
> - references to java in install.texi

...and config/i386 as well as libgcc and install.texi, plus a
number of changes on the web pages.

Is there anything else you see?  Anything you might help tackle?

Gerald


Re: [libcc1] add support for C++

2017-01-22 Thread Alexandre Oliva
On Jan 13, 2017, Jason Merrill  wrote:

> On 09/23/2016 08:41 PM, Alexandre Oliva wrote:
>> +static tree global_friend_list;

> This should be a hash_set rather than a TREE_LIST.

You sure?  At least in the libcc1 use scenario, this is going to have a
single entry.  I didn't even have to make it a list, but I made it one
because, well, I could :-)  A hash_set seems excessive, unless you
envision other uses for it.

>> +  // FIXME: we need a more space-efficient representation for
>> +  // oracle_looked_up.

> A hash_set would work for that, too.

I was hoping for an unused bit in IDENTIFIERs, but I guess that will do.
I'm a bit concerned about the performance impact of this in all name
lookups, though.  Just computing the hash for every lookup seems
excessive, compared with testing a bit.  Unless...  I guess making it a
hash_set*, NULL unless there is an Oracle, would alleviate this concern,
making it cost only when it's in use.

>> @@ -4626,6 +4647,8 @@ qualified_lookup_using_namespace (tree name, tree 
>> scope,
>> /* Look through namespace aliases.  */
>> scope = ORIGINAL_NAMESPACE (scope);
>> 
>> +  query_oracle (name);

> How does this work without providing the scope?  Does the oracle
> provide all definitions of the name?

Yeah, all namespace-scoped definitions.  I figured we'd need them all
for the existing lookup code to find the expected results in the
presence of using declarations and whatnot.

>> +/* Exported wrapper for cp_literal_operator_id.  */
>> +
>> +tree
>> +ansi_litopname (const char *name)
>> +{
>> +  return cp_literal_operator_id (name);
>> +}

> Why not export cp_literal_operator_id itself?

My sense of aesthetics demanded a uniform set of exported names along
with ansi_opname and ansi_assopname ;-)

>> +   If the newly-created namespace is to be an inline namespace, after
>> +   push_namespace, get the nested namespace decl with
>> +   get_current_binding_level, pop back to the enclosing namespace,
>> +   call using_namespace with INLINE_P, and then push to the inline
>> +   namespace again.  */

> This seems like unnecessary contortions to expect of the caller
> (i.e. GDB).  Let's add a new front end function to handle this.

Heh, it's really nothing compared with some other contortions required
to navigate binding levels, e.g. to reenter a function scope.

I didn't want to add redundant functionality to the libcc1 API, and we'd
need the ability to separate the introduction or reentry in a namespace,
from a using directive with attribute strong.  And since inline
namespaces use the same implementation as that, I figured it made sense
to use the same interface for both.

Besides, push_namespace is called a lot more often than using_namespace,
so it makes sense to keep it simpler, and leave the extra parameter for
the less common operation.

Another argument to keep things as they are is that the inline-ness of a
namespace is not a property related with entering the namespace, but
rather with how names from it are brought into the other namespace.  So,
in my mind, that's where the flag should go.  After all, what would it
mean to enter a namespace without the inline flag that had previously
been entered with the inline flag set?  The language specifies that
inline is implicit when left out, but if the libcc1 caller has to
indicate upon every entry whether or not a namespace is to be/remain
inline, that's not only a burden on the caller, but also a conflict
scenario that may have to be detected and have an error flagged within
libcc1.  API-wise, that makes a lot less sense to me.

>> + As a general rule, before we can declare or define any local name
>> + with a discriminator, we have to at least declare any other
>> + occurrences of the same name in the same enclosing entity with
>> + lower or absent discriminator.

> This seems unfortunate, wouldn't it be better to allow the plugin to
> specify the discriminator directly?

That would have required a major reworking of the internal handling of
such discriminators, and it didn't seem worth the effort and risk of
pushback, considering that libcc1 already requires all occurrences of a
name to be defined at once.

>> +.  If the code snippet is at point 2, we don't need to (re)activate
>> +   anything declaration: nothing from any local scope is visible.

s/anything/any/ fixed.

>> +   Just entering the scope of the class containing member function f
>> +   reactivates the names of its members, including the class name
>> +   itself.  */

> Does it reactivate the names of other declarations in scope in the
> enclosing function, e.g. static local variables?

My understanding is that anything local needs explicit reactivation when
reentering a function scope.  That makes sense and is helpful for us,
given that a local scope is not always a single scope; unlike namespace
and class scopes, there could be multiple scopes within a function
scope, and each would have a different set of active names.  The client
has to select th

[PATCH 0/5] better handling of ranges (PR 78703)

2017-01-22 Thread Martin Sebor

This is a resubmission of the patch originally posted before
the holidays, but now split up into smaller change sets to make
review easier.  The substance of the changes is described in
the original post:

  https://gcc.gnu.org/ml/gcc-patches/2016-12/msg01892.html

The changes are broken up into a series of 5 smaller patches.
The purpose of the first three is only to refactor code and
set the stage for the last two.  The goal of the refactoring
is to minimize code duplication and movement as a result of
the substantive changes in the last two patches.

The grouping of changes into each of the first three patches is
fairly arbitrary, driven only by the goal of reducing their scope
to make each patch possible to review on its own.  They have no
observable effect on either optimization or warnings.  The last
two patches then build on top of the first three to implement
the observable substantive changes.

Martin


[PATCH 2/5] remove unused member (PR 78703)

2017-01-22 Thread Martin Sebor

The attached simple patch removes the format_result::constant member
that is not used except in debugging dumps.  Removing it makes
the handling of non-constant arguments simpler.  Since this handling
increases in the substantive changes that follow this change reduces
the complexity of those changes.

In addition, this change simplifies the try_substitute_return_value
function to make the logic that controls the sprintf return value
optimization clearer.  This change also benefits the subsequent
patches by simplifying the necessary changes.

Neither of these changes affects the tests.
commit 3802ab59aec722b25e9be85a0748138ef89e4aec
Author: Martin Sebor 
Date:   Fri Jan 20 14:26:47 2017 -0700

2017-01-20  Martin Sebor  

	* gimple-ssa-sprintf.c (struct format_result): Remove constant member.
	(struct fmtresult, format_integer, format_floating): Adjust.
	(get_string_length, format_string,format_directive): Same.
	(pass_sprintf_length::compute_format_length): Same.
	(try_substitute_return_value): Simplify slightly.

diff --git a/gcc/gimple-ssa-sprintf.c b/gcc/gimple-ssa-sprintf.c
index 3464b45..38412b0 100644
--- a/gcc/gimple-ssa-sprintf.c
+++ b/gcc/gimple-ssa-sprintf.c
@@ -183,12 +183,6 @@ struct format_result
  the return value of a call.  */
   bool knownrange;
 
-  /* True when the output of the formatted call is constant (and
- thus a candidate for string constant folding).  This is rare
- and typically requires that the arguments of all directives
- are also constant.  CONSTANT implies BOUNDED.  */
-  bool constant;
-
   /* True if no individual directive resulted in more than 4095 bytes
  of output (the total NUMBER_CHARS might be greater).  */
   bool under4k;
@@ -452,7 +446,6 @@ struct fmtresult
   : argmin (), argmax (),
 knownrange (min < HOST_WIDE_INT_MAX),
 bounded (),
-constant (),
 nullp ()
   {
 range.min = min;
@@ -465,11 +458,10 @@ struct fmtresult
   : argmin (), argmax (),
 knownrange (min < HOST_WIDE_INT_MAX && max < HOST_WIDE_INT_MAX),
 bounded (),
-constant (),
 nullp ()
   {
 range.min = min;
-range.max = min;
+range.max = max;
   }
 
   /* The range a directive's argument is in.  */
@@ -490,12 +482,6 @@ struct fmtresult
  false otherwise.  */
   bool bounded;
 
-  /* True when the output of a directive is constant.  This is rare
- and typically requires that the argument(s) of the directive
- are also constant (such as determined by constant propagation,
- though not value range propagation).  */
-  bool constant;
-
   /* True when the argument is a null pointer.  */
   bool nullp;
 };
@@ -818,7 +804,7 @@ static fmtresult
 format_percent (const directive &, tree)
 {
   fmtresult res (1);
-  res.bounded = res.constant = true;
+  res.bounded = true;
   return res;
 }
 
@@ -1085,7 +1071,6 @@ format_integer (const directive &dir, tree arg)
 	{
 	  res.range.max = len;
 	  res.bounded = true;
-	  res.constant = true;
 	  res.knownrange = true;
 	  res.bounded = true;
 	}
@@ -1527,7 +1512,6 @@ format_floating (const directive &dir, tree arg)
 
   /* The minimum and maximum number of bytes produced by the directive.  */
   fmtresult res;
-  res.constant = true;
 
   /* Get the real type format desription for the target.  */
   const REAL_VALUE_TYPE *rvp = TREE_REAL_CST_PTR (arg);
@@ -1624,7 +1608,6 @@ get_string_length (tree str)
   fmtresult res;
   res.range.min = res.range.max = tree_to_shwi (slen);
   res.bounded = true;
-  res.constant = true;
   res.knownrange = true;
   return res;
 }
@@ -1652,11 +1635,6 @@ get_string_length (tree str)
   res.bounded = res.range.max < target_int_max ();
   res.knownrange = res.bounded;
 
-  /* Set RES.CONSTANT to false even though that may be overly
-	 conservative in rare cases like: 'x ? a : b' where a and
-	 b have the same lengths and consist of the same characters.  */
-  res.constant = false;
-
   return res;
 }
 
@@ -1703,7 +1681,6 @@ format_character (const directive &dir, tree arg)
   res.range.min = res.range.max = 1;
   res.bounded = true;
   res.knownrange = true;
-  res.constant = arg && TREE_CODE (arg) == INTEGER_CST;
 }
 
   /* Adjust the lengths for field width.  */
@@ -1749,7 +1726,8 @@ format_string (const directive &dir, tree arg)
 
   /* Compute the range the argument's length can be in.  */
   fmtresult slen = get_string_length (arg);
-  if (slen.constant)
+  if (slen.range.min == slen.range.max
+  && slen.range.min < HOST_WIDE_INT_MAX)
 {
   gcc_checking_assert (slen.range.min == slen.range.max);
 
@@ -1797,7 +1775,6 @@ format_string (const directive &dir, tree arg)
 	 precision is either not specified or it is specified and
 	 its value is known.  */
 	  res.bounded = true;
-	  res.constant = dir.prec != HOST_WIDE_INT_MIN;
 	}
   else if (dir.width == HOST_WIDE_INT_MIN)
 	{
@@ -1858,7 +1835,6 @@ format_string (const directive 

[PATCH 3/5] simply handling of -Wformat-overflow/truncation options (PR 78703)

2017-01-22 Thread Martin Sebor

The attached patch is the last of the refactoring/restructuring
series.  It consists of the following changes:

1) Introduce a single global variable, warn_level, that the pass
uses to test the level of the warning that applies to the function
currently being processed (i.e., either -Wformat-overflow or
-Wformat-truncation).

2) Slightly adjust the format_integer function in preparation for
the upcoming substantive changes.

3) Factor code responsible for issuing per-directive warnings out
of format_directive and into a function of its own, maybe_warn.
This also simplifies the upcoming extensive changes in this area
but more importantly, should make them easier to review by
grouping warnings in the same function.

4) Enhance information printed in debugging dumps.
commit d1a41d89a3b359e63937e87c619314ccd33562c5
Author: Martin Sebor 
Date:   Fri Jan 20 17:26:56 2017 -0700

2017-01-20  Martin Sebor  

	* gimple-ssa-sprintf.c (warn_level): New global.
	(format_integer): Use it here and throughout the rest of the file.
	Use the same switch to compute sign as base.
	(maybe_warn): New function.
	(format_directive): Factor out warnings into maybe_warn.
	Add debugging output.  Use warn_level.
	(add_bytes): Use warn_level.
	(pass_sprintf_length::compute_format_length): Add debugging output.
	(try_substitute_return_value): Same.
	(pass_sprintf_length::handle_gimple_call): Set and use warn_level.

diff --git a/gcc/gimple-ssa-sprintf.c b/gcc/gimple-ssa-sprintf.c
index 38412b0..e3a6b3e 100644
--- a/gcc/gimple-ssa-sprintf.c
+++ b/gcc/gimple-ssa-sprintf.c
@@ -104,6 +104,12 @@ const pass_data pass_data_sprintf_length = {
   0,	   // properties_finish
 };
 
+/* Set to the warning level for the current function which is equal
+   either to warn_format_trunc for bounded functions or to
+   warn_format_overflow otherwise.  */
+
+static int warn_level;
+
 struct format_result;
 
 class pass_sprintf_length : public gimple_opt_pass
@@ -137,10 +143,10 @@ public:
 bool
 pass_sprintf_length::gate (function *)
 {
-  /* Run the pass iff -Warn-format-length is specified and either
- not optimizing and the pass is being invoked early, or when
- optimizing and the pass is being invoked during optimization
- (i.e., "late").  */
+  /* Run the pass iff -Warn-format-overflow or -Warn-format-truncation
+ is specified and either not optimizing and the pass is being invoked
+ early, or when optimizing and the pass is being invoked during
+ optimization (i.e., "late").  */
   return ((warn_format_overflow > 0
 	   || warn_format_trunc > 0
 	   || flag_printf_return_value)
@@ -927,7 +933,37 @@ format_integer (const directive &dir, tree arg)
   HOST_WIDE_INT width = dir.width;
   HOST_WIDE_INT prec = dir.prec;
 
-  bool sign = dir.specifier == 'd' || dir.specifier == 'i';
+  /* Base to format the number in.  */
+  int base;
+
+  /* True when a signed conversion is preceded by a sign or space.  */
+  bool maybesign = false;
+
+  /* True for signed conversions (i.e., 'd' and 'i').  */
+  bool sign = false;
+
+  switch (dir.specifier)
+{
+case 'd':
+case 'i':
+  /* Space and '+' are  only meaningful for signed conversions.  */
+  maybesign = dir.get_flag (' ') | dir.get_flag ('+');
+  sign = true;
+  base = 10;
+  break;
+case 'u':
+  base = 10;
+  break;
+case 'o':
+  base = 8;
+  break;
+case 'X':
+case 'x':
+  base = 16;
+  break;
+default:
+  gcc_unreachable ();
+}
 
   /* The type of the "formal" argument expected by the directive.  */
   tree dirtype = NULL_TREE;
@@ -998,34 +1034,6 @@ format_integer (const directive &dir, tree arg)
   /* When a constant argument has been provided use its value
 	 rather than type to determine the length of the output.  */
 
-  /* Base to format the number in.  */
-  int base;
-
-  /* True when a signed conversion is preceded by a sign or space.  */
-  bool maybesign = false;
-
-  switch (dir.specifier)
-	{
-	case 'd':
-	case 'i':
-	  /* Space and '+' are  only meaningful for signed conversions.  */
-	  maybesign = dir.get_flag (' ') | dir.get_flag ('+');
-	  base = 10;
-	  break;
-	case 'u':
-	  base = 10;
-	  break;
-	case 'o':
-	  base = 8;
-	  break;
-	case 'X':
-	case 'x':
-	  base = 16;
-	  break;
-	default:
-	  gcc_unreachable ();
-	}
-
   HOST_WIDE_INT len;
 
   if ((prec == HOST_WIDE_INT_MIN || prec == 0) && integer_zerop (arg))
@@ -1655,11 +1663,11 @@ format_character (const directive &dir, tree arg)
  to a "%lc" directive adjusted for precision but not field width.
  6 is the longest UTF-8 sequence for a single wide character.  */
   const unsigned HOST_WIDE_INT max_bytes_for_unknown_wc
-= (0 <= dir.prec ? dir.prec : warn_format_overflow > 1 ? 6 : 1);
+= (0 <= dir.prec ? dir.prec : warn_level > 1 ? 6 : 1);
 
 if (dir.modifier == FMT_LEN_l)
 {
-  /* Positive if the argument is

[PATCH 1/5] consolidate handling of directives (PR 78703)

2017-01-22 Thread Martin Sebor

The substance of the attached change set is to lay the groundwork
of consolidating the handling of format directives and conversion
specifications.

1) Extend (and rename) struct conversion_spec used thus far to
represent a format conversion specification (the part of the format
string that starts with the percent character) to struct directive.
A directive can be either a conversion specification or a sequence
of plain characters that do not include the percent sign.  This
change significantly simplifies the handling of the whole format
string.

2) Separate code that parses a directive from code that subsequently
processes it.  This makes both the parsing and the processing logic
cleaner and easier to follow and modify.

3) Consolidate the code that extracts width and precision specified
by the asterisk (as in "%*.*i") from all of the directive-specific
format_xxx functions into a single function (parse_directive).
This reduces code duplication and lets the width and precision be
treated consistently in all directives.

4) Split single character handling from format_string and into its
own function.  The handling, while similar enough at first, has
diverged to the point that the conditionals to differentiate one
from the other were obscuring the logic for handling each.

None of these changes affects the tests.
commit a469182f012696107759cfe590cad3a06bd8a416
Author: Martin Sebor 
Date:   Thu Jan 19 16:47:02 2017 -0700

2017-01-19  Martin Sebor  

	* gimple-ssa-sprintf.c (pass_sprintf_length::gate): Adjust formatting.
	(fmtresult::operator+=): Outlined.
	(struct fmtresult): Add ctors.
	(struct conversion_spec): Rename...
	(struct directive): ...to this.  Add and remove data members.
	(directive::set_width, directive::set_precision): New functions.
	(format_percent): Use ftresult ctor.
	(get_width_and_precision): Remove.
	(format_integer): Make naming changes.  Avoid computing width and
	precision.
	(format_floating): Same.  Adjust indentation.
	(format_character): New function.
	(format_string): Moved character handling to format_character.
	(format_directive): Remove arguments, change return type.
	(parse_directive): New function.
	(pass_sprintf_length::compute_format_length): Move directive
	parsing to parse_directive.

diff --git a/gcc/gimple-ssa-sprintf.c b/gcc/gimple-ssa-sprintf.c
index 76e8512..3464b45 100644
--- a/gcc/gimple-ssa-sprintf.c
+++ b/gcc/gimple-ssa-sprintf.c
@@ -82,7 +82,7 @@ along with GCC; see the file COPYING3.  If not see
 /* The likely worst case value of MB_LEN_MAX for the target, large enough
for UTF-8.  Ideally, this would be obtained by a target hook if it were
to be used for optimization but it's good enough as is for warnings.  */
-#define target_mb_len_max   6
+#define target_mb_len_max()   6
 
 /* The maximum number of bytes a single non-string directive can result
in.  This is the result of printf("%.*Lf", INT_MAX, -LDBL_MAX) for
@@ -141,7 +141,9 @@ pass_sprintf_length::gate (function *)
  not optimizing and the pass is being invoked early, or when
  optimizing and the pass is being invoked during optimization
  (i.e., "late").  */
-  return ((warn_format_overflow > 0 || flag_printf_return_value)
+  return ((warn_format_overflow > 0
+	   || warn_format_trunc > 0
+	   || flag_printf_return_value)
 	  && (optimize > 0) == fold_return_value);
 }
 
@@ -215,20 +217,26 @@ struct format_result
   }
 
   /* Increment the number of output characters by N.  */
-  format_result& operator+= (unsigned HOST_WIDE_INT n)
-  {
-gcc_assert (n < HOST_WIDE_INT_MAX);
-
-if (number_chars < HOST_WIDE_INT_MAX)
-  number_chars += n;
-if (number_chars_min < HOST_WIDE_INT_MAX)
-  number_chars_min += n;
-if (number_chars_max < HOST_WIDE_INT_MAX)
-  number_chars_max += n;
-return *this;
-  }
+  format_result& operator+= (unsigned HOST_WIDE_INT);
 };
 
+format_result&
+format_result::operator+= (unsigned HOST_WIDE_INT n)
+{
+  gcc_assert (n < HOST_WIDE_INT_MAX);
+
+  if (number_chars < HOST_WIDE_INT_MAX)
+number_chars += n;
+
+  if (number_chars_min < HOST_WIDE_INT_MAX)
+number_chars_min += n;
+
+  if (number_chars_max < HOST_WIDE_INT_MAX)
+number_chars_max += n;
+
+  return *this;
+}
+
 /* Return the value of INT_MIN for the target.  */
 
 static inline HOST_WIDE_INT
@@ -438,10 +446,30 @@ struct result_range
 
 struct fmtresult
 {
-  fmtresult ()
-  : argmin (), argmax (), knownrange (), bounded (), constant (), nullp ()
+  /* Construct a FMTRESULT object with all counters initialized
+ to MIN.  KNOWNRANGE is set when MIN is valid.  */
+  fmtresult (unsigned HOST_WIDE_INT min = HOST_WIDE_INT_MAX)
+  : argmin (), argmax (),
+knownrange (min < HOST_WIDE_INT_MAX),
+bounded (),
+constant (),
+nullp ()
   {
-range.min = range.max = HOST_WIDE_INT_MAX;
+range.min = min;
+range.max = min;
+  }
+
+  /* Construct a FMTRESULT object with all co

[PATCH 5/5] add support for width and precision ranges (PR 78703)

2017-01-22 Thread Martin Sebor

This is the last patch in the series.  It adds logic to handle
non-constant width and precision with range information to help
reduce both false positives false negatives.  The patch replaces
the scalar width and precision with two element arrays throughout
the pass and makes adjustments to reflect their bounds in the byte
counters.  Since the basic infrastructure for this is present in
the code the changes are fairly mechanical.
commit c0a1f67fedb531abaf4760e8cd5b9b037ef5d4c4
Author: Martin Sebor 
Date:   Sun Jan 22 12:37:33 2017 -0700

2017-01-22  Martin Sebor  

	* gimple-ssa-sprintf.c (adjust_for_width_or_precision): Change
	to accept adjustment as an array.
	(get_int_range): New function.
	(struct directive): Make width and prec arrays.
	(directive::set_width, directive::set_precision): Call get_int_range.
	(format_integer, format_floating): Handle width and precision ranges.
	(format_string, parse_directive): Same.

	gcc/testsuite:
	* gcc.dg/tree-ssa/builtin-snprintf-warn-1.c: Update
	* gcc.dg/tree-ssa/builtin-sprintf-warn-9.c: Rename...
	* gcc.dg/tree-ssa/builtin-sprintf-warn-10.c: ...to this.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-9.c: New test.

diff --git a/gcc/gimple-ssa-sprintf.c b/gcc/gimple-ssa-sprintf.c
index eec133a..58d 100644
--- a/gcc/gimple-ssa-sprintf.c
+++ b/gcc/gimple-ssa-sprintf.c
@@ -478,15 +478,15 @@ struct fmtresult
 range.unlikely = max;
   }
 
-  /* Adjust result upward to reflect the value the specified width
- or precision is known to have.  */
-  fmtresult& adjust_for_width_or_precision (HOST_WIDE_INT,
+  /* Adjust result upward to reflect the RANGE of values the specified
+ width or precision is known to be in.  */
+  fmtresult& adjust_for_width_or_precision (const HOST_WIDE_INT[2],
 	tree = NULL_TREE,
 	unsigned = 0, unsigned = 0);
 
   /* Return the maximum number of decimal digits a value of TYPE
  formats as on output.  */
-  static unsigned type_max_digits (tree type, int base);
+  static unsigned type_max_digits (tree, int);
 
   /* The range a directive's argument is in.  */
   tree argmin, argmax;
@@ -504,32 +504,21 @@ struct fmtresult
   bool nullp;
 };
 
-/* Adjust result upward to reflect the value SCALAR_ADJUST the specified
-   width or precision is known to have.  When non-null, TYPE denotes the
-   type of the directive whose result is being adjusted, BASE gives the
-   base of the directive (octal, decimal, or hex), and ADJ denotes
-   the additional adjustment to the LIKELY counter that may need to be
-   added when SCALAR_ADJUST represents a range.  */
+/* Adjust result upward to reflect the range ADJUST of values the
+   specified width or precision is known to be in.  When non-null,
+   TYPE denotes the type of the directive whose result is being
+   adjusted, BASE gives the base of the directive (octal, decimal,
+   or hex), and ADJ denotes the additional adjustment to the LIKELY
+   counter that may need to be added when ADJUST is a range.  */
 
 fmtresult&
-fmtresult::adjust_for_width_or_precision (HOST_WIDE_INT scalar_adjust,
+fmtresult::adjust_for_width_or_precision (const HOST_WIDE_INT adjust[2],
 	  tree type /* = NULL_TREE */,
 	  unsigned base /* = 0 */,
 	  unsigned adj /* = 0 */)
 {
   bool minadjusted = false;
 
-  /* Translate SCALAR_ADJUST to a "fake" range until width and precision
- ranges are handled.  */
-  HOST_WIDE_INT adjust[2];
-  if (scalar_adjust == HOST_WIDE_INT_MIN)
-{
-  adjust[0] = -1;
-  adjust[1] = target_int_max () + 1;
-}
-  else
-adjust[0] = adjust[1] = scalar_adjust;
-
   /* Adjust the minimum and likely counters.  */
   if (0 <= adjust[0])
 {
@@ -609,7 +598,12 @@ fmtresult::type_max_digits (tree type, int base)
   return prec * 301 / 1000 + 1;
 }
 
-/* Description of a format directive.  */
+static bool
+get_int_range (tree, tree, HOST_WIDE_INT *, HOST_WIDE_INT *,
+	   bool, HOST_WIDE_INT);
+
+/* Description of a format directive.  A directive is either a plain
+   string or a conversion specification that starts with '%'.  */
 
 struct directive
 {
@@ -623,10 +617,11 @@ struct directive
   /* A bitmap of flags, one for each character.  */
   unsigned flags[256 / sizeof (int)];
 
-  /* The specified width, or -1 if not specified.  */
-  HOST_WIDE_INT width;
-  /* The specified precision, or -1 if not specified.  */
-  HOST_WIDE_INT prec;
+  /* The range of values of the specified width, or -1 if not specified.  */
+  HOST_WIDE_INT width[2];
+  /* The range of values of the specified precision, or -1 if not
+ specified.  */
+  HOST_WIDE_INT prec[2];
 
   /* Length modifier.  */
   format_lengths modifier;
@@ -666,54 +661,36 @@ struct directive
   &= ~(1U << (c % (CHAR_BIT * sizeof *flags)));
   }
 
-  /* Set the width to VAL.  */
+  /* Set both bounds of the width range to VAL.  */
   void set_width (HOST_WIDE_INT val)
   {
-width = val;
+width[0] = width[1] = val;

RE: [wwwdocs] benchmarks/ -- cp2k.berlios.de/gfortran/ seems gone?

2017-01-22 Thread VandeVondele Joost
Hi Gerald,

cp2k moved to https://www.cp2k.org/ , but isn't running a nightly gcc trunk 
tester anymore. So, yes, patch is OK, unfortunately.

Joost


[libstdc++] manual/debug.xml: code.google.com uses https now

2017-01-22 Thread Gerald Pfeifer
Applied (as revision 244769).

Gerald

2017-01-22  Gerald Pfeifer  
 
* doc/xml/manual/debug.xml: code.google.com uses https now.

Index: doc/xml/manual/debug.xml
===
--- doc/xml/manual/debug.xml(revision 244769)
+++ doc/xml/manual/debug.xml(working copy)
@@ -234,7 +234,7 @@
   xlink:href="http://valgrind.org/docs/manual/hg-manual.html";> 
   Helgrind, and
   http://www.w3.org/1999/xlink"; 
-  xlink:href="http://code.google.com/p/data-race-test/";> 
+  xlink:href="https://code.google.com/p/data-race-test/";> 
   ThreadSanitizer (this refers to ThreadSanitizer v1, not the
   new "tsan" feature built-in to GCC itself).
 


[contrib] patch_tester.sh: remove $TARGET/libjava/testsuite/libjava.sum

2017-01-22 Thread Gerald Pfeifer
Committed. 

I hope that's about it, then as far as stray references to GCJ
or libgcj/libjava to...

Gerald


2017-01-23  Gerald Pfeifer  

* patch_tester.sh (TESTLOGS): Remove
$TARGET/libjava/testsuite/libjava.sum.

Index: patch_tester.sh
===
--- patch_tester.sh (revision 244770)
+++ patch_tester.sh (working copy)
@@ -191,7 +191,6 @@
 gcc/testsuite/objc/objc.sum
 $TARGET/libstdc++-v3/testsuite/libstdc++.sum
 $TARGET/libffi/testsuite/libffi.sum
-$TARGET/libjava/testsuite/libjava.sum
 $TARGET/libgomp/testsuite/libgomp.sum
 $TARGET/libmudflap/testsuite/libmudflap.sum"
 COMPILERS="gcc/cc1