Re: C++ PATCH for DR 657 (abstract classes and sfinae)

2013-03-16 Thread Gabriel Dos Reis
On Sat, Mar 16, 2013 at 8:33 PM, Jason Merrill wrote: > While I was looking at this and 17232 I also decided to improve the abstract > class diagnostics. > > Tested x86_64-pc-linux-gnu, applying to trunk. Now that we are writing C++, we can dispense with the 'typedef enum ' stuff. -- Gaby

Small C++ PATCH to grokdeclarator

2013-03-16 Thread Jason Merrill
I wondered why grokdeclarator was handling the case of adding a ptr-operator to a METHOD_TYPE, since there's no way in C++ to name a METHOD_TYPE directly. So I asserted that it can't happen, and nothing broke. Tested x86_64-pc-linux-gnu, applying to trunk. commit 852b32bc251b703a25ecd60e3c99e

Re: C++ PATCH for c++/54277 (wrong cv-quals in lambda)

2013-03-16 Thread Jason Merrill
On 03/16/2013 03:28 PM, Jason Merrill wrote: I have no idea why the existing code tried to deduce the desired quals from current_class_ref rather than just look at the object it has. Well, maybe now I do; when I tested all my changes again before checking in, this one caused a crash because I

C++ PATCH for c++/55931 (ICE with non-dependent constexpr call in template)

2013-03-16 Thread Jason Merrill
We were calling fold_non_dependent_expr twice on the template argument, which leads to chaos. In general we try to fold close to the use, so let's stop folding in the parser. Tested x86_64-pc-linux-gnu, applying to trunk. commit 4240d0bfcd28f4a822ae0fff3f045e2eda46f55c Author: Jason Merrill D

C++ PATCH to lambda parsing

2013-03-16 Thread Jason Merrill
I noticed that we weren't using cp_parser_trailing_type_id for the case in a lambda, and I think we should. Tested x86_64-pc-linux-gnu, applying to trunk. commit 22888aa5a1ab02a32a53a360c857e9dc16ec5f49 Author: Jason Merrill Date: Sat Mar 16 13:56:43 2013 -0400 * parser.c (cp_parser_lam

C++ PATCH for c++/45917 (missing access error with template-id nested-name-specifier)

2013-03-16 Thread Jason Merrill
We were saving up the access check perfectly well, but then inadvertently throwing it away because of a call to pop_deferring_access_checks (which discards them) rather than pop_to_parent_deferring_access_checks (which adds them to the parent context). Tested x86_64-pc-linux-gnu, applying to

C++ PATCH for c++/52374 (ICE with call to base memfn in lambda)

2013-03-16 Thread Jason Merrill
A place where we want the enclosing non-lambda class for lookup. Tested x86_64-pc-linux-gnu, applying to trunk. commit 21c6e4ca4c733fc04f29a6ed30b94af32be53ba7 Author: Jason Merrill Date: Tue Mar 12 22:51:36 2013 -0400 PR c++/52374 * pt.c (tsubst_qualified_id): Use current_nonlambda

C++ PATCH for c++/54764, 55972 (lambda in class but non-function context)

2013-03-16 Thread Jason Merrill
Previously when we encountered a lambda in a class but outside a function we treated it as being in the enclosing namespace scope, which led to access errors in 55972. Fixing that meant properly giving it the class scope, which meant marking it as a lambda type sooner, which made it straightfo

C++ PATCH for c++/56039 (ICE with lambda in template argument)

2013-03-16 Thread Jason Merrill
A lambda in a template argument is ill-formed, but we shouldn't ICE. Tested x86_64-pc-linux-gnu, applying to trunk. commit d31ae27e292c03ab16feb0ac714ec62b12165444 Author: Jason Merrill Date: Mon Mar 11 16:35:02 2013 -0400 PR c++/56039 * tree.c (strip_typedefs_expr): Complain about

C++ PATCH for c++/54359 ('this' in trailing-return-type with out-of-class method defn)

2013-03-16 Thread Jason Merrill
We were handling 'this' in a trailing-return-type properly for in-class declarations of member functions, but not for an out-of-class definition, where "member_p" isn't set. Tested x86_64-pc-linux-gnu, applying to trunk. commit 24c28e89e76e2deb3d3940b0461c322774afef26 Author: Jason Merrill Dat

C++ PATCH for c++/55357 (-Wshadow and lambdas)

2013-03-16 Thread Jason Merrill
The submitter of this PR suggested that we don't want to warn about shadowing of a local variable by a lambda parameter; I think we do, since local variables can be used in lambdas, but we don't want a duplicate warning when we copy the parameter into the conversion thunk. Tested x86_64-pc-lin

Small C++ PATCH to lookup_base

2013-03-16 Thread Jason Merrill
This function ought to handle null T. Tested x86_64-pc-linux-gnu, applying to trunk. commit 5ce73161422bffd51252e639ad2da79df31438ee Author: Jason Merrill Date: Tue Mar 5 12:38:34 2013 -0500 * search.c (lookup_base): Handle NULL_TREE. diff --git a/gcc/cp/search.c b/gcc/cp/search.c index

[rtl, i386] vec_merge simplification

2013-03-16 Thread Marc Glisse
Hello, simplify-rtx had almost no simplification involving vec_merge, so I am adding a couple. I purposedly did not optimize (vec_merge (vec_merge a b m1) b m2) to (vec_merge a b m1&m2) because m1&m2 might be a more complicated pattern than m1 and m2 and I don't know if that is safe (I can ad

gcc-patches@gcc.gnu.org

2013-03-16 Thread Jason Merrill
It is also the case that using 'this' in a non-constexpr function should prevent the expression from being constant. Tested x86_64-pc-linux-gnu, applying to trunk. commit e0f26a1998f2cb404e58bcf8a9f22e29401312e0 Author: Jason Merrill Date: Thu Feb 28 11:58:44 2013 -0500 PR c++/56481

Re: C++ PATCH for DR 657 (abstract classes and sfinae)

2013-03-16 Thread Jason Merrill
While I was looking at this and 17232 I also decided to improve the abstract class diagnostics. Tested x86_64-pc-linux-gnu, applying to trunk. commit 3f00e78856a76cf45d56d548ebc77755dc1d0333 Author: Jason Merrill Date: Wed Feb 27 12:30:41 2013 -0500 * cp-tree.h (abstract_class_use): New

Re: [PATCH] Don't warn for signed 1-bit enum bitfields (PR c/56566)

2013-03-16 Thread Jason Merrill
Looks good to me. Jason

Re: [lra] Merged with trunk

2013-03-16 Thread Steven Bosscher
On Sat, Mar 16, 2013 at 12:28 AM, Vladimir Makarov wrote: > LRA branch has been merged with trunk @ 196686. > > The branch was successfully bootstrapped on x86/x86-64. > > Committed as rev. 196690. Also bootstrapped&tested successfully on: powerpc64-unknown-linux-gnu ia64-unknown-linux-gnu and cr

Re: extend fwprop optimization

2013-03-16 Thread Steven Bosscher
On Tue, Mar 12, 2013 at 8:18 AM, Wei Mi wrote: > For the motivational case, I need insn splitting to get the cost > right. insn splitting is not very intrusive. All I need is to call > split_insns func. It may not look very intrusive, but there's a lot happening in the back ground. You're creating

Fix libstdc++/56468

2013-03-16 Thread Jonathan Wakely
This fixes a problem using libstdc++ with clang, which doesn't implicitly declare std::type_info as G++ does. PR libstdc++/56468 * libsupc++/exception_ptr.h (type_info): Declare. Tested x86_64-linux, committed to trunk. This should be safe for 4.7.3 and 4.8.1 too. commit 9bb199dd

Fix libstdc++/56002

2013-03-16 Thread Jonathan Wakely
This allows the generic locks to be used when threading is not enabled or supported, so std::lock_guard etc. can be used with user-defined mutex types. PR libstdc++/56002 * include/std/mutex (lock_guard, unique_lock, lock): Define without depending on _GLIBCXX_HAS_GTHREADS.

[PATCH] Don't warn for signed 1-bit enum bitfields (PR c/56566)

2013-03-16 Thread Jakub Jelinek
Hi! Enum with -1 and 0 values fits nicely into 1-bit signed bitfield, but gcc was assuming that it doesn't and needs 2-bit signed bitfield for that instead. The only thing we really want to special case is that enum containing just value 0 needs 1-bit bitfield instead of 0-bit bitfield. Fixed th

C++ PATCH for c++/52748 (N3276 change to decltype of function call)

2013-03-16 Thread Jason Merrill
N3276 changed the semantics of decltype of a function call so that a call that returns by value doesn't result in the creation of a temporary, so that the type doesn't need to be complete, the destructor doesn't need to be accessible, etc. Tested x86_64-pc-linux-gnu, applying to trunk. commit

C++ PATCH for c++/17232 (abstract class, array and sfinae)

2013-03-16 Thread Jason Merrill
In SFINAE context, we need to instantiate a class so that we can tell whether or not is abstract. Doing this in non-SFINAE context caused problems, so I've made it conditional. Tested x86_64-pc-linux-gnu, applying to trunk. commit 02d2b645f935749d9f860cba2fab05656edbbce7 Author: Jason Merrill

C++ PATCH for DR 657 (abstract classes and sfinae)

2013-03-16 Thread Jason Merrill
Trying to use an abstract class as a return or parameter type causes a deduction failure. Tested x86_64-pc-linux-gnu, applying to trunk. commit 0e6294b17c0e992131701bdc0b71cf6903e09c64 Author: Jason Merrill Date: Wed Feb 27 10:54:55 2013 -0500 DR 657 * pt.c (tsubst_function_type):

C++ PATCH for c++/54835 (value-list-initialization and explicit constructors)

2013-03-16 Thread Jason Merrill
DR 1518 clarified that we need to check for the constructor being explicit even for value-initialization. Tested x86_64-pc-linux-gnu, applying to trunk. commit 5b4dec4223f320f314696b854481bbced847f1c9 Author: Jason Merrill Date: Sat Feb 16 10:10:05 2013 -0500 DR 1518 PR c++/54835

C++ PATCH for c++/54946 (ICE on invalid pointer template argument)

2013-03-16 Thread Jason Merrill
We were assuming well-formed code, which doesn't work out so well. Tested x86_64-pc-linux-gnu, applying to trunk. commit f4e6a7962929074fc6290dd27742d93ddd924a43 Author: Jason Merrill Date: Fri Feb 15 15:09:50 2013 -0500 PR c++/54946 * pt.c (convert_nontype_argument): Handle invalid

C++ PATCH for c++/54277 (wrong cv-quals in lambda)

2013-03-16 Thread Jason Merrill
I have no idea why the existing code tried to deduce the desired quals from current_class_ref rather than just look at the object it has. That gives the wrong answer if current_class_ref is for a lambda. Tested x86_64-pc-linux-gnu, applying to trunk. commit 6a9b91f58b18503ae7a4a55fe494c0336df1

Re: C++ PATCH for c++/56447 (wrong lambda conversion op in templates)

2013-03-16 Thread Jason Merrill
And let's use nreverse in the parser rather than open-coding it. Tested x86_64-pc-linux-gnu, applying to trunk. commit 5abab0d6bc5ccdea38af62f2563a1c0d9dda27d3 Author: Jason Merrill Date: Fri Feb 15 12:04:47 2013 -0500 * parser.c (cp_parser_lambda_expression): Use nreverse. diff --git

C++ PATCH for c++/56447 (wrong lambda conversion op in templates)

2013-03-16 Thread Jason Merrill
The code for adding a conversion op to a lambda closure was checking whether there were any captures before we had gotten around to setting up the capture list. Fixed by instantiating it a bit sooner. Tested x86_64-pc-linux-gnu, applying to trunk. commit 75607bcd47d0be87cfaca0ebf625986ecde78a7

C++ PATCH for c++/55017 (rvalue ref and defaulted copy constructor)

2013-03-16 Thread Jason Merrill
We were failing to enforce the rule that a field with rvalue reference type causes a defaulted copy constructor to be deleted. Tested x86_64-pc-linux-gnu, applying to trunk. commit 5e57beb36ec51c1e0a6f175142f89c8d4b782e30 Author: Jason Merrill Date: Thu Feb 14 12:14:36 2013 -0500 PR c++

C++ PATCH for c++/55240 (local variable and nsdmi)

2013-03-16 Thread Jason Merrill
In an NSDMI of a local class, current_function_decl is the enclosing function, but we still can't refer to local variables of that function. Tested x86_64-pc-linux-gnu, applying to trunk. commit 00297d25d51a02b5aba605ece2db8dd1a44c2145 Author: Jason Merrill Date: Wed Feb 13 17:29:38 2013 -050

C++ PATCH for c++/55241 (wrong dumping of sizeof...)

2013-03-16 Thread Jason Merrill
The diagnostic code didn't understand sizeof... Tested x86_64-pc-linux-gnu, applying to trunk. commit 824613a2b13236e896abb202c225f2e3628616c8 Author: Jason Merrill Date: Wed Feb 13 17:19:20 2013 -0500 PR c++/55241 * error.c (dump_expr) [SIZEOF_EXPR]: Print sizeof... properly. diff

Re: C++ PATCH for c++/56238 (ice-checking with static_cast)

2013-03-16 Thread Jason Merrill
On 02/09/2013 03:36 PM, Jason Merrill wrote: The code in build_non_dependent_expr has caught a number of issues in the compiler; this is another case that fold_non_dependent_expr wasn't properly recognizing as dependent. I think we want to use instantiation_dependent there going forward, but for

DWARF2 patch for debug/49090

2013-03-16 Thread Jason Merrill
The GDB team asked for some indication that a DW_TAG_template_*_parameter node represents a default template argument rather than one supplied by the user; I think that using DW_AT_default_value as a flag makes sense here. Tested x86_64-pc-linux-gnu, applying to trunk. commit 2500158c694114e1f

Re: C++ PATCH for c++/56095 (ICE on invalid function pointer template argument)

2013-03-16 Thread Jason Merrill
While I was looking at this issue in January, I noticed that resolve_address_of_overloaded_function wasn't accepting a reference to function type, which it seems like it ought to handle. Tested x86_64-pc-linux-gnu, applying to trunk. commit 9839aa98a3c80c73e904b657499e6fce7d43a25d Author: Jason

Re: [rtl] combine a vec_concat of 2 vec_selects from the same vector

2013-03-16 Thread Eric Botcazou
> I successfully regtested the attached trivial patch on x86_64-linux-gnu: > > 2013-03-16 Marc Glisse > > * simplify-rtx.c (simplify_binary_operation_1) : > Restrict the transformation to equal modes. OK for 4.9 and 4.8.1 if you add a comment line about the restriction. -- Eric

Re: [rtl] combine a vec_concat of 2 vec_selects from the same vector

2013-03-16 Thread Marc Glisse
On Sat, 16 Mar 2013, Eric Botcazou wrote: My current understanding of simplify-rtx is that we should only do "safe" optimizations in it (make sure we only create expressions that every target will recognize), and if I want more advanced optimizations, I should do them elsewhere (not sure where).

Re: GCC 4.9.0 Status Report (2012-03-16), Stage 1 starts now

2013-03-16 Thread Jakub Jelinek
On Sat, Mar 16, 2013 at 03:08:51PM +0100, Steven Bosscher wrote: > > That is the 4.9 list, not 4.8 list. > > Then the link on the homepage needs updating. > > It now has: > http://gcc.gnu.org/bugzilla/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=4.8&target_milestone

[patch, fortran, 4.9] Dependency and string length calculation improvements

2013-03-16 Thread Thomas Koenig
Hello world, below is a patch which improves dependency checking for array assignments and calculation of string lengths. The new function gfc_dep_difference is used for both. This allows us to detect, for example, that the difference between the lower indices of a(n:m:2) = a(n+1:m+1:2) i

Re: GCC 4.9.0 Status Report (2012-03-16), Stage 1 starts now

2013-03-16 Thread Steven Bosscher
On Sat, Mar 16, 2013 at 3:04 PM, Jakub Jelinek wrote: > On Sat, Mar 16, 2013 at 02:51:03PM +0100, Steven Bosscher wrote: >> On Sat, Mar 16, 2013 at 9:55 AM, Jakub Jelinek wrote: >> > Quality Data >> > >> > >> > Priority # Change from Last Report >> > --- --

Re: GCC 4.9.0 Status Report (2012-03-16), Stage 1 starts now

2013-03-16 Thread Jakub Jelinek
On Sat, Mar 16, 2013 at 02:51:03PM +0100, Steven Bosscher wrote: > On Sat, Mar 16, 2013 at 9:55 AM, Jakub Jelinek wrote: > > Quality Data > > > > > > Priority # Change from Last Report > > --- --- > > P11 + 1 > > P2

Re: GCC 4.9.0 Status Report (2012-03-16), Stage 1 starts now

2013-03-16 Thread Markus Trippelsdorf
On 2013.03.16 at 14:51 +0100, Steven Bosscher wrote: > On Sat, Mar 16, 2013 at 9:55 AM, Jakub Jelinek wrote: > > Quality Data > > > > > > Priority # Change from Last Report > > --- --- > > P11 + 1 > > P2

Re: GCC 4.9.0 Status Report (2012-03-16), Stage 1 starts now

2013-03-16 Thread Steven Bosscher
On Sat, Mar 16, 2013 at 9:55 AM, Jakub Jelinek wrote: > Quality Data > > > Priority # Change from Last Report > --- --- > P11 + 1 > P2 68 + 3 > P3 11 - 7 > --- --

[PATCH 1/4] Mark all member functions with memory models always inline

2013-03-16 Thread Andi Kleen
From: Andi Kleen When a non constant memory model is passed to __atomic_* gcc falls back to seq_cst. This drops any HLE acquire or release bits. This can happen when is used with -O0 as the member functions are not always inlined then and the memory argument passed in ends up being non-constant

[PATCH 2/4] Avoid non constant memory model uses in libatomic

2013-03-16 Thread Andi Kleen
From: Andi Kleen x86 ends up using non constant memory models for some of the libatomic functions. These all end up as __ATOMIC_SEQ_CST. Just use this directly. This avoids a new warning for non constant memory models, which broke the bootstrap with -Werror Passed bootstrap and test on x86_64-li

[PATCH 4/4] Add warning for non-constant memory models

2013-03-16 Thread Andi Kleen
From: Andi Kleen Non constant memory models drop HLE attribute bits. Since we had problems with this even in gcc code itself, like libstdc++ passing variables when not optimizing, add a warning for this case. Passed bootstrap and test on x86_64-linux. gcc/: 2013-03-15 Andi Kleen PR

Re: [rtl] combine a vec_concat of 2 vec_selects from the same vector

2013-03-16 Thread Eric Botcazou
> My current understanding of simplify-rtx is that we should only do "safe" > optimizations in it (make sure we only create expressions that every > target will recognize), and if I want more advanced optimizations, I > should do them elsewhere (not sure where). So I should probably at least > rest

GCC 4.9.0 Status Report (2012-03-16), Stage 1 starts now

2013-03-16 Thread Jakub Jelinek
Status == The trunk has branched for the GCC 4.8 release and is now open again for general development, stage 1. Please consider not disrupting it too much during the RC phase of GCC 4.8 so it is possible to test important fixes for 4.8.0 on it. And more importantly, please be aware of the ou