Re: Second ping: Re: Add a configure option to disable system header canonicalizations (issue6495088)

2012-10-02 Thread Ollie Wild
Tom, this is mainly a libcpp change.  Would you mind taking a look?

Thanks,
Ollie

On Mon, Oct 1, 2012 at 9:56 AM, Simon Baldwin  wrote:
>
> Ping, again.
>
>
> On 21 September 2012 12:45, Simon Baldwin  wrote:
> >
> > Ping.
> >
> > http://gcc.gnu.org/ml/gcc-patches/2012-09/msg00459.html
> >
> > Full text of previous message and context at URL above.  No comments
> > or code changes since.  Patch description left below for convenience.
> >
> > >
> > > Add flags to disable system header canonicalizations.
> > >
> > > Libcpp may canonicalize system header paths with lrealpath() for
> > > diagnostics,
> > > dependency output, and similar.  If gcc is held in a symlink farm the
> > > canonicalized paths may be meaningless to users, and will also
> > > conflict with
> > > build frameworks that (for example) disallow absolute paths to header
> > > files.
> > >
> > > This change adds -f[no-]canonical-system-headers to the gcc command
> > > line, and
> > > a configure option --[en/dis]able-canonical-system-headers to set
> > > default
> > > behaviour, allowing the user to select whether or not to implement
> > > r186991.
> > > Default is enabled.  See also PR c++/52974.
> > >
> > > Tested for regressions with bootstrap builds of C and C++, both with
> > > and
> > > without configure --disable-canonical-system-headers.
> >
> > --
> > Google UK Limited | Registered Office: Belgrave House, 76 Buckingham
> > Palace Road, London SW1W 9TQ | Registered in England Number: 3977902
>
>
>
>
> --
> Google UK Limited | Registered Office: Belgrave House, 76 Buckingham
> Palace Road, London SW1W 9TQ | Registered in England Number: 3977902


Re: [patch][google/gcc-4_7] Extend expiration date for pr54127 (issue6817091)

2012-11-05 Thread Ollie Wild
OK.

Ollie


On Mon, Nov 5, 2012 at 12:40 PM, Paul Pluzhnikov  wrote:
> Greetings,
>
> This patch is for google/gcc-4_7 branch.
>
> Thanks,
>
>
> 2012-11-05  Paul Pluzhnikov  
>
> * contrib/testsuite-management/powerpc-grtev3-linux-gnu.xfail:
> extend expiration date for pr54127.
>
> Index: contrib/testsuite-management/powerpc-grtev3-linux-gnu.xfail
> ===
> --- contrib/testsuite-management/powerpc-grtev3-linux-gnu.xfail (revision 
> 193176)
> +++ contrib/testsuite-management/powerpc-grtev3-linux-gnu.xfail (working copy)
> @@ -1,9 +1,9 @@
>  # Temporarily ignore gcc pr54127.
> -expire=20121031 | FAIL: gcc.dg/torture/pr53589.c -O3 -g  (test for excess 
> errors)
> -expire=20121031 | FAIL: gcc.dg/torture/pr53589.c  -O3 -g  (internal compiler 
> error)
> +expire=20121231 | FAIL: gcc.dg/torture/pr53589.c -O3 -g  (test for excess 
> errors)
> +expire=20121231 | FAIL: gcc.dg/torture/pr53589.c  -O3 -g  (internal compiler 
> error)
>  # Temporarily ignore Google ref b/6983319.
> -expire=20121031 | FAIL: gcc.target/powerpc/regnames-1.c (test for excess 
> errors)
> -expire=20121031 | FAIL: gcc.target/powerpc/regnames-1.c (internal compiler 
> error)
> +expire=20121231 | FAIL: gcc.target/powerpc/regnames-1.c (test for excess 
> errors)
> +expire=20121231 | FAIL: gcc.target/powerpc/regnames-1.c (internal compiler 
> error)
>
>  FAIL: gfortran.dg/bessel_6.f90  -O0  execution test
>  FAIL: gfortran.dg/bessel_6.f90  -O1  execution test
>
> --
> This patch is available for review at http://codereview.appspot.com/6817091


Fix incorrect libstdc++ @headername macro invocation.

2012-11-27 Thread Ollie Wild
This patch fixes an incorrect invocation of the @headername Doxygen
macro.  Namely, multiple values must be separated by commas, not "or".
 The effect can be observed at
http://gcc.gnu.org/onlinedocs/gcc-4.7.2/libstdc++/api/a01484.html:

"This is an internal header file, included by other library headers.
Do not attempt to use it directly. Instead, include ="">."

Submitting as trivial, and will backport to google/gcc-4_7.

Google ref b/7621728.

Ollie


2012-11-27  Ollie Wild  

* include/bits/stl_tree.h (@headername): Fix incorrect Doxygen macro
invocation.
commit 952030841d65ce1d6153f5b682944b2215edc306
Author: Ollie Wild 
Date:   Tue Nov 27 14:37:05 2012 -0600

Fix incorrect @headername Doxygen macro invocation.

Format is @headername{hdr1,hdr2} not @headername{hdr1 or hdr2}.

2012-11-27  Ollie Wild  

* include/bits/stl_tree.h (@headername): Fix incorrect Doxygen macro
invocation.

diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index c6d0687..9d22b9d 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,8 @@
+2012-11-27  Ollie Wild  
+
+   * include/bits/stl_tree.h (@headername): Fix incorrect Doxygen macro
+   invocation.
+
 2012-11-26  Jonathan Wakely  
 
* include/std/functional (__is_socketlike): Change from class
diff --git a/libstdc++-v3/include/bits/stl_tree.h 
b/libstdc++-v3/include/bits/stl_tree.h
index 03a5e30..037aad3 100644
--- a/libstdc++-v3/include/bits/stl_tree.h
+++ b/libstdc++-v3/include/bits/stl_tree.h
@@ -54,7 +54,7 @@
 
 /** @file bits/stl_tree.h
  *  This is an internal header file, included by other library headers.
- *  Do not attempt to use it directly. @headername{map or set}
+ *  Do not attempt to use it directly. @headername{map,set}
  */
 
 #ifndef _STL_TREE_H


Re: [google/gcc-4_8] Fix libatomic testsuite for when GCC_UNDER_TEST is not plain xgcc

2013-05-01 Thread Ollie Wild
On Wed, May 1, 2013 at 9:04 AM, Simon Baldwin  wrote:
> Fix libatomic testsuite for when GCC_UNDER_TEST is not plain xgcc.
>
> Libatomic tests fail if GCC_UNDER_TEST is set to something other than a plain
> xgcc invocation (for example, when $CC requires a special -sysroot).  Fix
> testsuite files so that it uniformly uses CC_UNDER_TEST rather than any result
> from libgloss find_gcc.
>
> Okay for google/gcc-4_8?  google/main?

Any reason to not also submit this to trunk?

Ollie


Re: [PATCH] [Annotalysis] Add support for arrays in lock expressions

2011-11-08 Thread Ollie Wild
On Thu, Nov 3, 2011 at 1:20 PM, Delesley Hutchins  wrote:
>
> This patch adds support for array indexing (i.e. operator []) in lock
> expressions.  The current version of gcc seems to emit these as
> expressions involving pointer arithmetic, so we  update
> get_canonical_lock_expr() to handle such expressions.

This looks reasonable to me, but I don't have much familiarity with
Gimple.  Diego, can you please review?

Thanks,
Ollie


Re: [PATCH] [Annotalysis] Support trylock attributes on virtual methods.

2011-11-08 Thread Ollie Wild
On Tue, Nov 8, 2011 at 12:11 PM, Delesley Hutchins  wrote:
> This patch fixes a bug wherein the trylock attribute would not work if
> it was attached to a virtual method.

Diego, can you please review this?

Thanks,
Ollie


Re: Value type of map need not be default copyable

2012-08-07 Thread Ollie Wild
On Sat, Aug 4, 2012 at 10:34 AM, Paolo Carlini  wrote:
>
>
> First, I think we should add libstdc++ in CC.
>
> Thus, I would recommend people working in this area to begin with
> unordered_map, because in that case emplace is already available, assuming
> that's really the point (and therefore reverting the patch was a good idea,
> luckily an existing testcase helped us)
>
> At the same time an implementation of emplace is definitely welcome, in
> any case.

I've attached a patch for unordered_map which solves the rvalue
reference problem.  For efficiency, I've created a new
_M_emplace_bucket method rather than call emplace directly.

I've verified all libstdc++ tests pass (sorry for the previous
oversight) and am running the full GCC test suite now.  However, I'd
appreciate any feedback on whether this is a reasonable approach.  STL
hacking is way outside my comfort zone.  ;-)

If this looks good, I'll take a stab at std::map.

Thanks,
Ollie


2012-08-03  Ollie Wild  

* include/bits/hashtable.h (_M_emplace_bucket): New function.
* include/bits/hashtable_policy.h (operator[](key_type&&)): Replace
_M_insert_bucket call with _M_emplace_bucket.
* testsuite/23_containers/unordered_map/operators/2.cc: New test.
commit dd690a5f164326c552c2450af6270ec27e9bfd8e
Author: Ollie Wild 
Date:   Tue Aug 7 16:34:05 2012 -0500

2012-08-03  Ollie Wild  

* include/bits/hashtable.h (_M_emplace_bucket): New function.
* include/bits/hashtable_policy.h (operator[](key_type&&)): Replace
_M_insert_bucket call with _M_emplace_bucket.
* testsuite/23_containers/unordered_map/operators/2.cc: New test.

 2012-08-04  Paolo Carlini  
 
Revert:
diff --git a/libstdc++-v3/include/bits/hashtable.h 
b/libstdc++-v3/include/bits/hashtable.h
index 2faf0b3..869b0e9 100644
--- a/libstdc++-v3/include/bits/hashtable.h
+++ b/libstdc++-v3/include/bits/hashtable.h
@@ -588,6 +588,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
iterator
_M_insert_bucket(_Arg&&, size_type, __hash_code);
 
+  template
+   iterator
+   _M_emplace_bucket(size_type, __hash_code, _Args&&... __args);
+
 
   template
std::pair
@@ -1356,6 +1360,51 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
  }
   }
 
+  // Insert v in bucket n (assumes no element with its key already present).
+  template
+template
+  typename _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+ _H1, _H2, _Hash, _RehashPolicy,
+ _Traits>::iterator
+  _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,
+_H1, _H2, _Hash, _RehashPolicy, _Traits>::
+  _M_emplace_bucket(size_type __n, __hash_code __code, _Args&&... __args)
+  {
+   // First build the node to get access to the hash code
+   __node_type* __node = _M_allocate_node(std::forward<_Args>(__args)...);
+   __try
+ {
+
+   const __rehash_state& __saved_state = _M_rehash_policy._M_state();
+   std::pair __do_rehash
+ = _M_rehash_policy._M_need_rehash(_M_bucket_count,
+   _M_element_count, 1);
+
+   if (__do_rehash.first)
+ {
+   const key_type& __k = this->_M_extract()(__node->_M_v);
+   __n = __hash_code_base::_M_bucket_index(__k, __code,
+   __do_rehash.second);
+ }
+
+   this->_M_store_code(__node, __code);
+   if (__do_rehash.first)
+ _M_rehash(__do_rehash.second, __saved_state);
+
+   _M_insert_bucket_begin(__n, __node);
+   ++_M_element_count;
+   return iterator(__node);
+ }
+   __catch(...)
+ {
+   _M_deallocate_node(__node);
+   __throw_exception_again;
+ }
+  }
+
   // Insert v if no element with its key is already present.
   template_M_find_node(__n, __k, __code);
 
   if (!__p)
-   return __h->_M_insert_bucket(std::make_pair(std::move(__k),
-   mapped_type()),
-__n, __code)->second;
+   return __h->_M_emplace_bucket(__n, __code,
+ std::move(__k), mapped_type())->second;
   return (__p->_M_v).second;
 }
 
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/operators/2.cc 
b/libstdc++-v3/testsuite/23_containers/unordered_map/operators/2.cc
new file mode 100644
index 000..1940fa2
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/operators/2.cc
@@ -0,0 +1,44 @@
+// Copyright (C) 2012
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute 

[google/gcc-4_7] XFAIL map element_access test

2012-08-08 Thread Ollie Wild
As previously discussed, this patch XFAIL's the new libstdc++ failure
caused by http://gcc.gnu.org/viewcvs?revision=190129&view=revision.
It will be reverted once the issues discussed at
http://gcc.gnu.org/ml/gcc-patches/2012-08/msg00141.html have been
resolved.

Okay to submit to google/gcc-4_7?

Ollie


2012-08-08  Ollie Wild  

   * testsuite-management/powerpc-grtev3-linux-gnu.xfail: xfail
   23_containers/map/element_access/2.cc from libstdc++.
   * testsuite-management/x86_64-grtev3-linux-gnu.xfail: Ditto.
commit 0e6b70f28b33c1c017afb7374fc724cd61b62745
Author: Ollie Wild 
Date:   Wed Aug 8 16:48:19 2012 -0500

XFail 23_containers/map/element_access/2.cc compilation from libstedc++.

To be reverted once issues at
http://gcc.gnu.org/ml/gcc-patches/2012-08/msg00141.html are resolved.

diff --git a/contrib/ChangeLog.google-4_7 b/contrib/ChangeLog.google-4_7
index 4217fc8..c1664f9 100644
--- a/contrib/ChangeLog.google-4_7
+++ b/contrib/ChangeLog.google-4_7
@@ -1,3 +1,9 @@
+2012-08-08  Ollie Wild  
+
+   * testsuite-management/powerpc-grtev3-linux-gnu.xfail: xfail
+   23_containers/map/element_access/2.cc from libstdc++.
+   * testsuite-management/x86_64-grtev3-linux-gnu.xfail: Ditto.
+
 2012-08-06  Simon Baldwin  
 
 Cherry pick r190180 from google/main.
diff --git a/contrib/testsuite-management/powerpc-grtev3-linux-gnu.xfail 
b/contrib/testsuite-management/powerpc-grtev3-linux-gnu.xfail
index 14cd6c5..45752f8 100644
--- a/contrib/testsuite-management/powerpc-grtev3-linux-gnu.xfail
+++ b/contrib/testsuite-management/powerpc-grtev3-linux-gnu.xfail
@@ -170,3 +170,8 @@ FAIL: gcc.target/powerpc/pr46728-3.c scan-assembler-not pow
 FAIL: gcc.target/powerpc/pr46728-4.c scan-assembler-not pow
 FAIL: gcc.target/powerpc/pr46728-7.c scan-assembler-not pow
 FAIL: gcc.target/powerpc/pr46728-8.c scan-assembler-not pow
+
+# See http://gcc.gnu.org/ml/gcc-patches/2012-08/msg00141.html.  Revert once
+# that is resolved.
+UNRESOLVED: 23_containers/map/element_access/2.cc compilation failed to 
produce executable
+FAIL: 23_containers/map/element_access/2.cc (test for excess errors)
diff --git a/contrib/testsuite-management/x86_64-grtev3-linux-gnu.xfail 
b/contrib/testsuite-management/x86_64-grtev3-linux-gnu.xfail
index 38ab201..4fa47ec 100644
--- a/contrib/testsuite-management/x86_64-grtev3-linux-gnu.xfail
+++ b/contrib/testsuite-management/x86_64-grtev3-linux-gnu.xfail
@@ -63,3 +63,8 @@ flaky | FAIL: libmudflap.cth/pass40-frag.c output pattern test
 flaky | FAIL: libmudflap.cth/pass40-frag.c (-O2) execution test
 flaky | FAIL: libmudflap.cth/pass39-frag.c (-O3) (rerun 10) execution test
 flaky | FAIL: libgomp.graphite/force-parallel-6.c execution test
+
+# See http://gcc.gnu.org/ml/gcc-patches/2012-08/msg00141.html.  Revert once
+# that is resolved.
+UNRESOLVED: 23_containers/map/element_access/2.cc compilation failed to 
produce executable
+FAIL: 23_containers/map/element_access/2.cc (test for excess errors)


[google/gcc-4_7] XFAIL libitm failures

2012-08-09 Thread Ollie Wild
As discussed, this patch XFAILs the libitm failures uncovered by
http://gcc.gnu.org/viewcvs?view=revision&revision=190233.

OK for google/gcc-4_7?

Ollie

2012-08-09  Ollie Wild  

* testsuite-management/x86_64-grtev3-linux-gnu.xfail: XFAIL libitm
failuires.
commit 8d78568138de78f11935f92b3143149733ea0172
Author: Ollie Wild 
Date:   Thu Aug 9 14:38:51 2012 -0500

2012-08-09  Ollie Wild  

* testsuite-management/x86_64-grtev3-linux-gnu.xfail: XFAIL libitm
failuires.

diff --git a/contrib/ChangeLog.google-4_7 b/contrib/ChangeLog.google-4_7
index c1664f9..fbfc0f5 100644
--- a/contrib/ChangeLog.google-4_7
+++ b/contrib/ChangeLog.google-4_7
@@ -1,3 +1,8 @@
+2012-08-09  Ollie Wild  
+
+   * testsuite-management/x86_64-grtev3-linux-gnu.xfail: XFAIL libitm
+   failuires.
+
 2012-08-08  Ollie Wild  
 
* testsuite-management/powerpc-grtev3-linux-gnu.xfail: xfail
diff --git a/contrib/testsuite-management/x86_64-grtev3-linux-gnu.xfail 
b/contrib/testsuite-management/x86_64-grtev3-linux-gnu.xfail
index 4fa47ec..d68b543 100644
--- a/contrib/testsuite-management/x86_64-grtev3-linux-gnu.xfail
+++ b/contrib/testsuite-management/x86_64-grtev3-linux-gnu.xfail
@@ -68,3 +68,34 @@ flaky | FAIL: libgomp.graphite/force-parallel-6.c execution 
test
 # that is resolved.
 UNRESOLVED: 23_containers/map/element_access/2.cc compilation failed to 
produce executable
 FAIL: 23_containers/map/element_access/2.cc (test for excess errors)
+
+# libitm failures caused by missing --sysroot.
+UNRESOLVED: libitm.c++/dropref.C compilation failed to produce executable
+FAIL: libitm.c++/dropref.C (test for excess errors)
+UNRESOLVED: libitm.c++/eh-1.C compilation failed to produce executable
+FAIL: libitm.c++/eh-1.C (test for excess errors)
+FAIL: libitm.c++/throwdown.C (test for excess errors)
+FAIL: libitm.c/cancel.c (test for excess errors)
+UNRESOLVED: libitm.c/cancel.c compilation failed to produce executable
+FAIL: libitm.c/clone-1.c (test for excess errors)
+UNRESOLVED: libitm.c/clone-1.c compilation failed to produce executable
+FAIL: libitm.c/dropref-2.c (test for excess errors)
+UNRESOLVED: libitm.c/dropref-2.c compilation failed to produce executable
+UNRESOLVED: libitm.c/dropref.c compilation failed to produce executable
+FAIL: libitm.c/dropref.c (test for excess errors)
+FAIL: libitm.c/memcpy-1.c (test for excess errors)
+UNRESOLVED: libitm.c/memcpy-1.c compilation failed to produce executable
+FAIL: libitm.c/memset-1.c (test for excess errors)
+UNRESOLVED: libitm.c/memset-1.c compilation failed to produce executable
+UNRESOLVED: libitm.c/notx.c compilation failed to produce executable
+FAIL: libitm.c/notx.c (test for excess errors)
+UNRESOLVED: libitm.c/reentrant.c compilation failed to produce executable
+FAIL: libitm.c/reentrant.c (test for excess errors)
+FAIL: libitm.c/simple-1.c (test for excess errors)
+UNRESOLVED: libitm.c/simple-1.c compilation failed to produce executable
+UNRESOLVED: libitm.c/simple-2.c compilation failed to produce executable
+FAIL: libitm.c/simple-2.c (test for excess errors)
+FAIL: libitm.c/stackundo.c (test for excess errors)
+UNRESOLVED: libitm.c/stackundo.c compilation failed to produce executable
+UNRESOLVED: libitm.c/txrelease.c compilation failed to produce executable
+FAIL: libitm.c/txrelease.c (test for excess errors)


C++ PR 54197: lifetime of reference not properly extended

2012-08-13 Thread Ollie Wild
This patch fixes http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54197.

Certain constructs (see bug for examples) cause C++ references to be
initialized with COMPOUND_EXPR's.  The old logic was ignoring these,
causing those temporaries to be prematurely destroyed.

Tested on trunk via full x86_64 bootstrap and testsuite.

Okay for trunk and backport to gcc-4_7-branch?

Ollie


2012-08-13  Ollie Wild  

PR c++/54197
* gcc/cp/call.c (extend_ref_init_temps_1): Handle COMPOUND_EXPR trees.
* gcc/testsuite/g++.dg/init/lifetime3.C: New test.
commit dfd33145e3b32963e03b47bcc89f3eb2912714a6
Author: Ollie Wild 
Date:   Mon Aug 13 15:36:24 2012 -0500

2012-08-13  Ollie Wild  

PR c++/54197
* gcc/cp/call.c (extend_ref_init_temps_1): Handle COMPOUND_EXPR trees.
* gcc/testsuite/g++.dg/init/lifetime3.C: New test.

diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 5345f2b..b2fac16 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -8924,6 +8924,12 @@ extend_ref_init_temps_1 (tree decl, tree init, 
VEC(tree,gc) **cleanups)
   tree sub = init;
   tree *p;
   STRIP_NOPS (sub);
+  if (TREE_CODE (sub) == COMPOUND_EXPR)
+{
+  TREE_OPERAND(sub, 1) = extend_ref_init_temps_1 (
+   decl, TREE_OPERAND(sub, 1), cleanups);
+  return init;
+}
   if (TREE_CODE (sub) != ADDR_EXPR)
 return init;
   /* Deal with binding to a subobject.  */
diff --git a/gcc/testsuite/g++.dg/init/lifetime3.C 
b/gcc/testsuite/g++.dg/init/lifetime3.C
new file mode 100644
index 000..d099699
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/lifetime3.C
@@ -0,0 +1,37 @@
+// PR c++/26714
+// { dg-do run }
+
+extern "C" void abort();
+
+bool ok = false;
+struct A {
+  A() { }
+  ~A() { if (!ok) abort(); }
+};
+
+struct B {
+  static A foo() { return A(); }
+};
+
+B b_g;
+
+struct scoped_ptr {
+  B* operator->() const { return &b_g; }
+  B* get() const { return &b_g; }
+};
+
+B *get() { return &b_g; }
+
+int main()
+{
+  scoped_ptr f;
+  const A& ref1 = f->foo();
+  const A& ref2 = f.get()->foo();
+  const A& ref3 = get()->foo();
+  const A& ref4 = B::foo();
+  B *pf = f.get();
+  const A& ref5 = pf->foo();
+
+
+  ok = true;
+}


Re: C++ PR 54197: lifetime of reference not properly extended

2012-08-13 Thread Ollie Wild
On Mon, Aug 13, 2012 at 3:50 PM, Jakub Jelinek  wrote:
>
> The formatting doesn't match GCC coding conventions in several ways.
> You don't have spaces before (, and ( shouldn't be at the end of line if
> possible.

Updated patch attached.

Ollie
commit d023097c555a6f7cb84685fd7befedb550889d2c
Author: Ollie Wild 
Date:   Mon Aug 13 15:36:24 2012 -0500

2012-08-13  Ollie Wild  

PR c++/54197
* gcc/cp/call.c (extend_ref_init_temps_1): Handle COMPOUND_EXPR trees.
* gcc/testsuite/g++.dg/init/lifetime3.C: New test.

diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 5345f2b..f3a73af 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -8924,6 +8924,12 @@ extend_ref_init_temps_1 (tree decl, tree init, 
VEC(tree,gc) **cleanups)
   tree sub = init;
   tree *p;
   STRIP_NOPS (sub);
+  if (TREE_CODE (sub) == COMPOUND_EXPR)
+{
+  TREE_OPERAND (sub, 1)
+= extend_ref_init_temps_1 (decl, TREE_OPERAND (sub, 1), cleanups);
+  return init;
+}
   if (TREE_CODE (sub) != ADDR_EXPR)
 return init;
   /* Deal with binding to a subobject.  */
diff --git a/gcc/testsuite/g++.dg/init/lifetime3.C 
b/gcc/testsuite/g++.dg/init/lifetime3.C
new file mode 100644
index 000..d099699
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/lifetime3.C
@@ -0,0 +1,37 @@
+// PR c++/26714
+// { dg-do run }
+
+extern "C" void abort();
+
+bool ok = false;
+struct A {
+  A() { }
+  ~A() { if (!ok) abort(); }
+};
+
+struct B {
+  static A foo() { return A(); }
+};
+
+B b_g;
+
+struct scoped_ptr {
+  B* operator->() const { return &b_g; }
+  B* get() const { return &b_g; }
+};
+
+B *get() { return &b_g; }
+
+int main()
+{
+  scoped_ptr f;
+  const A& ref1 = f->foo();
+  const A& ref2 = f.get()->foo();
+  const A& ref3 = get()->foo();
+  const A& ref4 = B::foo();
+  B *pf = f.get();
+  const A& ref5 = pf->foo();
+
+
+  ok = true;
+}


Re: C++ PR 54197: lifetime of reference not properly extended

2012-08-15 Thread Ollie Wild
(Adding other C++ maintainers in case someone else wants to have a stab.)

Ping?

Ollie


On Mon, Aug 13, 2012 at 4:01 PM, Ollie Wild  wrote:
>
> On Mon, Aug 13, 2012 at 3:50 PM, Jakub Jelinek  wrote:
> >
> > The formatting doesn't match GCC coding conventions in several ways.
> > You don't have spaces before (, and ( shouldn't be at the end of line if
> > possible.
>
> Updated patch attached.
>
> Ollie


Re: C++ PR 54197: lifetime of reference not properly extended

2012-08-16 Thread Ollie Wild
On Thu, Aug 16, 2012 at 12:12 PM, Diego Novillo  wrote:
>
> I wonder if it wouldn't make more sense to iterate until we find the
> rightmost element in a compound_expr chain, but I don't think they are
> neither common nor long enough to matter.

Yeah, that was my thinking.  I can certainly do whatever the maintainers want.

> It looks like a good fix, but I would rather have a C++ maintainer
> give final approval for gcc-4_7-branch and trunk.  In the meantime,
> should we install it in google/gcc-4_7?  I can deal with any merge
> conflicts, in case the patch needs more work for the upstream
> branches.

I'll go ahead and submit to google/gcc-4_7, then.

Thanks,
Ollie


Re: C++ PR 54197: lifetime of reference not properly extended

2012-08-20 Thread Ollie Wild
On Thu, Aug 16, 2012 at 2:13 PM, Gabriel Dos Reis
 wrote:
>
> On Wed, Aug 15, 2012 at 9:52 AM, Ollie Wild  wrote:
> > (Adding other C++ maintainers in case someone else wants to have a
> > stab.)
> >
> > Ping?
>
> I consider Jason to be the expert on this; so let see what he says.
>
> -- Gaby

Jason, any idea when you can look at this?

The patch is about as short as they come, so it shouldn't take long to review.

Thanks,
Ollie


Re: C++ PR 54197: lifetime of reference not properly extended

2012-08-28 Thread Ollie Wild
On Mon, Aug 20, 2012 at 9:58 AM, Ollie Wild  wrote:
>
> Jason, any idea when you can look at this?
>
> The patch is about as short as they come, so it shouldn't take long to
> review.

Ping?


Re: [google/integration] Add a configure option to disable system header canonicalizations (issue6489063)

2012-08-31 Thread Ollie Wild
On Fri, Aug 31, 2012 at 7:20 AM, Simon Baldwin  wrote:
> Add a configure option to disable system header canonicalizations.
>
> Libcpp may canonicalize system header paths with lrealpath() for diagnostics,
> dependency output, and similar.  If gcc is held in a symlink farm the
> canonicalized paths may be meaningless to users, and will also conflict with
> build frameworks that (for example) disallow absolute paths to header files.
>
> Tested with bootstrap builds of C and C++, both with and without configure
> --disable-canonical-system-headers.  Okay for google/integration?

Seems like a reasonable candidate for trunk, and I'd rather have fewer
patches in google/integration than more.  Can you send a copy of this
patch for inclusion there?  Let's at least see what people say.

Ollie


Re: [google/integration] Add a configure option to disable system header canonicalizations (issue6489063)

2012-08-31 Thread Ollie Wild
On Fri, Aug 31, 2012 at 10:01 AM, Simon Baldwin  wrote:
> On 31 August 2012 16:31, Ollie Wild  wrote:
>>
>
> The patch exactly meets the definition of google/integration only,
> which is that it fixes up something that affects only Google's use of
> gcc.

The criterion is more subtle than that.  The google/integration branch
is for things which: (a) cannot be submitted to trunk, and (b) are
required for inter-operability with our build/test systems.  The goal
is to keep any changes relative to trunk as minimal as possible, and
frankly, much of the stuff that's there now should be cleaned up and
submitted upstream.

>  --no-canonical-prefixes is similar.  That too is only in our
> branches and not in trunk, for the same reason.

But -no-canonical-prefixes *is* in trunk.  Presumably the same people
who benefit from that will also benefit from this.  In fact, I think a
reasonable case could be made that header canonicalization should be
gated on the same flag.

>
> I'd rather keep this out of trunk unless there are known external use
> cases where it's beneficial.  That keeps both the review and the
> testing load to acceptable -- though still extremely high -- levels.

The same argument could be made about *any* patch we submit.  Pushing
upstream is always more work, but if we don't do it, we end up paying
for it later.

Ollie


Re: C++ PR 54197: lifetime of reference not properly extended

2012-08-31 Thread Ollie Wild
On Fri, Aug 31, 2012 at 10:37 AM, Jason Merrill  wrote:
> OK, sorry for the delay.

No worries.  Thanks.

Submitted to trunk and gcc-4_7-branch as r190834 and r190839.

Ollie


Re: [google/integration] Add a configure option to disable system header canonicalizations (issue6489063)

2012-09-04 Thread Ollie Wild
On Fri, Aug 31, 2012 at 10:30 AM, Simon Baldwin  wrote:
>
> Yes.  I meant --disable-canonical-prefixes.  That is a gcc configure
> flag that we use to control the default setting for
> -[no-]canonical-prefixes where neither flag is supplied on the gcc
> command line.  --disable/enable-canonical-prefixes is only in google
> branches.

I did a little archaeology.  AFAICT, there was no specific objection
to pushing --disable-canonical-prefixes into upstream trunk.  The
feedback I see to your initial post was "send us a trunk-based patch"
and "here are some minor nits to cleanup."  It basically sounds like
upstream was neutral to the patch and would probably accept it if we
actually sent something for review.

I still think this is something that is both reasonable and feasible
to push upstream.  We should at least try to get some feedback first.
While there aren't a lot of people using symlink farms, I'd be
surprised if we were the only ones.

Ollie


[google] remove versioned symbols from libstdc++.a

2012-09-05 Thread Ollie Wild
This is a Google-local fix to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54482.

When configured with --with-pic, libstdc++.a includes versioned
symbols, preventing it from being linked into shared libraries.  The
ultimate cause of this is a misuse of -DPIC as a proxy for, "I'm being
compiled into a shared library."  Unfortunately, there is no obvious
alternative without first patching libtool.

This patch provides a temporary workaround for the google/* branches.
It creates new libtool options, -Xcompiler-static and
-Xcompiler-shared, which pass flags only when compiling static or
shared libraries, respectively.  I then use the new machinery to pass
-UPIC to the static library compilations.  This has the effect of
tricking libstdc++ into behaving properly.

Ideally, a new macro should be used, since there are legitimate cases
when PIC could be useful (e.g. in selecting between alternate assembly
implementations).  However, the current approach is less likely to
break under future merge activity, since any new compatibility changes
should "just work."

Long term, the correct solution is to: (a) convert this to a suitable
libtool patch and push that upstream, (b) update GCC's libtool
version, and (c) rework the libstdc++ source files to key off a more
appropriate macro (e.g. SHARED_LIB).  That's going to take some time,
though, especially since upgrading libtool is a major (and rare)
event.

Okay for google/integration and google/gcc-4_7?

Thanks,
Ollie


2012-09-05  Ollie Wild  

* ltmain.sh (func_mode_compile): Add -Xcompiler-shared and
-Xcompiler-static options.
(func_mode_help): Document new options.
* libstdc++/src/Makefile.am (LTCXXCOMPILE): Pass -UPIC when compiling
static libraries.
* libstdc++/src/Makefile.in: Regenerate.
commit 7208cb10bcf3f1bfab77aa6756fc0b2672bd39fa
Author: Ollie Wild 
Date:   Tue Sep 4 14:35:19 2012 -0500

Add new libtool options -Xcompiler-shared and -Xcompiler-static.

Use this to remove versioned symbols from libstdc++.a when configured with
--with-pic.

Google ref b/7088884

2012-09-05  Ollie Wild  

* ltmain.sh (func_mode_compile): Add -Xcompiler-shared and
-Xcompiler-static options.
(func_mode_help): Document new options.
* libstdc++/src/Makefile.am (LTCXXCOMPILE): Pass -UPIC when compiling
static libraries.
* libstdc++/src/Makefile.in: Regenerate.

diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am
index a1eb04d..d166155 100644
--- a/libstdc++-v3/src/Makefile.am
+++ b/libstdc++-v3/src/Makefile.am
@@ -147,7 +147,8 @@ LTCXXCOMPILE = \
$(LIBTOOL) --tag CXX \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CXX) $(INCLUDES) \
-   $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+   $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) \
+   -Xcompiler-static -UPIC
 
 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
 
diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in
index b10d853..e0578a2 100644
--- a/libstdc++-v3/src/Makefile.in
+++ b/libstdc++-v3/src/Makefile.in
@@ -406,7 +406,8 @@ LTCXXCOMPILE = \
$(LIBTOOL) --tag CXX \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CXX) $(INCLUDES) \
-   $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+   $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) \
+   -Xcompiler-static -UPIC
 
 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
 
diff --git a/ltmain.sh b/ltmain.sh
index 6428631..3aac68f 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -1280,6 +1280,8 @@ func_mode_compile ()
 $opt_debug
 # Get the compilation command and the source file.
 base_compile=
+shared_compile=
+static_compile=
 srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
 suppress_opt=yes
 suppress_output=
@@ -1303,6 +1305,20 @@ func_mode_compile ()
continue
;;
 
+  xcompiler-shared )
+arg_mode=normal
+   func_quote_for_eval "$arg"
+   shared_compile="$shared_compile $func_quote_for_eval_result"
+   continue
+   ;;
+
+  xcompiler-static )
+arg_mode=normal
+   func_quote_for_eval "$arg"
+   static_compile="$static_compile $func_quote_for_eval_result"
+   continue
+   ;;
+
   normal )
# Accept any command-line options.
case $arg in
@@ -1333,6 +1349,18 @@ func_mode_compile ()
  continue  #  The current "srcfile" will either be retained or
  ;;#  replaced later.  I would guess that would be a bug.
 
+   -Xcompiler-shared)
+ arg_mode=xcompiler-shared  #  the next one goes into the
+#  "shared_compile" arg list
+ co

Re: [google] remove versioned symbols from libstdc++.a

2012-09-05 Thread Ollie Wild
Commited as r191006 and r191007.

Ollie

On Wed, Sep 5, 2012 at 10:50 PM, Paul Pluzhnikov  wrote:
> On Wed, Sep 5, 2012 at 6:26 PM, Ollie Wild  wrote:
>
>> Okay for google/integration and google/gcc-4_7?
>
> Approved for google/* branches.
>
> Thanks,
> --
> Paul Pluzhnikov


[google/gcc-4_7] fix race in __cxa_guard_acquire

2012-09-19 Thread Ollie Wild
This is a merge of r191125 and r191191 from gcc-4_7-branch.  It fixes
a race in __cxa_guard_acquire which can cause duplicate initialization
of static variables within functions.

Okay for google/gcc-4_7?

Thanks,
Ollie


Google ref b/7173106.

* libsupc++/guard.cc (__cxa_guard_acquire): Exit the loop earlier if
we detect that another thread has had success. Don't compare_exchange
from a finished state back to a waiting state.  Fix up the last
argument of the first __atomic_compare_exchange_n.  Comment.
commit 40ec687ace62b4d4c64f72be2bdf4321f5213107
Author: Ollie Wild 
Date:   Wed Sep 19 14:52:53 2012 -0500

Merge r191125 and r191191 from gcc-4_7-branch.

Google ref b/7173106.

* libsupc++/guard.cc (__cxa_guard_acquire): Exit the loop earlier if
we detect that another thread has had success. Don't compare_exchange
from a finished state back to a waiting state.  Fix up the last
argument of the first __atomic_compare_exchange_n.  Comment.

diff --git a/libstdc++-v3/libsupc++/guard.cc b/libstdc++-v3/libsupc++/guard.cc
index adc9608..f8550c0 100644
--- a/libstdc++-v3/libsupc++/guard.cc
+++ b/libstdc++-v3/libsupc++/guard.cc
@@ -244,16 +244,16 @@ namespace __cxxabiv1
 if (__gthread_active_p ())
   {
int *gi = (int *) (void *) g;
-   int expected(0);
const int guard_bit = _GLIBCXX_GUARD_BIT;
const int pending_bit = _GLIBCXX_GUARD_PENDING_BIT;
const int waiting_bit = _GLIBCXX_GUARD_WAITING_BIT;
 
while (1)
  {
+   int expected(0);
if (__atomic_compare_exchange_n(gi, &expected, pending_bit, false,
__ATOMIC_ACQ_REL,
-   __ATOMIC_RELAXED))
+   __ATOMIC_ACQUIRE))
  {
// This thread should do the initialization.
return 1;
@@ -264,13 +264,26 @@ namespace __cxxabiv1
// Already initialized.
return 0;   
  }
+
 if (expected == pending_bit)
   {
+// Use acquire here.
 int newv = expected | waiting_bit;
 if (!__atomic_compare_exchange_n(gi, &expected, newv, false,
  __ATOMIC_ACQ_REL, 
- __ATOMIC_RELAXED))
-  continue;
+ __ATOMIC_ACQUIRE))
+  {
+if (expected == guard_bit)
+  {
+// Make a thread that failed to set the
+// waiting bit exit the function earlier,
+// if it detects that another thread has
+// successfully finished initialising.
+return 0;
+  }
+if (expected == 0)
+  continue;
+  }
 
 expected = newv;
   }


Value type of map need not be default copyable

2012-08-02 Thread Ollie Wild
Patch courtesy Richard Smith at Google:

Fix bug in the implementation of std::map's operator[]. Construct an
object of type value_type, rather than using std::make_pair, so as to
allow mapped_type to have an *explicit* copy constructor.

See [map.access] (23.4.4.3)/5 for the corresponding standardese.

Tested via bootstrap + test.

Okay for trunk?

Thanks,
Ollie


2012-08-02  Ollie Wild  
Richard Smith  

* include/bits/stl_map.h (operator[](key_type&&)): Replace
std::make_pair with value_type.
* testsuite/23_containers/map/operators/2.cc: New test.
diff --git a/libstdc++-v3/include/bits/stl_map.h 
b/libstdc++-v3/include/bits/stl_map.h
index cfd478a..a3abdd4 100644
--- a/libstdc++-v3/include/bits/stl_map.h
+++ b/libstdc++-v3/include/bits/stl_map.h
@@ -475,7 +475,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
iterator __i = lower_bound(__k);
// __i->first is greater than or equivalent to __k.
if (__i == end() || key_comp()(__k, (*__i).first))
-  __i = insert(__i, std::make_pair(std::move(__k), mapped_type()));
+  __i = insert(__i, value_type(std::move(__k), mapped_type()));
return (*__i).second;
   }
 #endif
diff --git a/libstdc++-v3/testsuite/23_containers/map/operators/2.cc 
b/libstdc++-v3/testsuite/23_containers/map/operators/2.cc
new file mode 100644
index 000..ce633d7
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/map/operators/2.cc
@@ -0,0 +1,38 @@
+// Copyright (C) 2012
+// 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.4.4 template class map
+
+// This test verifies that the value type of a map need not be default
+// copyable.
+
+// { dg-do compile }
+// { dg-options "-std=gnu++11" }
+
+#include 
+
+struct Mapped {
+Mapped();
+explicit Mapped(const Mapped&);
+};
+
+Mapped & foo()
+{
+  std::map m;
+  return m[0];
+}


Re: Value type of map need not be default copyable

2012-08-03 Thread Ollie Wild
On Fri, Aug 3, 2012 at 2:39 AM, Paolo Carlini  wrote:
>
> Ok, but, can you also double check and in case fix unordered_map too?
> Looks like we have the same issue, right?

Indeed, we do.  I'll send a separate patch for the unordered_map problem.

>
> Thanks!
> Paolo.
>
> PS: remember that all the library patches go to libstdc++@ too, and
> preferably please add something to the Subject about the library (like "[v3]
> ... ")

Thanks for the reminder.

Ollie


Re: [google/main] Add powerpc-grtev3-linux-gnu.xfail to contrib/testsuite-management (issue6447087)

2012-08-06 Thread Ollie Wild
OK.  Don't forget to add xfail files for google/trunk and google/gcc-4_7, too.

Ollie


On Fri, Aug 3, 2012 at 9:14 AM, Simon Baldwin  wrote:
>
> Add powerpc-grtev3-linux-gnu.xfail to contrib/testsuite-management.
>
> Tested with build followed by validate_failures.py.
>
> 2012-08-03  Simon Baldwin  
>
> * testsuite-management/powerpc-grtev3-linux-gnu.xfail: New.
>
>
> Index: contrib/testsuite-management/powerpc-grtev3-linux-gnu.xfail
> ===
> --- contrib/testsuite-management/powerpc-grtev3-linux-gnu.xfail (revision
> 0)
> +++ contrib/testsuite-management/powerpc-grtev3-linux-gnu.xfail (revision
> 0)
> @@ -0,0 +1,172 @@
> +# Temporarily ignore gcc pr54127.
> +expire=20121031 | FAIL: gcc.dg/torture/pr53589.c -O3 -g  (test for excess
> errors)
> +expire=20121031 | FAIL: gcc.dg/torture/pr53589.c  -O3 -g  (internal
> compiler error)
> +
> +FAIL: gfortran.dg/bessel_6.f90  -O0  execution test
> +FAIL: gfortran.dg/bessel_6.f90  -O1  execution test
> +FAIL: gfortran.dg/bessel_6.f90  -O2  execution test
> +FAIL: gfortran.dg/bessel_6.f90  -O3 -fomit-frame-pointer  execution test
> +FAIL: gfortran.dg/bessel_6.f90  -O3 -fomit-frame-pointer -funroll-loops
> execution test
> +FAIL: gfortran.dg/bessel_6.f90  -O3 -fomit-frame-pointer
> -funroll-all-loops -finline-functions  execution test
> +FAIL: gfortran.dg/bessel_6.f90  -O3 -g  execution test
> +FAIL: gfortran.dg/bessel_6.f90  -Os  execution test
> +XPASS: gfortran.dg/nint_2.f90  -O0  execution test
> +FAIL: gfortran.dg/unf_io_convert_3.f90  -O0  execution test
> +FAIL: gfortran.dg/unf_io_convert_3.f90  -O1  execution test
> +FAIL: gfortran.dg/unf_io_convert_3.f90  -O2  execution test
> +FAIL: gfortran.dg/unf_io_convert_3.f90  -O3 -fomit-frame-pointer
> execution test
> +FAIL: gfortran.dg/unf_io_convert_3.f90  -O3 -fomit-frame-pointer
> -funroll-loops  execution test
> +FAIL: gfortran.dg/unf_io_convert_3.f90  -O3 -fomit-frame-pointer
> -funroll-all-loops -finline-functions  execution test
> +FAIL: gfortran.dg/unf_io_convert_3.f90  -O3 -g  execution test
> +FAIL: gfortran.dg/unf_io_convert_3.f90  -Os  execution test
> +FAIL: gfortran.dg/x_slash_2.f  -O0  execution test
> +FAIL: g++.dg/abi/forced.C -std=gnu++98 execution test
> +FAIL: g++.dg/abi/forced.C -std=gnu++11 execution test
> +FAIL: g++.dg/ext/cleanup-10.C -std=gnu++98 execution test
> +FAIL: g++.dg/ext/cleanup-10.C -std=gnu++11 execution test
> +FAIL: g++.dg/ext/cleanup-11.C -std=gnu++98 execution test
> +FAIL: g++.dg/ext/cleanup-11.C -std=gnu++11 execution test
> +FAIL: g++.dg/ext/cleanup-8.C -std=gnu++98 execution test
> +FAIL: g++.dg/ext/cleanup-8.C -std=gnu++11 execution test
> +FAIL: g++.dg/ext/cleanup-9.C -std=gnu++98 execution test
> +FAIL: g++.dg/ext/cleanup-9.C -std=gnu++11 execution test
> +FAIL: g++.dg/warn/Wself-assign-2.C -std=gnu++11  (test for warnings, line
> 12)
> +FAIL: g++.dg/tree-prof/lipo/vcall1_0.C scan-ipa-dump-times profile
> "Indirect call -> direct call" 2
> +FAIL: g++.dg/tree-prof/lipo/vcall1_0.C scan-ipa-dump-times profile
> "Indirect call -> direct call" 2
> +FAIL: g++.dg/tree-prof/lipo/vcall1_0.C scan-ipa-dump-times profile
> "Indirect call -> direct call" 2
> +FAIL: g++.dg/tree-prof/lipo/vcall1_0.C scan-ipa-dump-times profile
> "Indirect call -> direct call" 2
> +FAIL: g++.dg/tree-prof/lipo/vcall1_0.C scan-ipa-dump-times profile
> "Indirect call -> direct call" 2
> +FAIL: g++.dg/tree-prof/lipo/vcall1_0.C scan-ipa-dump-times profile
> "Indirect call -> direct call" 2
> +FAIL: g++.dg/tree-prof/lipo/vcall1_0.C scan-ipa-dump-times profile
> "Indirect call -> direct call" 2
> +UNRESOLVED: g++.dg/tree-prof/callgraph-profiles.C scan-file Callgraph
> group : main _Z3barv _Z3foov\n
> +UNRESOLVED: g++.dg/tree-prof/callgraph-profiles.C scan-file
> .text.*.main\n.text.*._Z3barv\n.text.*._Z3foov\n.text.*._Z9notcalledv
> +UNRESOLVED: g++.dg/tree-prof/callgraph-profiles.C scan-file Callgraph
> group : main _Z3barv _Z3foov\n
> +UNRESOLVED: g++.dg/tree-prof/callgraph-profiles.C scan-file
> .text.*.main\n.text.*._Z3barv\n.text.*._Z3foov\n.text.*._Z9notcalledv
> +UNRESOLVED: g++.dg/tree-prof/callgraph-profiles.C scan-file Callgraph
> group : main _Z3barv _Z3foov\n
> +UNRESOLVED: g++.dg/tree-prof/callgraph-profiles.C scan-file
> .text.*.main\n.text.*._Z3barv\n.text.*._Z3foov\n.text.*._Z9notcalledv
> +UNRESOLVED: g++.dg/tree-prof/callgraph-profiles.C scan-file Callgraph
> group : main _Z3barv _Z3foov\n
> +UNRESOLVED: g++.dg/tree-prof/callgraph-profiles.C scan-file
> .text.*.main\n.text.*._Z3barv\n.text.*._Z3foov\n.text.*._Z9notcalledv
> +UNRESOLVED: g++.dg/tree-prof/callgraph-profiles.C scan-file Callgraph
> group : main _Z3barv _Z3foov\n
> +UNRESOLVED: g++.dg/tree-prof/callgraph-profiles.C scan-file
> .text.*.main\n.text.*._Z3barv\n.text.*._Z3foov\n.text.*._Z9notcalledv
> +UNRESOLVED: g++.dg/tree-prof/callgraph-profiles.C scan-file Callgraph
> group : main _Z3barv _Z3foov\n
> +UNRESOLVED: g++.dg/tree-prof/callgraph-profiles.C scan-

Re: PR c++/52538 Extend C++11 UDLs to be compatible with inttypes.h macros (issue6109043)

2012-04-27 Thread Ollie Wild
On Thu, Apr 26, 2012 at 8:35 AM, Tom Tromey  wrote:
>
> This is ok with this change.

Thanks.  Updated and submitted to trunk.

Ollie


Re: [google] Hide all uses of __float128 from Clang (issue6195066)

2012-05-09 Thread Ollie Wild
On Wed, May 9, 2012 at 8:19 AM, Simon Baldwin  wrote:
>
> Hide all uses of __float128 from Clang.
>
> Brackets _GLIBCXX_USE_FLOAT128 with #ifndef __clang__.  Clang does not
> currently support the __float128 builtin, and so will fail to process
> libstdc++ headers that use it.
>
> Tested for full bootstrap and dejagnu testsuite.
>
> Okay for google/integration and google/gcc-4_7-integration branches?

Please check this into google/gcc-4_7 as well.

Ollie


[google/gcc-4_7] Allow static const floats unless -pedantic is passed (issue6212051)

2012-05-15 Thread Ollie Wild
To be applied to google/gcc-4_7.

Allow static const floats unless -pedantic is passed.

This patch allows us to migrate to C++11 more incrementally, since we can leave
the static const float initializations in place, flip the switch, and then
change it to use constexpr.

This is a forward port of r180638 from google/gcc-4_6 (despite the fact that
that revision says to NOT forward-port this).  Minor additional fixups have
been applied.

2012-05-15   Ollie Wild  

* gcc/cp/decl.c (check_static_variable_definition): Only generate a
constexpr warning when -pedantic is enabled.
* gcc/testsuite/g++.dg/cpp0x/constexpr-static8.C: Replace -fpermissive
with -pedantic.
* gcc/testsuite/g++.dg/cpp0x/constexpr-static8_nonpedantic.C: New test.
* gcc/testsuite/g++.old-deja/g++.ext/memconst.C: Compile with -pedantic
-pedantic-errors to work around test failures with -std=gnu++11.

diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index bb26d15..d2fe731 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -7861,9 +7861,18 @@ check_static_variable_definition (tree decl, tree type)
error ("in-class initialization of static data member %q#D of "
   "incomplete type", decl);
   else if (literal_type_p (type))
-   permerror (input_location,
-  "% needed for in-class initialization of "
-  "static data member %q#D of non-integral type", decl);
+   {
+  /* FIXME google: This local modification allows us to
+ transition from C++98 to C++11 without moving static
+ const floats out of the class during the transition.  It
+ should not be forward-ported to a 4.8 branch, since by
+ then we should be able to just fix the code to use
+ constexpr.  */
+  pedwarn (input_location, OPT_pedantic,
+   "% needed for in-class initialization of "
+   "static data member %q#D of non-integral type", decl);
+  return 0;
+   }
   else
error ("in-class initialization of static data member %q#D of "
   "non-literal type", decl);
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-static8.C 
b/gcc/testsuite/g++.dg/cpp0x/constexpr-static8.C
index 7c84cf8..658a458 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-static8.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-static8.C
@@ -1,5 +1,5 @@
 // PR c++/50258
-// { dg-options "-std=c++0x -fpermissive" }
+// { dg-options "-std=c++0x -pedantic" }
 
 struct Foo {
   static const double d = 3.14; // { dg-warning "constexpr" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-static8_nonpedantic.C 
b/gcc/testsuite/g++.dg/cpp0x/constexpr-static8_nonpedantic.C
new file mode 100644
index 000..28d34a1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-static8_nonpedantic.C
@@ -0,0 +1,7 @@
+// PR c++/50258
+// { dg-options "-std=c++0x" }
+
+struct Foo {
+  static const double d = 3.14; // no warning
+};
+const double Foo::d;
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/memconst.C 
b/gcc/testsuite/g++.old-deja/g++.ext/memconst.C
index d934763..7e86156 100644
--- a/gcc/testsuite/g++.old-deja/g++.ext/memconst.C
+++ b/gcc/testsuite/g++.old-deja/g++.ext/memconst.C
@@ -1,5 +1,5 @@
 // { dg-do assemble  }
-// { dg-options "" }
+// { dg-options "-pedantic -pedantic-errors" }
 // From: ove.ewer...@syscon.uu.se (Ove Ewerlid)
 // Subject: ss-940630:cc1plus: internal error
 // Date: Sat, 2 Jul 1994 05:07:20 +0200

--
This patch is available for review at http://codereview.appspot.com/6212051


Re: [PATCH] [Annotalysis] Fix internal compiler error on template methods

2011-09-29 Thread Ollie Wild
I think what you're looking for is:

if (DECL_CLONED_FUNCTION_P (clone) && DECL_CLONED_FUNCTION (clone) == decl)

That's a much cleaner implementation.

Ollie

On Tue, Sep 27, 2011 at 6:18 PM, Delesley Hutchins  wrote:
>
> This patch fixes a bug in the parser which cause an internal compiler
> error when copying attributes from cloned methods.  The bug occurs
> when a class has both an annotated constructor and a template method.
>
> Bootstrapped and passed gcc regression testsuite on
> x86_64-unknown-linux-gnu.  Okay for google/gcc-4_6?
>
>  -DeLesley
>
> cp/Changelog.google-4_6:
> 2011-9-27  DeLesley Hutchins  
>
>      * cp/parser.c  (cp_parser_late_parsing_attribute_arg_lists)
>         fixed case where the potential clone is a template.
>
> testsuite/Changelog.google-4_6:
> 2011-9-27  DeLesley Hutchins  
>
>      * testsuite/g++.dg/thread-ann/thread_annot_lock-81.C
>        (new regression test)
>
> --
> DeLesley Hutchins | Software Engineer | deles...@google.com | 505-206-0315


Re: [PATCH] [Annotalysis] Fix internal compiler error on template methods

2011-09-29 Thread Ollie Wild
On Thu, Sep 29, 2011 at 10:13 AM, Delesley Hutchins  wrote:
>
> Unfortunately, DECL_CLONED_FUNCTION_P is not actually a predicate that allows 
> you to call DECL_CLONED_FUNCTION safely.  Look at the definition of the 
> macros; despite what the comments say, DECL_CLONED_FUNCTION_P may return true 
> in cases where DECL_CLONED_FUNCTION will still crash.  The correct fix is to 
> fix the macros, but I have no understanding of what they are actually doing.  
> :-(
>   -DeLesley

Diego, can you comment?

Ollie


Re: [PATCH] [Annotalysis] Bugfix for spurious thread safety warnings with shared mutexes

2011-10-11 Thread Ollie Wild
On Mon, Oct 10, 2011 at 3:37 PM, Delesley Hutchins  wrote:
>
> --- gcc/tree-threadsafe-analyze.c       (revision 179771)
> +++ gcc/tree-threadsafe-analyze.c       (working copy)
> @@ -1830,14 +1830,27 @@ remove_lock_from_lockset (tree lockable, struct po

This feels like a bug in lock_set_contains(), not
remove_lock_from_lockset().  I'd modify lock_set_contains() as
follows:

1) During the universal lock conditional, remove the return statement.
 Instead, set default_lock = lock (where default_lock is a new
variable initialized to NULL_TREE).

2) Anywhere NULL_TREE is returned later, replace it with default_lock.

Ollie


Re: [PATCH] [Annotalysis] Bugfix for spurious thread safety warnings with shared mutexes

2011-10-12 Thread Ollie Wild
On Wed, Oct 12, 2011 at 9:58 AM, Delesley Hutchins  wrote:
>
> I don't think that will fix this bug.  The bug occurs if:
> (1) The exclusive lock set has error_mark_node.
> (2) The shared lock set has the actual lock.

Oh, I see.  This change looks fine for google/gcc-4_6, then.

> If I understand your suggested fix correctly, lock_set_contains would
> still return non-null when the universal lock was present, which is
> not what we want.  IMHO, lock_set_contains is operating correctly; it
> was just passed the wrong arguments.

I still think there may be a bug in lock_set_contains, but my
knowledge of the code is insufficient to know if this can lead to
problems in practice.  Suppose the lock set contains both the supplied
lock and the universal lock, and ignore_universal_lock is false.  Then
lock_set_contains() will return the lock directly.  However, it
*should* return the canonicalized version of the lock.

Ollie


[google/integration] disable symbol hiding in libgcc for grtev3 targets (issue5792054)

2012-03-08 Thread Ollie Wild
To be submitted to google/integration and merged to google/{main,gcc-4_7}.
Would also like to have this considered for trunk, since this patch has no
impact on non-grtev3 targets.

Disable hiding of symbols in static libgcc libraries when built for GRTE v3.
This allows pthread_cancel to perform stack unwinding when libgcc_eh.a is
linked into dynamic executables.  However, this opens up a hole wherein shared
libraries linked with -static-libgcc cannot be individually modified without
risk of breaking dependent libraries.  That's okay in the GRTE v3 environment
because libgcc is compiled without -fPIC anyway.

See http://gcc.gnu.org/ml/gcc/2012-03/msg00104.html for details.

Google ref 5836136.

2012-03-08   Ollie Wild  

* libgcc/Makefile.in (vis_hide): Move default initialization before
inclusion of $(tmake_file).
* libgcc/config.host (*-grtev3-*): Disable hiding of symbols in static
libraries.
* libgcc/config/t-static-no-vis-hide: New file.

diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
index 23b72b9..41fbb96 100644
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -334,6 +334,12 @@ LIBUNWIND =
 SHLIBUNWIND_LINK =
 SHLIBUNWIND_INSTALL =
 
+# For -fvisibility=hidden.  We need both a -fvisibility=hidden on
+# the command line, and a #define to prevent libgcc2.h etc from
+# overriding that with #pragmas.  This is set before including $(tmake_file)
+# so it can be overridden on a host-specific basis.
+vis_hide = @vis_hide@
+
 tmake_file = @tmake_file@
 include $(srcdir)/empty.mk $(tmake_file)
 
@@ -363,11 +369,6 @@ ifeq ($(enable_shared),yes)
 install-libunwind = install-libunwind
   endif
 
-# For -fvisibility=hidden.  We need both a -fvisibility=hidden on
-# the command line, and a #define to prevent libgcc2.h etc from
-# overriding that with #pragmas.
-vis_hide = @vis_hide@
-
 ifneq (,$(vis_hide))
 
 # If we have -fvisibility=hidden, then we need to generate hide
diff --git a/libgcc/config.host b/libgcc/config.host
index 257622a..242fbd5 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -1174,3 +1174,10 @@ i[34567]86-*-linux* | x86_64-*-linux*)
tm_file="${tm_file} i386/value-unwind.h"
;;
 esac
+
+case ${host} in
+*-grtev3-*)
+   # Don't hide symbols in static libraries.
+   tmake_file="${tmake_file} t-static-no-vis-hide"
+   ;;
+esac
diff --git a/libgcc/config/t-static-no-vis-hide 
b/libgcc/config/t-static-no-vis-hide
new file mode 100644
index 000..955ff35
--- /dev/null
+++ b/libgcc/config/t-static-no-vis-hide
@@ -0,0 +1,2 @@
+# Don't hide symbols in static libraries.
+vis_hide =

--
This patch is available for review at http://codereview.appspot.com/5792054


Re: [google] Use delete with size parameter in STL deallocate (issue5794070)

2012-03-12 Thread Ollie Wild
On Mon, Mar 12, 2012 at 8:03 PM, Easwaran Raman  wrote:
>
> OK for google/main and google/4_6 branches?

You will need to check this into google/gcc-4_7 as well.

Ollie


[google/integration] Add -Xclang-only option (issue6047048)

2012-04-17 Thread Ollie Wild
To be submitted to the google/integration branch and merged into
google/{main,gcc-4_6,gcc-4_7}.

Add -Xclang-only option (which is ignored).

This is used by certain drivers to pass options selectively to clang.  Adding
support to the gcc driver makes it easier to test GCC in the absence of these
drivers.

Google ref 6302116.

2012-04-17   Ollie Wild  

* gcc/common.opt (Xclang-only): New option.
* gcc/doc/invoke.texi (Xclang-only): Document new option.
* gcc/gcc.c (display_help): Print new option.
(driver_handle_option): Support new option (ignoring args).


diff --git a/gcc/common.opt b/gcc/common.opt
index 4a751a9..39f0843 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -743,6 +743,9 @@ Warn when a vector operation is compiled outside the SIMD
 Xassembler
 Driver Separate
 
+Xclang-only
+Driver Joined
+
 Xlinker
 Driver Separate
 
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index d980e9f..1b61e76 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -9560,6 +9560,11 @@ systems using the GNU linker.  On some targets, such as 
bare-board
 targets without an operating system, the @option{-T} option may be required
 when linking to avoid references to undefined symbols.
 
+@item -Xclang-only @var{option}
+@opindex Xclang-only
+Ignore @var{option}.  This is used by some custom drivers to pass options
+to Clang but not GCC.
+
 @item -Xlinker @var{option}
 @opindex Xlinker
 Pass @var{option} as an option to the linker.  You can use this to
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 5f789fd..c6b48a6 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -2983,6 +2983,7 @@ display_help (void)
   fputs (_("  -Xassembler Pass  on to the assembler\n"), 
stdout);
   fputs (_("  -Xpreprocessor  Pass  on to the preprocessor\n"), 
stdout);
   fputs (_("  -XlinkerPass  on to the linker\n"), 
stdout);
+  fputs (_("  -Xclang-only=   Ignore \n"), stdout);
   fputs (_("  -save-temps  Do not delete intermediate files\n"), 
stdout);
   fputs (_("  -save-temps=Do not delete intermediate files\n"), 
stdout);
   fputs (_("\
@@ -3353,6 +3354,11 @@ driver_handle_option (struct gcc_options *opts,
   do_save = false;
   break;
 
+case OPT_Xclang_only:
+  /* Ignore the argument.  Used by some drivers to selectively pass
+ arguments to clang.  */
+  break;
+
 case OPT_Xlinker:
   add_infile (arg, "*");
   do_save = false;

--
This patch is available for review at http://codereview.appspot.com/6047048


[google/integration] Extend C++11 UDLs to be compatible with inttypes.h macros (issue6104051)

2012-04-22 Thread Ollie Wild
Add new option, -Wreserved-user-defined-literal.

This option, which is enabled by default, causes the preprocessor to warn
when a string or character literal is followed by a ud-suffix which does
not begin with an underscore.  According to [lex.ext]p10, this is
ill-formed.

Also modifies the preprocessor to treat such ill-formed suffixes as separate
preprocessing tokens.  This is consistent with the Clang front end (see
http://llvm.org/viewvc/llvm-project?view=rev&revision=152287), and enables
backwards compatibility with code that uses formatting macros from
, as in the following code block:

  int main() {
int64_t i64 = 123;
printf("My int64: %"PRId64"\n", i64);
  }

Google ref b/6377711.

2012-04-22   Ollie Wild  

* gcc/c-family/c-common.c:
* gcc/c-family/c-opts.c (c_common_handle_option):
* gcc/c-family/c.opt:
* gcc/doc/invoke.texi (struct A):
* gcc/testsuite/g++.dg/cpp0x/Wreserved-user-defined-literal.C (test):
(main):
* libcpp/include/cpplib.h (struct cpp_options):
* libcpp/init.c (cpp_create_reader):
* libcpp/lex.c (lex_raw_string):
(lex_string):

diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 1d19251..915dc25 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -8724,6 +8724,7 @@ static const struct reason_option_codes_t option_codes[] 
= {
   {CPP_W_NORMALIZE,OPT_Wnormalized_},
   {CPP_W_INVALID_PCH,  OPT_Winvalid_pch},
   {CPP_W_WARNING_DIRECTIVE,OPT_Wcpp},
+  {CPP_W_RESERVED_USER_LITERALS,   OPT_Wreserved_user_defined_literal},
   {CPP_W_NONE, 0}
 };
 
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index 5118928..dab6ce5 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -509,6 +509,10 @@ c_common_handle_option (size_t scode, const char *arg, int 
value,
  break;
}
 
+case OPT_Wreserved_user_defined_literal:
+  cpp_opts->warn_reserved_user_literals = value;
+  break;
+
 case OPT_Wreturn_type:
   warn_return_type = value;
   break;
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index 40ff96c..f610513 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -589,6 +589,10 @@ Wreorder
 C++ ObjC++ Var(warn_reorder) Warning
 Warn when the compiler reorders code
 
+Wreserved-user-defined-literal
+C++ ObjC++ Warning
+Warn when a string or character literal is followed by a ud-suffix which does 
not begin with an underscore.
+
 Wreturn-type
 C ObjC C++ ObjC++ Var(warn_return_type) Warning
 Warn whenever a function's return type defaults to \"int\" (C), or about 
inconsistent return types (C++)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 1b61e76..d425079 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -198,7 +198,7 @@ in the following sections.
 -fvisibility-ms-compat @gol
 -Wabi  -Wconversion-null  -Wctor-dtor-privacy @gol
 -Wdelete-non-virtual-dtor -Wnarrowing -Wnoexcept @gol
--Wnon-virtual-dtor  -Wreorder @gol
+-Wnon-virtual-dtor  -Wreorder -Wreserved-user-defined-literal @gol
 -Weffc++  -Wstrict-null-sentinel @gol
 -Wno-non-template-friend  -Wold-style-cast @gol
 -Woverloaded-virtual  -Wno-pmf-conversions @gol
@@ -2474,6 +2474,30 @@ struct A @{
 The compiler will rearrange the member initializers for @samp{i}
 and @samp{j} to match the declaration order of the members, emitting
 a warning to that effect.  This warning is enabled by @option{-Wall}.
+
+@item -Wreserved-user-defined-literal @r{(C++ and Objective-C++ only)}
+@opindex Wreserved-user-defined-literal
+@opindex Wno-reserved-user-defined-literal
+Warn when a string or character literal is followed by a ud-suffix which does
+not begin with an underscore.  As a conforming extension, GCC treats such
+suffixes as separate preprocessing tokens in order to maintain backwards
+compatibility with code that uses formatting macros from @code{}.
+For example:
+
+@smallexample
+#define __STDC_FORMAT_MACROS
+#include 
+#include 
+
+int main() @{
+  int64_t i64 = 123;
+  printf("My int64: %"PRId64"\n", i64);
+@}
+@end smallexample
+
+In this case, @code{PRId64} is treated as a separate preprocessing token.
+
+This warning is enabled by default.
 @end table
 
 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
diff --git a/gcc/testsuite/g++.dg/cpp0x/Wreserved-user-defined-literal.C 
b/gcc/testsuite/g++.dg/cpp0x/Wreserved-user-defined-literal.C
new file mode 100644
index 000..66de5c0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/Wreserved-user-defined-literal.C
@@ -0,0 +1,29 @@
+// { dg-do run }
+// { dg-options "-std=c++0x" }
+
+// Make sure -Wreserved-user-defined-literal is enabled by default and
+// triggers as expected.
+
+#define BAR "bar"
+#define PLUS_ONE + 1
+
+#include 
+#include 
+
+
+void
+test()
+{
+  char c = '3&

Re: [google/integration] Extend C++11 UDLs to be compatible with inttypes.h macros (issue6104051)

2012-04-22 Thread Ollie Wild
Okay, I'll send out a trunk patch for review now, too.

Ollie

On Sun, Apr 22, 2012 at 10:29 PM, Jeffrey Yasskin  wrote:
>
> Let's let the discussion _start_ before assuming it'll be protracted.
> ;) I don't think it'll kill us to run the next round of testing in
> C++98 mode. If the patch doesn't look close to acceptance in a couple
> days, I think it'll make sense to put the then-current version into
> the google branches while people are agreeing about what to do in the
> long run.
>
> On Sun, Apr 22, 2012 at 8:14 PM, Ollie Wild  wrote:
> > I'd like to get this into the google branches first because this is
> > blocking
> > testing.
> >
> > I fully expect this to result in some protracted discussion before it
> > can be
> > accepted into trunk.
> >
> > Ollie
> >
> >
> > On Sun, Apr 22, 2012 at 10:10 PM, Jeffrey Yasskin 
> > wrote:
> >>
> >> Could you try to get this into mainline instead of just the google
> >> branches? In http://gcc.gnu.org/PR52538, Jonathan sounded like he'd
> >> consider accepting it.
> >>
> >> On Sun, Apr 22, 2012 at 7:54 PM, Ollie Wild  wrote:
> >> > Add new option, -Wreserved-user-defined-literal.
> >> >
> >> > This option, which is enabled by default, causes the preprocessor to
> >> > warn
> >> > when a string or character literal is followed by a ud-suffix which
> >> > does
> >> > not begin with an underscore.  According to [lex.ext]p10, this is
> >> > ill-formed.
> >> >
> >> > Also modifies the preprocessor to treat such ill-formed suffixes as
> >> > separate
> >> > preprocessing tokens.  This is consistent with the Clang front end
> >> > (see
> >> > http://llvm.org/viewvc/llvm-project?view=rev&revision=152287), and
> >> > enables
> >> > backwards compatibility with code that uses formatting macros from
> >> > , as in the following code block:
> >> >
> >> >  int main() {
> >> >    int64_t i64 = 123;
> >> >    printf("My int64: %"PRId64"\n", i64);
> >> >  }
> >> >
> >> > Google ref b/6377711.
> >> >
> >> > 2012-04-22   Ollie Wild  
> >> >
> >> >        * gcc/c-family/c-common.c:
> >> >        * gcc/c-family/c-opts.c (c_common_handle_option):
> >> >        * gcc/c-family/c.opt:
> >> >        * gcc/doc/invoke.texi (struct A):
> >> >        * gcc/testsuite/g++.dg/cpp0x/Wreserved-user-defined-literal.C
> >> > (test):
> >> >        (main):
> >> >        * libcpp/include/cpplib.h (struct cpp_options):
> >> >        * libcpp/init.c (cpp_create_reader):
> >> >        * libcpp/lex.c (lex_raw_string):
> >> >        (lex_string):
> >> >
> >> > diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
> >> > index 1d19251..915dc25 100644
> >> > --- a/gcc/c-family/c-common.c
> >> > +++ b/gcc/c-family/c-common.c
> >> > @@ -8724,6 +8724,7 @@ static const struct reason_option_codes_t
> >> > option_codes[] = {
> >> >   {CPP_W_NORMALIZE,                    OPT_Wnormalized_},
> >> >   {CPP_W_INVALID_PCH,                  OPT_Winvalid_pch},
> >> >   {CPP_W_WARNING_DIRECTIVE,            OPT_Wcpp},
> >> > +  {CPP_W_RESERVED_USER_LITERALS,
> >> > OPT_Wreserved_user_defined_literal},
> >> >   {CPP_W_NONE,                         0}
> >> >  };
> >> >
> >> > diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
> >> > index 5118928..dab6ce5 100644
> >> > --- a/gcc/c-family/c-opts.c
> >> > +++ b/gcc/c-family/c-opts.c
> >> > @@ -509,6 +509,10 @@ c_common_handle_option (size_t scode, const char
> >> > *arg, int value,
> >> >          break;
> >> >        }
> >> >
> >> > +    case OPT_Wreserved_user_defined_literal:
> >> > +      cpp_opts->warn_reserved_user_literals = value;
> >> > +      break;
> >> > +
> >> >     case OPT_Wreturn_type:
> >> >       warn_return_type = value;
> >> >       break;
> >> > diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
> >> > index 40ff96c..f610513 100644
> >> > --- a/gcc/c-family/c.opt
> >> > +++ b/gcc/c-family/c.opt
> >> > @@ -589,6 +589,10 @@ Wreorder
> &g

PR c++/52538 Extend C++11 UDLs to be compatible with inttypes.h macros (issue6109043)

2012-04-22 Thread Ollie Wild
Add new option, -Wreserved-user-defined-literal.

This option, which is enabled by default, causes the preprocessor to warn
when a string or character literal is followed by a ud-suffix which does
not begin with an underscore.  According to [lex.ext]p10, this is
ill-formed.

Also modifies the preprocessor to treat such ill-formed suffixes as separate
preprocessing tokens.  This is consistent with the Clang front end (see
http://llvm.org/viewvc/llvm-project?view=rev&revision=152287), and enables
backwards compatibility with code that uses formatting macros from
, as in the following code block:

  int main() {
int64_t i64 = 123;
printf("My int64: %"PRId64"\n", i64);
  }

Tested via bootstrap + test.

Okay for trunk?

Thanks,
Ollie


2012-04-22   Ollie Wild  

* gcc/c-family/c-common.c:
* gcc/c-family/c-opts.c (c_common_handle_option):
* gcc/c-family/c.opt:
* gcc/doc/invoke.texi (struct A):
* gcc/testsuite/g++.dg/cpp0x/Wreserved-user-defined-literal.C (test):
(main):
* libcpp/include/cpplib.h (struct cpp_options):
* libcpp/init.c (cpp_create_reader):
* libcpp/lex.c (lex_raw_string):
(lex_string):

diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 4eacd19..f79020c 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -8820,6 +8820,7 @@ static const struct reason_option_codes_t option_codes[] 
= {
   {CPP_W_NORMALIZE,OPT_Wnormalized_},
   {CPP_W_INVALID_PCH,  OPT_Winvalid_pch},
   {CPP_W_WARNING_DIRECTIVE,OPT_Wcpp},
+  {CPP_W_RESERVED_USER_LITERALS,   OPT_Wreserved_user_defined_literal},
   {CPP_W_NONE, 0}
 };
 
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index 17e1958..a812762 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -510,6 +510,10 @@ c_common_handle_option (size_t scode, const char *arg, int 
value,
  break;
}
 
+case OPT_Wreserved_user_defined_literal:
+  cpp_opts->warn_reserved_user_literals = value;
+  break;
+
 case OPT_Wreturn_type:
   warn_return_type = value;
   break;
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index d8c944d..c8a0c84 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -593,6 +593,10 @@ Wreorder
 C++ ObjC++ Var(warn_reorder) Warning
 Warn when the compiler reorders code
 
+Wreserved-user-defined-literal
+C++ ObjC++ Warning
+Warn when a string or character literal is followed by a ud-suffix which does 
not begin with an underscore.
+
 Wreturn-type
 C ObjC C++ ObjC++ Var(warn_return_type) Warning
 Warn whenever a function's return type defaults to \"int\" (C), or about 
inconsistent return types (C++)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 8ca2f4e..ddf0fc6 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -199,7 +199,7 @@ in the following sections.
 -fvisibility-ms-compat @gol
 -Wabi  -Wconversion-null  -Wctor-dtor-privacy @gol
 -Wdelete-non-virtual-dtor -Wnarrowing -Wnoexcept @gol
--Wnon-virtual-dtor  -Wreorder @gol
+-Wnon-virtual-dtor  -Wreorder -Wreserved-user-defined-literal @gol
 -Weffc++  -Wstrict-null-sentinel @gol
 -Wno-non-template-friend  -Wold-style-cast @gol
 -Woverloaded-virtual  -Wno-pmf-conversions @gol
@@ -2478,6 +2478,30 @@ struct A @{
 The compiler rearranges the member initializers for @samp{i}
 and @samp{j} to match the declaration order of the members, emitting
 a warning to that effect.  This warning is enabled by @option{-Wall}.
+
+@item -Wreserved-user-defined-literal @r{(C++ and Objective-C++ only)}
+@opindex Wreserved-user-defined-literal
+@opindex Wno-reserved-user-defined-literal
+Warn when a string or character literal is followed by a ud-suffix which does
+not begin with an underscore.  As a conforming extension, GCC treats such
+suffixes as separate preprocessing tokens in order to maintain backwards
+compatibility with code that uses formatting macros from @code{}.
+For example:
+
+@smallexample
+#define __STDC_FORMAT_MACROS
+#include 
+#include 
+
+int main() @{
+  int64_t i64 = 123;
+  printf("My int64: %"PRId64"\n", i64);
+@}
+@end smallexample
+
+In this case, @code{PRId64} is treated as a separate preprocessing token.
+
+This warning is enabled by default.
 @end table
 
 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
diff --git a/gcc/testsuite/g++.dg/cpp0x/Wreserved-user-defined-literal.C 
b/gcc/testsuite/g++.dg/cpp0x/Wreserved-user-defined-literal.C
new file mode 100644
index 000..66de5c0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/Wreserved-user-defined-literal.C
@@ -0,0 +1,29 @@
+// { dg-do run }
+// { dg-options "-std=c++0x" }
+
+// Make sure -Wreserved-user-defined-literal is enabled by default and
+// triggers as expected.
+
+#define BAR "bar"
+#define PLUS_ONE + 1
+
+#include 
+#include 
+
+
+vo

Re: PR c++/52538 Extend C++11 UDLs to be compatible with inttypes.h macros (issue6109043)

2012-04-23 Thread Ollie Wild
On Mon, Apr 23, 2012 at 7:10 AM, Gabriel Dos Reis
 wrote:
> On Sun, Apr 22, 2012 at 10:59 PM, Ollie Wild  wrote:
>> Add new option, -Wreserved-user-defined-literal.
>
> Just shorten it to -Wliteral-suffix.

I chose -Wreserved-user-defined-literal because that's the name used
by Clang.  It seemed better to maintain consistency between front ends
than to invent a new, concise option name.

Do you still want me to shorten in?

> the non-CPP part is OK with the above change.
> You would need Tom's approval for the CPP part.

Thanks.  Added Tom to the address list.

Ollie


Re: PR c++/52538 Extend C++11 UDLs to be compatible with inttypes.h macros (issue6109043)

2012-04-23 Thread Ollie Wild
On Mon, Apr 23, 2012 at 7:53 AM, Gabriel Dos Reis
 wrote:
> On Mon, Apr 23, 2012 at 7:30 AM, Ollie Wild  wrote:
>>
>> Do you still want me to shorten in?
>
> yes.

Done.  Updated patch attached.

Ollie
commit 3f53671fb7fc7811277f047e7914f78e127031a6
Author: Ollie Wild 
Date:   Sun Apr 22 21:37:08 2012 -0500

Add new option, -Wreserved-user-defined-literal.

This option, which is enabled by default, causes the preprocessor to warn
when a string or character literal is followed by a ud-suffix which does
not begin with an underscore.  According to [lex.ext]p10, this is
ill-formed.

Also modifies the preprocessor to treat such ill-formed suffixes as separate
preprocessing tokens.  This is consistent with the Clang front end (see
http://llvm.org/viewvc/llvm-project?view=rev&revision=152287), and enables
backwards compatibility with code that uses formatting macros from
, as in the following code block:

  int main() {
int64_t i64 = 123;
printf("My int64: %"PRId64"\n", i64);
  }

    Google ref b/6377711.

2012-04-22   Ollie Wild  

* gcc/c-family/c-common.c: Add CPP_W_LITERAL_SUFFIX mapping.
* gcc/c-family/c-opts.c (c_common_handle_option): Handle
OPT_Wliteral_suffix.
* gcc/c-family/c.opt: Add Wliteral-suffix.
* gcc/doc/invoke.texi (Wliteral-suffix): Document new option.
* gcc/testsuite/g++.dg/cpp0x/Wliteral-suffix.c: New test.
* libcpp/include/cpplib.h (struct cpp_options): Add new field,
warn_literal_suffix.
(CPP_W_LITERAL_SUFFIX): New enum.
* libcpp/init.c (cpp_create_reader): Default initialization of
warn_literal_suffix.
* libcpp/lex.c (lex_raw_string): Treat user-defined literals which
don't begin with '_' as separate tokens and produce a warning.
(lex_string): Ditto.

diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 4eacd19..bf5b034 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -8820,6 +8820,7 @@ static const struct reason_option_codes_t option_codes[] 
= {
   {CPP_W_NORMALIZE,OPT_Wnormalized_},
   {CPP_W_INVALID_PCH,  OPT_Winvalid_pch},
   {CPP_W_WARNING_DIRECTIVE,OPT_Wcpp},
+  {CPP_W_LITERAL_SUFFIX,   OPT_Wliteral_suffix},
   {CPP_W_NONE, 0}
 };
 
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index 17e1958..2510747 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -476,6 +476,10 @@ c_common_handle_option (size_t scode, const char *arg, int 
value,
   cpp_opts->warn_invalid_pch = value;
   break;
 
+case OPT_Wliteral_suffix:
+  cpp_opts->warn_literal_suffix = value;
+  break;
+
 case OPT_Wlong_long:
   cpp_opts->cpp_warn_long_long = value;
   break;
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index d8c944d..db8ca81 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -449,6 +449,10 @@ Wjump-misses-init
 C ObjC Var(warn_jump_misses_init) Init(-1) Warning
 Warn when a jump misses a variable initialization
 
+Wliteral-suffix
+C++ ObjC++ Warning
+Warn when a string or character literal is followed by a ud-suffix which does 
not begin with an underscore.
+
 Wlogical-op
 C ObjC C++ ObjC++ Var(warn_logical_op) Init(0) Warning 
 Warn when a logical operator is suspiciously always evaluating to true or false
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 8ca2f4e..3c9588a 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -198,8 +198,8 @@ in the following sections.
 -fno-default-inline  -fvisibility-inlines-hidden @gol
 -fvisibility-ms-compat @gol
 -Wabi  -Wconversion-null  -Wctor-dtor-privacy @gol
--Wdelete-non-virtual-dtor -Wnarrowing -Wnoexcept @gol
--Wnon-virtual-dtor  -Wreorder @gol
+-Wdelete-non-virtual-dtor -Wliteral-suffix -Wnarrowing @gol
+-Wnoexcept -Wnon-virtual-dtor  -Wreorder @gol
 -Weffc++  -Wstrict-null-sentinel @gol
 -Wno-non-template-friend  -Wold-style-cast @gol
 -Woverloaded-virtual  -Wno-pmf-conversions @gol
@@ -2425,6 +2425,30 @@ an instance of a derived class through a pointer to a 
base class if the
 base class does not have a virtual destructor.  This warning is enabled
 by @option{-Wall}.
 
+@item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
+@opindex Wliteral-suffix
+@opindex Wno-literal-suffix
+Warn when a string or character literal is followed by a ud-suffix which does
+not begin with an underscore.  As a conforming extension, GCC treats such
+suffixes as separate preprocessing tokens in order to maintain backwards
+compatibility with code that uses formatting macros from @code{}.
+For example:
+
+@smallexample
+#define __STDC_FORMAT_MACROS
+#include 
+#include 
+
+int main() @{
+  int64_t i64 = 123;
+  printf("My int64: %"PRId64"\n", i64);
+@}
+@end smallexa

Re: [google/integration] Extend C++11 UDLs to be compatible with inttypes.h macros (issue6104051)

2012-04-23 Thread Ollie Wild
On Mon, Apr 23, 2012 at 2:39 PM, Diego Novillo  wrote:
>
> This would be for google/main, right?  It does not seem fit for
> google/integration.

It needs to be in google/integration because it blocks nearly all of
our code from compiling with -std=gnu++11, and there's no way to turn
this behavior off.  Without it, we can't do any google/integration
testing.

That said, I also sent out a patch for trunk (see my other gcc-patches
thread), and there have been some changes as a result of that.  I'm
currently waiting on a response from Tom Tromey regarding the libcpp
changes.

Ollie


Re: [google/integration] Extend C++11 UDLs to be compatible with inttypes.h macros (issue6104051)

2012-04-23 Thread Ollie Wild
On Mon, Apr 23, 2012 at 3:51 PM, Diego Novillo  wrote:
>
> Great, thanks.  Patch is OK with the ChangeLog entries filled-in.  Not sure 
> if you'd rather wait for the trunk commit to go in, though.  It may be better 
> to put this version in google/integration and deal with the merge later.

Thanks, Diego.

If the trunk change isn't approved today, I'll probably go ahead and
check in *that* patch to google/integration.  The main difference
relative to this is that the option name has been changed to
-Wliteral-suffix.  *That* part has been approved, so hopefully any
additional adjustments will be minor.

Ollie


Re: PR c++/52538 Extend C++11 UDLs to be compatible with inttypes.h macros (issue6109043)

2012-04-25 Thread Ollie Wild
On Mon, Apr 23, 2012 at 8:28 AM, Gabriel Dos Reis
 wrote:
>
> Thanks.  Tom, I am satisfied with the diagnostic part.
> I think the CPP part makes sense but it is your call.

Hi, Tom, just a quick checkin to see if you've had a chance to review this, yet.

Thanks,
Ollie


[google/main] update known test failures (issue5654064)

2012-02-11 Thread Ollie Wild
commit cbd38ef0c58ac4a365913d2bb2a2e0c062516dbb
Author: Ollie Wild 
Date:   Sat Feb 11 22:05:52 2012 -0600

Update known failures to reflect current reality.

diff --git a/contrib/testsuite-management/x86_64-unknown-linux-gnu.xfail 
b/contrib/testsuite-management/x86_64-unknown-linux-gnu.xfail
index 2e651ef..1f9c3d6 100644
--- a/contrib/testsuite-management/x86_64-unknown-linux-gnu.xfail
+++ b/contrib/testsuite-management/x86_64-unknown-linux-gnu.xfail
@@ -16,21 +16,22 @@ FAIL: gcc.dg/thread_annot_lock-42.c  (test for warnings, 
line 9)
 
 # New regression -- only fail with -std=gnu+11 option
 FAIL: g++.dg/warn/Wself-assign-2.C -std=gnu++11  (test for warnings, line 12)
-FAIL: g++.dg/template/sfinae19.C -std=c++11 (test for excess errors)
 
 # New xray failures
-FAIL: gcc.target/i386/patch-functions-1.c scan-assembler 
ret(.*).byte\t0x90(.*).byte\t0x90
-FAIL: gcc.target/i386/patch-functions-1.c scan-assembler 
.byte\t0xeb,0x09(.*).byte\t0x90
-FAIL: gcc.target/i386/patch-functions-3.c scan-assembler 
.byte\t0xeb,0x09(.*).byte\t0x90
-FAIL: gcc.target/i386/patch-functions-3.c scan-assembler 
ret(.*).byte\t0x90(.*).byte\t0x90
-FAIL: gcc.target/i386/patch-functions-5.c scan-assembler 
.byte\t0xeb,0x09(.*).byte\t0x90
-FAIL: gcc.target/i386/patch-functions-5.c scan-assembler 
ret(.*).byte\t0x90(.*).byte\t0x90
-FAIL: gcc.target/i386/patch-functions-6.c scan-assembler 
.byte\t0xeb,0x09(.*).byte\t0x90
-FAIL: gcc.target/i386/patch-functions-6.c scan-assembler 
ret(.*).byte\t0x90(.*).byte\t0x90
-
-
-# gc failure
-FAIL: boehm-gc.c/thread_leak_test.c -O2 (test for excess errors)
+UNRESOLVED: gcc.target/i386/patch-functions-1.c scan-assembler 
ret(.*).byte\t0x90(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-1.c scan-assembler 
.byte\t0xeb,0x09(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-2.c scan-assembler-not 
ret(.*).byte\t0x90(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-2.c scan-assembler-not 
.byte\t0xeb,0x09(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-3.c scan-assembler 
ret(.*).byte\t0x90(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-3.c scan-assembler 
.byte\t0xeb,0x09(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-4.c scan-assembler-not 
ret(.*).byte\t0x90(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-4.c scan-assembler-not 
.byte\t0xeb,0x09(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-5.c scan-assembler 
.byte\t0xeb,0x09(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-5.c scan-assembler 
ret(.*).byte\t0x90(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-6.c scan-assembler 
.byte\t0xeb,0x09(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-6.c scan-assembler 
ret(.*).byte\t0x90(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-7.c scan-assembler-not 
ret(.*).byte\t0x90(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-7.c scan-assembler-not 
.byte\t0xeb,0x09(.*).byte\t0x90
 
 
 # These tests fail in trunk in all configurations.
@@ -63,7 +64,6 @@ UNRESOLVED: libitm.c++/dropref.C compilation failed to 
produce executable
 UNRESOLVED: libitm.c++/eh-1.C compilation failed to produce executable
 FAIL: libitm.c++/eh-1.C (test for excess errors)
 FAIL: libitm.c++/throwdown.C (test for excess errors)
->>>>>>> .merge-right.r183740
 FAIL: libitm.c/cancel.c (test for excess errors)
 UNRESOLVED: libitm.c/cancel.c compilation failed to produce executable
 FAIL: libitm.c/clone-1.c (test for excess errors)
@@ -82,8 +82,14 @@ FAIL: libitm.c++/dropref.C (test for excess errors)
 UNRESOLVED: libitm.c++/dropref.C compilation failed to produce executable
 FAIL: libitm.c++/eh-1.C (test for excess errors)
 UNRESOLVED: libitm.c++/eh-1.C compilation failed to produce executable
-FAIL: libitm.c++/static_ctor.C (test for excess errors)
-UNRESOLVED: libitm.c++/static_ctor.C compilation failed to produce executable
+UNRESOLVED: libitm.c/notx.c compilation failed to produce executable
+FAIL: libitm.c/notx.c (test for excess errors)
+UNRESOLVED: libitm.c/reentrant.c compilation failed to produce executable
+FAIL: libitm.c/reentrant.c (test for excess errors)
+UNRESOLVED: libitm.c/simple-2.c compilation failed to produce executable
+FAIL: libitm.c/simple-2.c (test for excess errors)
+UNRESOLVED: libitm.c/txrelease.c compilation failed to produce executable
+FAIL: libitm.c/txrelease.c (test for excess errors)
 
 # These are flaky when tested in loaded machines (they exceed the timeout)
 flaky | FAIL: libmudflap.cth/pass40-frag.c (-O2) output pattern test

--
This patch is available for review at http://codereview.appspot.com/5654064


Re: [google/gcc-4_6_2-mobile] PATCH: PR other/46770: Replace .ctors/.dtors with .init_array/.fini_array on targets supporting them

2012-02-19 Thread Ollie Wild
Hey, Jing, you broke the google/gcc-4_6 branch by checking the new
header file into the wrong directory.

Fixed via r184386.

Ollie

On Fri, Feb 17, 2012 at 10:25 PM, Jing Yu  wrote:
>
> OK. Thanks for porting the patch.
> I will commit the patch into google/gcc-4_6_2-mobile for you.
>
> I would also like to commit it into google/gcc-4_6 branch if all tests
> pass. This patch is almost the same as Google Ref 47894.
>
> Thanks,
> Jing
>
> On Fri, Feb 17, 2012 at 5:20 PM, H.J. Lu  wrote:
> > Hi,
> >
> > This patch backports the fix from trunk:
> >
> > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46770
> >
> > for google/gcc-4_6_2-mobile branch.  This is needed to support C++
> > global constructors/destructiors on Android/x86.  OK for
> > google/gcc-4_6_2-mobile branch?
> >
> > Thanks.
> >
> > H.J.
> > ---
> > 2011-08-20  H.J. Lu  
> >
> >        PR other/46770
> >        * config.gcc (tm_file): Add initfini-array.h if
> >        .init_arrary/.fini_array are supported.
> >
> >        * crtstuff.c: Don't generate .ctors nor .dtors sections if
> >        USE_INITFINI_ARRAY is defined.
> >
> >        * output.h (default_elf_init_array_asm_out_constructor): New.
> >        (default_elf_fini_array_asm_out_destructor): Likewise.
> >        * varasm.c (elf_init_array_section): Likewise.
> >        (elf_fini_array_section): Likewise.
> >        (get_elf_initfini_array_priority_section): Likewise.
> >        (default_elf_init_array_asm_out_constructor): Likewise.
> >        (default_elf_fini_array_asm_out_destructor): Likewise.
> >
> >        * config/initfini-array.h: New.
> >
> > git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177933 
> > 138bc75d-0d04-0410-961f-82ee72b054a4
> >
> > Conflicts:
> >
> >        gcc/ChangeLog
> > ---
> >  gcc/ChangeLog.hjl           |   21 +++
> >  gcc/config.gcc              |    5 +++
> >  gcc/config/initfini-array.h |   37 +++
> >  gcc/crtstuff.c              |   11 +++-
> >  gcc/output.h                |    2 +
> >  gcc/varasm.c                |   58 
> > +++
> >  6 files changed, 133 insertions(+), 1 deletions(-)
> >  create mode 100644 gcc/ChangeLog.hjl
> >  create mode 100644 gcc/config/initfini-array.h
> >
> > diff --git a/gcc/ChangeLog.hjl b/gcc/ChangeLog.hjl
> > new file mode 100644
> > index 000..3527b27
> > --- /dev/null
> > +++ b/gcc/ChangeLog.hjl
> > @@ -0,0 +1,21 @@
> > +2011-12-07  H.J. Lu  
> > +
> > +       Backport from mainline
> > +       2011-08-20  H.J. Lu  
> > +
> > +       PR other/46770
> > +       * config.gcc (tm_file): Add initfini-array.h if
> > +       .init_arrary/.fini_array are supported.
> > +
> > +       * crtstuff.c: Don't generate .ctors nor .dtors sections if
> > +       USE_INITFINI_ARRAY is defined.
> > +
> > +       * output.h (default_elf_init_array_asm_out_constructor): New.
> > +       (default_elf_fini_array_asm_out_destructor): Likewise.
> > +       * varasm.c (elf_init_array_section): Likewise.
> > +       (elf_fini_array_section): Likewise.
> > +       (get_elf_initfini_array_priority_section): Likewise.
> > +       (default_elf_init_array_asm_out_constructor): Likewise.
> > +       (default_elf_fini_array_asm_out_destructor): Likewise.
> > +
> > +       * config/initfini-array.h: New.
> > diff --git a/gcc/config.gcc b/gcc/config.gcc
> > index d9ac0fa..b386424 100644
> > --- a/gcc/config.gcc
> > +++ b/gcc/config.gcc
> > @@ -3176,6 +3176,11 @@ if test x$with_schedule = x; then
> >        esac
> >  fi
> >
> > +# Support --enable-initfini-array.
> > +if test x$enable_initfini_array = xyes; then
> > +  tm_file="${tm_file} initfini-array.h"
> > +fi
> > +
> >  # Validate and mark as valid any --with options supported
> >  # by this target.  In order to use a particular --with option
> >  # you must list it in supported_defaults; validating the value
> > diff --git a/gcc/config/initfini-array.h b/gcc/config/initfini-array.h
> > new file mode 100644
> > index 000..8aaadf6
> > --- /dev/null
> > +++ b/gcc/config/initfini-array.h
> > @@ -0,0 +1,37 @@
> > +/* Definitions for ELF systems with .init_array/.fini_array section
> > +   support.
> > +   Copyright (C) 2011
> > +   Free Software Foundation, Inc.
> > +
> > +   This file is part of GCC.
> > +
> > +   GCC 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.
> > +
> > +   GCC 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 GCC; see the file COPYING3.  If not see
> > +   .  */
> > +
> > +#define USE_INITFINI_A

[google/integration] Add missing test failure. (issue5687075)

2012-02-21 Thread Ollie Wild
The latest Crosstool builds reveal one new test failure (and fix several
others).  This patch adds the missing failure to x86_64-unknown-linux-gnu.xfail.

2012-02-21  Ollie Wild  

* testsuite-management/x86_64-unknown-linux-gnu.xfail: Add
gcc.c-torture/execute/vshuf-v16qi.c failure.

diff --git a/contrib/testsuite-management/x86_64-unknown-linux-gnu.xfail 
b/contrib/testsuite-management/x86_64-unknown-linux-gnu.xfail
index 2a5e01b..1c7196d 100644
--- a/contrib/testsuite-management/x86_64-unknown-linux-gnu.xfail
+++ b/contrib/testsuite-management/x86_64-unknown-linux-gnu.xfail
@@ -20,6 +20,7 @@ XPASS: gcc.dg/unroll_4.c (test for excess errors)
 FAIL: libmudflap.c++/pass55-frag.cxx ( -O) execution test
 FAIL: gcc.c-torture/execute/vshuf-v2di.c execution,  -Os
 FAIL: gcc.c-torture/execute/vshuf-v8hi.c execution,  -Os
+FAIL: gcc.c-torture/execute/vshuf-v16qi.c execution,  -Os
 FAIL: gcc.target/i386/pr27827.c scan-assembler fmul[ \t]*%st
 
 # Failures in libitm.

--
This patch is available for review at http://codereview.appspot.com/5687075


[google/gcc-4_7] update BASE-VER to 4.7.x-google (issue5696077)

2012-02-25 Thread Ollie Wild
commit d00e10980dde6c19ec3d8035a80769d54288
Author: Ollie Wild 
Date:   Sun Feb 26 00:30:42 2012 -0600

Update BASE-VER to 4.7.x (for consistency across minor releases).  This is
what we do with the existing google/gcc-4_6 branch.

gcc/ChangeLog.google-4_7
2012-02-26  Ollie Wild  

* BASE-VER: Change to 4.7.x-google.

diff --git a/gcc/BASE-VER b/gcc/BASE-VER
index cfb495d..b256a44 100644
--- a/gcc/BASE-VER
+++ b/gcc/BASE-VER
@@ -1 +1 @@
-4.7.0-google
+4.7.x-google
diff --git a/gcc/ChangeLog.google-4_7 b/gcc/ChangeLog.google-4_7
index 9d40c1b..38802b2 100644
--- a/gcc/ChangeLog.google-4_7
+++ b/gcc/ChangeLog.google-4_7
@@ -1,3 +1,7 @@
+2012-02-26  Ollie Wild  
+
+   * BASE-VER: Change to 4.7.x-google.
+
 2012-02-23   Diego Novillo  
 
* BASE-VER: Change to 4.7.0-google.

--
This patch is available for review at http://codereview.appspot.com/5696077


[google/integration] add x86_64-grtev3-linux-gnu target name (issue5718044)

2012-03-01 Thread Ollie Wild
Add an x86_64-grtev3-linux-gnu target.

For GRTE v2, we use the value of $with_sysroot to conditionally include spec
file changes.  This is inconsistent with what we do for other architectures
like ARM, and it's less flexible since (a) the feature machinery is really
designed to key off $target and (b) we're inferring fundamental things from
incidentals.

This should make it easier to add further GRTE-specific features (patches
forthcoming) and has the added bonus of allowing us to differentiate between
native bootstrap test failures and Crosstool build failures.

I will be submitting this to the google/integration branch and integrating to
google/main and google/gcc-4_7.

Ollie


2012-03-01   Ollie Wild  

* contrib/testsuite-management/x86_64-grtev3-linux-gnu.xfail:
* gcc/config.gcc:
* gcc/config/i386/linux.h:
* gcc/config/i386/linux64.h:
* gcc/config/linux-grtev3.h:

diff --git a/contrib/testsuite-management/x86_64-grtev3-linux-gnu.xfail 
b/contrib/testsuite-management/x86_64-grtev3-linux-gnu.xfail
new file mode 100644
index 000..388da93
--- /dev/null
+++ b/contrib/testsuite-management/x86_64-grtev3-linux-gnu.xfail
@@ -0,0 +1,73 @@
+#*** libstdc++ for unix/-m32:
+#*** libstdc++ for unix/-m64:
+# Both of these fail because of the stl debug patch which changes line numbers.
+FAIL: 23_containers/vector/requirements/dr438/assign_neg.cc  (test for errors, 
line 1225)
+FAIL: 23_containers/vector/requirements/dr438/assign_neg.cc (test for excess 
errors)
+FAIL: 23_containers/vector/requirements/dr438/constructor_1_neg.cc  (test for 
errors, line 1155)
+FAIL: 23_containers/vector/requirements/dr438/constructor_1_neg.cc (test for 
excess errors)
+FAIL: 23_containers/vector/requirements/dr438/constructor_2_neg.cc  (test for 
errors, line 1155)
+FAIL: 23_containers/vector/requirements/dr438/constructor_2_neg.cc (test for 
excess errors)
+FAIL: 23_containers/vector/requirements/dr438/insert_neg.cc  (test for errors, 
line 1266)
+FAIL: 23_containers/vector/requirements/dr438/insert_neg.cc (test for excess 
errors)
+
+# These tests fail in trunk in all configurations.
+FAIL: gcc.dg/cproj-fails-with-broken-glibc.c execution test
+XPASS: gcc.dg/inline_3.c (test for excess errors)
+XPASS: gcc.dg/inline_4.c (test for excess errors)
+XPASS: gcc.dg/unroll_2.c (test for excess errors)
+XPASS: gcc.dg/unroll_3.c (test for excess errors)
+XPASS: gcc.dg/unroll_4.c (test for excess errors)
+FAIL: libmudflap.c++/pass55-frag.cxx ( -O) execution test
+FAIL: gcc.c-torture/execute/vshuf-v2di.c execution,  -Os
+FAIL: gcc.c-torture/execute/vshuf-v8hi.c execution,  -Os
+FAIL: gcc.c-torture/execute/vshuf-v16qi.c execution,  -Os
+
+# These fail because we use non-standard 32-bit configuration.
+FAIL: gcc.target/i386/pr27827.c scan-assembler fmul[ \t]*%st
+FAIL: gcc.dg/pr52086.c (internal compiler error)
+FAIL: gcc.dg/pr52086.c (test for excess errors)
+
+# Failures in libitm.
+FAIL: libitm.c/stackundo.c (test for excess errors)
+UNRESOLVED: libitm.c/stackundo.c compilation failed to produce executable
+FAIL: libitm.c++/dropref.C (test for excess errors)
+UNRESOLVED: libitm.c++/dropref.C compilation failed to produce executable
+UNRESOLVED: libitm.c++/eh-1.C compilation failed to produce executable
+FAIL: libitm.c++/eh-1.C (test for excess errors)
+FAIL: libitm.c++/throwdown.C (test for excess errors)
+FAIL: libitm.c/cancel.c (test for excess errors)
+UNRESOLVED: libitm.c/cancel.c compilation failed to produce executable
+FAIL: libitm.c/clone-1.c (test for excess errors)
+UNRESOLVED: libitm.c/clone-1.c compilation failed to produce executable
+FAIL: libitm.c/dropref-2.c (test for excess errors)
+UNRESOLVED: libitm.c/dropref-2.c compilation failed to produce executable
+UNRESOLVED: libitm.c/dropref.c compilation failed to produce executable
+FAIL: libitm.c/dropref.c (test for excess errors)
+FAIL: libitm.c/memcpy-1.c (test for excess errors)
+UNRESOLVED: libitm.c/memcpy-1.c compilation failed to produce executable
+FAIL: libitm.c/memset-1.c (test for excess errors)
+UNRESOLVED: libitm.c/memset-1.c compilation failed to produce executable
+UNRESOLVED: libitm.c/notx.c compilation failed to produce executable
+FAIL: libitm.c/notx.c (test for excess errors)
+FAIL: libitm.c/reentrant.c (test for excess errors)
+UNRESOLVED: libitm.c/reentrant.c compilation failed to produce executable
+FAIL: libitm.c/simple-1.c (test for excess errors)
+UNRESOLVED: libitm.c/simple-1.c compilation failed to produce executable
+UNRESOLVED: libitm.c/simple-2.c compilation failed to produce executable
+FAIL: libitm.c/simple-2.c (test for excess errors)
+UNRESOLVED: libitm.c/txrelease.c compilation failed to produce executable
+FAIL: libitm.c/txrelease.c (test for excess errors)
+
+# These tests only fail when boehm-gc.c is enabled.
+FAIL: boehm-gc.c/thread_leak_test.c -O2 (test for excess errors)
+
+# These are flaky when tested in loaded machines (they exceed the timeout)
+flaky | FAIL: libmudflap.cth/pass40-f

[google/main] update x86_64-grtev3-linux-gnu test manifest (issue5754049)

2012-03-05 Thread Ollie Wild
Update x86_64-grtev3-linux-gnu test manifest.

This is a copy of the corresponding x86_64-unknown-linux-gnu one.  Submitting
as obvious.

contrib/
* testsuite-management/x86_64-grtev3-linux-gnu.xfail: Updated to
reflect current x86_64-unknown-linux-gnu.xfail file.

diff --git a/contrib/ChangeLog.google-main b/contrib/ChangeLog.google-main
index f313f6f..937da9c 100644
--- a/contrib/ChangeLog.google-main
+++ b/contrib/ChangeLog.google-main
@@ -1,3 +1,8 @@
+2012-03-05  Ollie Wild  
+
+   * testsuite-management/x86_64-grtev3-linux-gnu.xfail: Updated to
+   reflect current x86_64-unknown-linux-gnu.xfail file.
+
 2012-02-13  Ollie Wild  
 
* testsuite-management/x86_64-unknown-linux-gnu.xfail: Update to
diff --git a/contrib/testsuite-management/x86_64-grtev3-linux-gnu.xfail 
b/contrib/testsuite-management/x86_64-grtev3-linux-gnu.xfail
index 388da93..f4a3d08 100644
--- a/contrib/testsuite-management/x86_64-grtev3-linux-gnu.xfail
+++ b/contrib/testsuite-management/x86_64-grtev3-linux-gnu.xfail
@@ -1,6 +1,48 @@
-#*** libstdc++ for unix/-m32:
-#*** libstdc++ for unix/-m64:
-# Both of these fail because of the stl debug patch which changes line numbers.
+# Not important to triage if clang based solution is ready
+FAIL: gcc.dg/thread_annot_lock-23.c  (test for warnings, line 10)
+FAIL: gcc.dg/thread_annot_lock-23.c  (test for warnings, line 13)
+FAIL: gcc.dg/thread_annot_lock-23.c  (test for warnings, line 15)
+FAIL: gcc.dg/thread_annot_lock-23.c  (test for warnings, line 18)
+FAIL: gcc.dg/thread_annot_lock-23.c  (test for warnings, line 19)
+FAIL: gcc.dg/thread_annot_lock-24.c  (test for warnings, line 8)
+FAIL: gcc.dg/thread_annot_lock-24.c  (test for warnings, line 9)
+FAIL: gcc.dg/thread_annot_lock-24.c  (test for warnings, line 10)
+FAIL: gcc.dg/thread_annot_lock-25.c  (test for warnings, line 8)
+FAIL: gcc.dg/thread_annot_lock-25.c  (test for warnings, line 9)
+FAIL: gcc.dg/thread_annot_lock-25.c  (test for warnings, line 10)
+FAIL: gcc.dg/thread_annot_lock-25.c  (test for warnings, line 22)
+FAIL: gcc.dg/thread_annot_lock-25.c  (test for warnings, line 30)
+FAIL: gcc.dg/thread_annot_lock-42.c  (test for warnings, line 9)
+
+# New regression -- only fail with -std=gnu+11 option
+FAIL: g++.dg/warn/Wself-assign-2.C -std=gnu++11  (test for warnings, line 12)
+
+# New xray failures
+UNRESOLVED: gcc.target/i386/patch-functions-1.c scan-assembler 
ret(.*).byte\t0x90(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-1.c scan-assembler 
.byte\t0xeb,0x09(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-2.c scan-assembler-not 
ret(.*).byte\t0x90(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-2.c scan-assembler-not 
.byte\t0xeb,0x09(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-3.c scan-assembler 
ret(.*).byte\t0x90(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-3.c scan-assembler 
.byte\t0xeb,0x09(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-4.c scan-assembler-not 
ret(.*).byte\t0x90(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-4.c scan-assembler-not 
.byte\t0xeb,0x09(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-5.c scan-assembler 
.byte\t0xeb,0x09(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-5.c scan-assembler 
ret(.*).byte\t0x90(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-6.c scan-assembler 
.byte\t0xeb,0x09(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-6.c scan-assembler 
ret(.*).byte\t0x90(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-7.c scan-assembler-not 
ret(.*).byte\t0x90(.*).byte\t0x90
+UNRESOLVED: gcc.target/i386/patch-functions-7.c scan-assembler-not 
.byte\t0xeb,0x09(.*).byte\t0x90
+
+
+# These tests fail in trunk in all configurations.
+FAIL: gcc.dg/cproj-fails-with-broken-glibc.c execution test
+XPASS: gcc.dg/unroll_2.c (test for excess errors)
+XPASS: gcc.dg/unroll_3.c (test for excess errors)
+XPASS: gcc.dg/unroll_4.c (test for excess errors)
+FAIL: gcc.c-torture/execute/vshuf-v2di.c execution,  -Os 
+FAIL: gcc.c-torture/execute/vshuf-v8hi.c execution,  -Os 
+FAIL: gcc.target/i386/pr27827.c scan-assembler fmul[ \t]*%st
+FAIL: libmudflap.c++/pass55-frag.cxx ( -O) execution test
 FAIL: 23_containers/vector/requirements/dr438/assign_neg.cc  (test for errors, 
line 1225)
 FAIL: 23_containers/vector/requirements/dr438/assign_neg.cc (test for excess 
errors)
 FAIL: 23_containers/vector/requirements/dr438/constructor_1_neg.cc  (test for 
errors, line 1155)
@@ -9,15 +51,6 @@ FAIL: 
23_containers/vector/requirements/dr438/constructor_2_neg.cc  (test for er
 FAIL: 23_containers/vector/requirements/dr438/constructor_2_neg.cc (test for 
excess errors)
 FAIL: 23_containers/vector/requirements/dr438/insert_neg.cc  (test for errors, 
line 1266)
 FAIL: 23_containers/vector/requirements/dr438/insert_neg.cc (test for excess 
errors)
-
-# These tests fail in trunk in all configurations.
-FAIL: gcc.dg/cproj-fails-with

Re: [PATCH] [Annotalysis] Fixes virtual method calls when type is unknown

2011-06-30 Thread Ollie Wild
On Thu, Jun 30, 2011 at 12:09 PM, Diego Novillo  wrote:
>
> On 11-06-30 13:01 , Delesley Hutchins wrote:
>>
>> Okay for branches/annotalysis and google/main?
>
> OK with some minor formatting nits below.

Please also cherry-pick this into the google/gcc_4-6 branch.  I've
sent you instructions out-of-band for doing so.

Ollie


Re: [google][patch] Put make_heap's declaration on a single line to work around inconsistent debug locations

2011-07-22 Thread Ollie Wild
Ok for inclusion in google/gcc-4_6.

Ollie

On Fri, Jul 22, 2011 at 5:46 PM, Jeffrey Yasskin  wrote:
>
> For the google/gcc-4_6 branch _only_. I'll fix the inconsistency in
> debug locations later for trunk and google/main.
>
> In some translation units the debug location of make_heap is the
> location of its name; in other TUs it's the location of the closing
> ')'. This causes false positives in gold's ODR checker. Until I can
> find why the locations are inconsistent, we can work around the
> problem by putting the name and closing ')' on the same line.
>
> libstdc++-v3/ChangeLog
> 2011-07-22   Jeffrey Yasskin  
>
>        * include/bits/stl_heap.h(make_heap): Remove a newline.


Re: [PATCH] [google] [annotalysis] Fix remove operation from pointer_set in case of hash collisions

2011-07-29 Thread Ollie Wild
Okay for google/gcc-4_6.

Ollie

On Tue, Jul 26, 2011 at 7:27 PM, Delesley Hutchins  wrote:
>
> Le-Chun added the additional routine to remove pointers from a set;
> that code is unique to annotalysis.  I can't easily include a test
> case, because the bug is difficult to trigger.  It occurs only when
> there is a hash collision between two pointers in the set, and the
> first pointer is removed before the second.  I do have a test case,
> but it will only work for my particular build on my machine, since the
> actual pointer addresses involved will change as soon as you touch
> something.  I could write a unit test using bogus pointer values that
> are engineered to trigger a collision, but it wouldn't be a normal
> compiler test case; where would I put it?
>
>  -DeLesley
>
> On Tue, Jul 26, 2011 at 5:59 PM, Diego Novillo  wrote:
> > On Tue, Jul 26, 2011 at 16:13, Delesley Hutchins  
> > wrote:
> >> This patch fixes a bug in pointer_set.c, where removing a pointer from
> >> a pointer set would corrupt the hash table if the pointer was involved
> >> in any hash collisions.
> >
> > Could you include a test case?  It's not clear to me what you are
> > fixing and when this happens.  Is this a bug in trunk as well?  The
> > pointer-set implementation has been around for a while, so I'm
> > surprised that you are running into this now.  Or is this something
> > that only happens with the pointer set changes we have in for
> > annotalysis?
> >
> >
> > Thanks.  Diego.
> >
>
>
>
> --
> DeLesley Hutchins | Software Engineer | deles...@google.com | 505-206-0315


[google] GRTE static link spec (issue4426065)

2011-04-27 Thread Ollie Wild
commit 44417f1103b0823f950f539a38a5539b8ff74330
Author: Ollie Wild 
Date:   Mon Apr 25 21:55:44 2011 -0400

When using GRTE (libc) and linking statically, instead of just -lc add:

  -lc -lnss_borg -lnss_cache -lnss_dns -lnss_files -lresolv

to the link by modifying LIB_SPEC to redirect to several new specs
which are GRTE-specific.

To be applied to google/integration branch.


M   gcc/config.gcc
M   gcc/config/i386/linux.h
M   gcc/config/i386/linux64.h
A   gcc/config/linux-grtev2.h

Tested:
  Tested via buildit bootstrap and tests and by executing gcc with -v to
  validate supplied link options.

ChangeLog:
2011-04-27  Ollie Wild  

* config.gcc: Add GRTE detection.
* config/i386/linux.h (LINUX_GRTE_EXTRA_SPECS): New macro.
(SUBTARGET_EXTRA_SPECS): Add LINUX_GRTE_EXTRA_SPECS.
* config/i386/linux64.h (LINUX_GRTE_EXTRA_SPECS): New macro.
(SUBTARGET_EXTRA_SPECS): New macro with LINUX_GRTE_EXTRA_SPECS.
* config/linux-grtev2.h: New file.

diff --git a/gcc/config.gcc b/gcc/config.gcc
index 58f6787..dc7524f 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1286,6 +1286,9 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | 
i[34567]86-*-knetbsd*-gnu | i
i[34567]86-*-gnu*) tm_file="$tm_file i386/linux.h gnu.h i386/gnu.h";;
esac
tmake_file="${tmake_file} i386/t-crtstuff i386/t-crtpc i386/t-crtfm 
t-dfprules"
+   if [ "$with_sysroot" = "/usr/grte/v2" ]; then
+ tm_file="${tm_file} linux-grtev2.h"
+   fi
;;
 x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h 
linux.h glibc-stdint.h \
@@ -1297,6 +1300,9 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | 
x86_64-*-knetbsd*-gnu)
x86_64-*-knetbsd*-gnu) tm_file="${tm_file} knetbsd-gnu.h" ;;
esac
tmake_file="${tmake_file} i386/t-linux64 i386/t-crtstuff i386/t-crtpc 
i386/t-crtfm t-dfprules"
+   if [ "$with_sysroot" = "/usr/grte/v2" ]; then
+ tm_file="${tm_file} linux-grtev2.h"
+   fi
;;
 i[34567]86-pc-msdosdjgpp*)
xm_file=i386/xm-djgpp.h
diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
index 1d2a548..019cea9 100644
--- a/gcc/config/i386/linux.h
+++ b/gcc/config/i386/linux.h
@@ -101,8 +101,14 @@ along with GCC; see the file COPYING3.  If not see
 #define ASM_SPEC \
   "--32 %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}"
 
+/* These may be provided by config/linux-grtev2.h.  */
+#ifndef LINUX_GRTE_EXTRA_SPECS
+#define LINUX_GRTE_EXTRA_SPECS
+#endif
+
 #undef  SUBTARGET_EXTRA_SPECS
 #define SUBTARGET_EXTRA_SPECS \
+  LINUX_GRTE_EXTRA_SPECS \
   { "link_emulation", LINK_EMULATION },\
   { "dynamic_linker", LINUX_DYNAMIC_LINKER }
 
diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
index 118e795..429c273 100644
--- a/gcc/config/i386/linux64.h
+++ b/gcc/config/i386/linux64.h
@@ -90,6 +90,15 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If 
not, see
   %{" SPEC_64 ":-dynamic-linker " LINUX_DYNAMIC_LINKER64 "}} \
 %{static:-static}}"
 
+/* These may be provided by config/linux-grtev2.h.  */
+#ifndef LINUX_GRTE_EXTRA_SPECS
+#define LINUX_GRTE_EXTRA_SPECS
+#endif
+
+#undef  SUBTARGET_EXTRA_SPECS
+#define SUBTARGET_EXTRA_SPECS \
+  LINUX_GRTE_EXTRA_SPECS
+
 /* Similar to standard Linux, but adding -ffast-math support.  */
 #undef  ENDFILE_SPEC
 #define ENDFILE_SPEC \
diff --git a/gcc/config/linux-grtev2.h b/gcc/config/linux-grtev2.h
new file mode 100644
index 000..29268fc
--- /dev/null
+++ b/gcc/config/linux-grtev2.h
@@ -0,0 +1,43 @@
+/* Definitions for Linux-based GRTE (Google RunTime Environment) version 2.
+   Copyright (C) 2009,2010,2011 Free Software Foundation, Inc.
+   Contributed by Chris Demetriou and Ollie Wild.
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+/* Overrides LIB_SPEC

[google] Remove unqualified lookups which break clang (issue4439085)

2011-05-02 Thread Ollie Wild
commit 99835abc5d2a7fd3ae0950c8a16fd6d223d408c9
Author: Ollie Wild 
Date:   Fri Apr 29 13:03:57 2011 -0400

Remove unqualified lookups into dependent template base classes from
STL headers.  These break clang.

See http://clang.llvm.org/compatibility.html#dep_lookup_bases.

To be applied to google/main.  Would also like permissiont to submit to
trunk.

M   libstdc++-v3/include/ext/sso_string_base.h
M   libstdc++-v3/include/ext/vstring.h
M   libstdc++-v3/include/ext/vstring.tcc

Tested:
  Tested via buildit bootstrap and tests.

ChangeLog:

2011-05-02  Ollie Wild  

* include/ext/sso_string_base.h (__sso_string_base<>::_M_construct):
Fix unqualified lookup.
(__sso_string_base<>::_M_construct): Likewise.
(__sso_string_base<>::_M_construct): Likewise.
(__sso_string_base<>::_M_assign): Likewise.
(__sso_string_base<>::_M_reserve): Likewise.
(__sso_string_base<>::_M_mutate): Likewise.
(__sso_string_base<>::_M_erase): Likewise.
* include/ext/vstring.h (__versa_string<>::replace): Likewise.
(__versa_string<>::compare): Likewise.
* include/ext/vstring.tcc (__versa_string<>::compare): Likewise.
(__versa_string<>::compare): Likewise.
(__versa_string<>::compare): Likewise.
(__versa_string<>::compare): Likewise.
(__versa_string<>::compare): Likewise.

diff --git a/libstdc++-v3/include/ext/sso_string_base.h 
b/libstdc++-v3/include/ext/sso_string_base.h
index 638eeba..39a62d6 100644
--- a/libstdc++-v3/include/ext/sso_string_base.h
+++ b/libstdc++-v3/include/ext/sso_string_base.h
@@ -432,7 +432,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Allocate more space.
__capacity = __len + 1;
_CharT* __another = _M_create(__capacity, __len);
-   _S_copy(__another, _M_data(), __len);
+   this->_S_copy(__another, _M_data(), __len);
_M_dispose();
_M_data(__another);
_M_capacity(__capacity);
@@ -472,7 +472,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
// Check for out_of_range and length_error exceptions.
__try
- { _S_copy_chars(_M_data(), __beg, __end); }
+ { this->_S_copy_chars(_M_data(), __beg, __end); }
__catch(...)
  {
_M_dispose();
@@ -494,7 +494,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
 
   if (__n)
-   _S_assign(_M_data(), __n, __c);
+   this->_S_assign(_M_data(), __n, __c);
 
   _M_set_length_no_wipe(__n);
 }
@@ -519,7 +519,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
 
  if (__rsize)
-   _S_copy(_M_data(), __rcs._M_data(), __rsize);
+   this->_S_copy(_M_data(), __rcs._M_data(), __rsize);
 
  _M_set_length(__rsize);
}
@@ -541,14 +541,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
  || __res > size_type(_S_local_capacity))
{
  _CharT* __tmp = _M_create(__res, __capacity);
- _S_copy(__tmp, _M_data(), _M_length() + 1);
+ this->_S_copy(__tmp, _M_data(), _M_length() + 1);
  _M_dispose();
  _M_data(__tmp);
  _M_capacity(__res);
}
  else if (!_M_is_local())
{
- _S_copy(_M_local_data, _M_data(), _M_length() + 1);
+ this->_S_copy(_M_local_data, _M_data(), _M_length() + 1);
  _M_destroy(__capacity);
  _M_data(_M_local_data);
}
@@ -567,12 +567,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   _CharT* __r = _M_create(__new_capacity, _M_capacity());
 
   if (__pos)
-   _S_copy(__r, _M_data(), __pos);
+   this->_S_copy(__r, _M_data(), __pos);
   if (__s && __len2)
-   _S_copy(__r + __pos, __s, __len2);
+   this->_S_copy(__r + __pos, __s, __len2);
   if (__how_much)
-   _S_copy(__r + __pos + __len2,
-   _M_data() + __pos + __len1, __how_much);
+   this->_S_copy(__r + __pos + __len2,
+ _M_data() + __pos + __len1, __how_much);
   
   _M_dispose();
   _M_data(__r);
@@ -587,8 +587,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   const size_type __how_much = _M_length() - __pos - __n;
 
   if (__how_much && __n)
-   _S_move(_M_data() + __pos, _M_data() + __pos + __n,
-   __how_much);
+   this->_S_move(_M_data() + __pos, _M_data() + __pos + __n, __how_much);
 
   _M_set_length(_M_length() - __n);
 }
diff --git a/libstdc++-v3/include/ext/vstring.h 
b/libstdc++-v3/include/ext/vstring.h
index 90a5683..57f36a6 100644
--- a/libstdc++-v3/include/ext/vstring.h
+++ b/libstdc++-v3/include/ext/vstring.h
@@ -1374,7 +1374,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   && __i2 <= 

Re: [google] Remove unqualified lookups which break clang (issue4439085)

2011-05-02 Thread Ollie Wild
Submitted to google/main.

Adding libstd...@gcc.gnu.org for trunk approval.

Ollie

On Mon, May 2, 2011 at 9:34 AM, Ollie Wild  wrote:
>
> commit 99835abc5d2a7fd3ae0950c8a16fd6d223d408c9
> Author: Ollie Wild 
> Date:   Fri Apr 29 13:03:57 2011 -0400
>
>    Remove unqualified lookups into dependent template base classes from
>    STL headers.  These break clang.
>
>    See http://clang.llvm.org/compatibility.html#dep_lookup_bases.
>
>    To be applied to google/main.  Would also like permissiont to submit to
>    trunk.
>
> M       libstdc++-v3/include/ext/sso_string_base.h
> M       libstdc++-v3/include/ext/vstring.h
> M       libstdc++-v3/include/ext/vstring.tcc
>
> Tested:
>  Tested via buildit bootstrap and tests.
>
> ChangeLog:
>
> 2011-05-02  Ollie Wild  
>
>        * include/ext/sso_string_base.h (__sso_string_base<>::_M_construct):
>        Fix unqualified lookup.
>        (__sso_string_base<>::_M_construct): Likewise.
>        (__sso_string_base<>::_M_construct): Likewise.
>        (__sso_string_base<>::_M_assign): Likewise.
>        (__sso_string_base<>::_M_reserve): Likewise.
>        (__sso_string_base<>::_M_mutate): Likewise.
>        (__sso_string_base<>::_M_erase): Likewise.
>        * include/ext/vstring.h (__versa_string<>::replace): Likewise.
>        (__versa_string<>::compare): Likewise.
>        * include/ext/vstring.tcc (__versa_string<>::compare): Likewise.
>        (__versa_string<>::compare): Likewise.
>        (__versa_string<>::compare): Likewise.
>        (__versa_string<>::compare): Likewise.
>        (__versa_string<>::compare): Likewise.
>
> diff --git a/libstdc++-v3/include/ext/sso_string_base.h 
> b/libstdc++-v3/include/ext/sso_string_base.h
> index 638eeba..39a62d6 100644
> --- a/libstdc++-v3/include/ext/sso_string_base.h
> +++ b/libstdc++-v3/include/ext/sso_string_base.h
> @@ -432,7 +432,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>                    // Allocate more space.
>                    __capacity = __len + 1;
>                    _CharT* __another = _M_create(__capacity, __len);
> -                   _S_copy(__another, _M_data(), __len);
> +                   this->_S_copy(__another, _M_data(), __len);
>                    _M_dispose();
>                    _M_data(__another);
>                    _M_capacity(__capacity);
> @@ -472,7 +472,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>
>        // Check for out_of_range and length_error exceptions.
>        __try
> -         { _S_copy_chars(_M_data(), __beg, __end); }
> +         { this->_S_copy_chars(_M_data(), __beg, __end); }
>        __catch(...)
>          {
>            _M_dispose();
> @@ -494,7 +494,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>        }
>
>       if (__n)
> -       _S_assign(_M_data(), __n, __c);
> +       this->_S_assign(_M_data(), __n, __c);
>
>       _M_set_length_no_wipe(__n);
>     }
> @@ -519,7 +519,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>            }
>
>          if (__rsize)
> -           _S_copy(_M_data(), __rcs._M_data(), __rsize);
> +           this->_S_copy(_M_data(), __rcs._M_data(), __rsize);
>
>          _M_set_length(__rsize);
>        }
> @@ -541,14 +541,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>              || __res > size_type(_S_local_capacity))
>            {
>              _CharT* __tmp = _M_create(__res, __capacity);
> -             _S_copy(__tmp, _M_data(), _M_length() + 1);
> +             this->_S_copy(__tmp, _M_data(), _M_length() + 1);
>              _M_dispose();
>              _M_data(__tmp);
>              _M_capacity(__res);
>            }
>          else if (!_M_is_local())
>            {
> -             _S_copy(_M_local_data, _M_data(), _M_length() + 1);
> +             this->_S_copy(_M_local_data, _M_data(), _M_length() + 1);
>              _M_destroy(__capacity);
>              _M_data(_M_local_data);
>            }
> @@ -567,12 +567,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>       _CharT* __r = _M_create(__new_capacity, _M_capacity());
>
>       if (__pos)
> -       _S_copy(__r, _M_data(), __pos);
> +       this->_S_copy(__r, _M_data(), __pos);
>       if (__s && __len2)
> -       _S_copy(__r + __pos, __s, __len2);
> +       this->_S_copy(__r + __pos, __s, __len2);
>       if (__how_much)
> -       _S_copy(__r + __pos + __len2,
> -               _M_data() + __pos + __len1, __how_much);
> +       this->_S_copy(__r + __pos + __len2,
> +                     _M_data() + __pos + __len1, __how_much);
>
>       _M_dispose();
>       _M_data(__r);
> @@ -587,8 +587,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>       const 

Re: [google] Normalize version number for google/gcc-4_6 (issue4454049)

2011-05-02 Thread Ollie Wild
On Mon, May 2, 2011 at 2:53 PM, Diego Novillo  wrote:
>
> Since google/gcc-4_6 follows the 4.6 branch, changes in minor
> revisions cause unnecessary churn in directory names.
>
> Fixed with this.  OK for google/gcc-4_6?

Yes, okay for google/gcc-4_6.

Thanks,
Ollie


Re: [google] Re: Build more of libstdc++ exception throwing code with frame pointers (issue4539068)

2011-05-19 Thread Ollie Wild
Approved for google/integration (since Diego is on vacation).

Paul, please also merge this change only to google/main and google/gcc-4_6.

Thanks,
Ollie

On Thu, May 19, 2011 at 1:24 PM, Paul Pluzhnikov  wrote:
>
> This patch is for google/integration branch.
>
> Sorry about not setting the markers correctly.
>
> Tested by doing a bootstrap build and verifying that
> __gnu_cxx::__verbose_terminate_handler is built with frame pointers.
>
> On Thu, May 19, 2011 at 10:46 AM, Paul Pluzhnikov
>  wrote:
> > 2011-05-19  Paul Pluzhnikov  
> >
> >        * libstdc++-v3/libsupc++/Makefile.am: Add -fno-omit-frame-pointer
> >        to vterminate.
> >        * libstdc++-v3/libsupc++/Makefile.in: Regenerate.
>
>
> --
> Paul Pluzhnikov


Re: [Patch] Make libstdc++'s abi_check more robust against readelf output format

2011-05-20 Thread Ollie Wild
Ok, for google/integration.  Please integrate to google/main and
google/gcc-4_6 as well.

Ollie

On Fri, May 20, 2011 at 10:05 AM, Simon Baldwin  wrote:
>
> Make libstdc++'s abi_check more robust against readelf output format.
>
> libstdc++-abi/abi_check in the libstdc++-v3 testsuite relies on a fixed
> number of space separated fields in readelf output.  However, the field
> count for readelf output can vary where the library contains OS or processor
> specific bindings, or other unknown bindings.
>
> This patch replaces the strings that readelf outputs for such bindings
> with alternative strings that use underscores in place of space.  It
> preserves the count of fields for such cases, and allows the awk statement
> that follows to find the desired field correctly with $n.
>
> OK for trunk?
>
> libstdc++-v3/ChangeLog:
> 2011-05-20  Simon Baldwin  
>
>        * scripts/extract_symvers.in: Handle processor/OS specific or
>        unknown symbol binding strings from readelf.
>
>
> Index: libstdc++-v3/scripts/extract_symvers.in
> ===
> --- libstdc++-v3/scripts/extract_symvers.in     (revision 173951)
> +++ libstdc++-v3/scripts/extract_symvers.in     (working copy)
> @@ -52,6 +52,9 @@ SunOS)
>   ${readelf} ${lib} |\
>   sed -e 's/ \[: [A-Fa-f0-9]*\] //' -e '/\.dynsym/,/^$/p;d' |\
>   egrep -v ' (LOCAL|UND) ' |\
> +  sed -e 's/ : / :_/g' |\
> +  sed -e 's/ : / :_/g' |\
> +  sed -e 's/ : / :_/g' |\
>   awk '{ if ($4 == "FUNC" || $4 == "NOTYPE")
>            printf "%s:%s\n", $4, $8;
>          else if ($4 == "OBJECT" || $4 == "TLS")