Re: [Patch, Fortran] PR57697 - Fix an issue with defined assignment

2013-09-15 Thread Tobias Burnus

Thomas Koenig wrote:

Build and regtested on x86-64-gnu-linux.
OK?

The patch is OK, also for 4.8.  Please add a test case which also
checks for the ForTrilinos failure.


Thanks for the review. I have now committed the current patch as Rev. 
202609.


I will later try to create a test case, which fails before 202609 and 
works with it. Additionally, I will work on the 4.8 backport. 
(Unfortunately, it does not simply apply on gcc-4_8-branch has the 
gfc_build_intrinsic_call has slightly changed.)


Tobias


Re: [RFC] Offloading Support in libgomp

2013-09-15 Thread Jakub Jelinek
On Sun, Sep 15, 2013 at 07:41:24PM +0400, Michael V. Zolotukhin wrote:
> > Libgomp will start N-1 new threads, and all of them would want to look up
> > mappings for i1,i2,...iK in the splay tree.  The first one wouldn't find
> > anything and would map and insert all the values to the tree.  But the 
> > following
> > ones would look-up these addresses in the exactly same order, which will 
> > lead to
> > totally unbalanced tree.
> > 
> > Am I missing anything or is it a real problem?
> On second thought, this access order doesn't necessarily mean accessing in
> ascending/descending keys order, so there is no problem here.

Yes, splay tree can get totally unbalanced and you can have a linear lookup
time, the O(log n) lookup time is amortized.  But, if you e.g. really do
lookup sorted keys (which is not given, the compiler puts vars into the
clauses based on the user order or in the order references to those vars are
discovered, plus for array sections pointer kinds which usually have
different addresses go immediately after the data ones), you really can have
one O(n) lookup if you've looked e.g. the highest address last time and now
you're looking up the lowest and the tree is totally unbalanced, but then
won't the following lookups be all O(1), because the keys you are looking up
will be always immediately in the right child?

Anyway, if the splay trees ever cause issues in real-world, it is not hard
to just replace them by something else (R-B trees, AVL trees or similar).

Jakub


Re: [Patch, Fortran] PR57697 - Fix an issue with defined assignment

2013-09-15 Thread Thomas Koenig
Hi Tobias,

> As testing showed, it didn't fix the real-world code: ForTrilinos's
> ForTrilinos_ADT_3D_Burgers_6th_Pade did still fail as it has:
> 
>  *_F.DA65 = matrix_diff_x (&parm.621);
>_F.DA66 = ax->epetra_rowmatrix.universal; // Deref of "ax"!
> 

> Build and regtested on x86-64-gnu-linux.
> OK?

The patch is OK, also for 4.8.  Please add a test case which also
checks for the ForTrilinos failure.

Thomas



Re: [ping][PATCH][1 of 2] Add value range info to SSA_NAME for zero sign extension elimination in RTL

2013-09-15 Thread Kugan

Hi,

Updated the patch to the latest changes in trunk that splits tree.h. I 
also noticed an error in printing double_int and fixed it.


Is this OK?

Thanks,
Kugan


+2013-09-12  Kugan Vivekanandarajah  
+
+   * cfgexpand.c (maybe_dump_rtl_for_gimple_stmt) : Add range to dump.
+   * gimple-pretty-print.c (print_double_int) : New function.
+   * gimple-pretty-print.c (dump_gimple_phi) : Dump range info.
+   * (pp_gimple_stmt_1) : Likewise.
+   * tree-ssa-alias.c (dump_alias_info) : Check pointer type.
+   * tree-ssa-copy.c (fini_copy_prop) : Check pointer type and copy
+   range info.
+   * tree-ssanames.c (make_ssa_name_fn) : Check pointer type in
+   initialize.
+   * (set_range_info) : New function.
+   * (get_range_info) : Likewise.
+   * (duplicate_ssa_name_range_info) : Likewise.
+   * (duplicate_ssa_name_fn) : Check pointer type and call correct
+   duplicate function.
+   * tree-vrp.c (vrp_finalize): Call set_range_info to upddate
+   value range of SSA_NAMEs.
+   * tree.h (SSA_NAME_PTR_INFO) : changed to access via union
+   * tree.h (SSA_NAME_RANGE_INFO) : New macro
+


diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 88e48c2..302188e 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -1820,7 +1820,7 @@ maybe_dump_rtl_for_gimple_stmt (gimple stmt, rtx since)
 {
   fprintf (dump_file, "\n;; ");
   print_gimple_stmt (dump_file, stmt, 0,
-			 TDF_SLIM | (dump_flags & TDF_LINENO));
+			 TDF_SLIM | TDF_RANGE | (dump_flags & TDF_LINENO));
   fprintf (dump_file, "\n");
 
   print_rtl (dump_file, since ? NEXT_INSN (since) : since);
diff --git a/gcc/dumpfile.h b/gcc/dumpfile.h
index ddc770a..8896d89 100644
--- a/gcc/dumpfile.h
+++ b/gcc/dumpfile.h
@@ -83,9 +83,10 @@ enum tree_dump_index
 #define TDF_CSELIB	(1 << 23)	/* Dump cselib details.  */
 #define TDF_SCEV	(1 << 24)	/* Dump SCEV details.  */
 #define TDF_COMMENT	(1 << 25)	/* Dump lines with prefix ";;"  */
-#define MSG_OPTIMIZED_LOCATIONS  (1 << 26)  /* -fopt-info optimized sources */
-#define MSG_MISSED_OPTIMIZATION  (1 << 27)  /* missed opportunities */
-#define MSG_NOTE (1 << 28)  /* general optimization info */
+#define TDF_RANGE   (1 << 26)   /* Dump range information.  */
+#define MSG_OPTIMIZED_LOCATIONS  (1 << 27)  /* -fopt-info optimized sources */
+#define MSG_MISSED_OPTIMIZATION  (1 << 28)  /* missed opportunities */
+#define MSG_NOTE (1 << 29)  /* general optimization info */
 #define MSG_ALL (MSG_OPTIMIZED_LOCATIONS | MSG_MISSED_OPTIMIZATION \
  | MSG_NOTE)
 
diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c
index 01a1ab5..6531010 100644
--- a/gcc/gimple-pretty-print.c
+++ b/gcc/gimple-pretty-print.c
@@ -1600,6 +1600,25 @@ dump_gimple_asm (pretty_printer *buffer, gimple gs, int spc, int flags)
 }
 }
 
+/* Dumps double_int CST to BUFFER.  */
+
+static void
+print_double_int (pretty_printer *buffer, double_int cst)
+{
+  tree node = double_int_to_tree (integer_type_node, cst);
+  if (TREE_INT_CST_HIGH (node) == 0)
+pp_printf (buffer, HOST_WIDE_INT_PRINT_UNSIGNED, TREE_INT_CST_LOW (node));
+  else if (TREE_INT_CST_HIGH (node) == -1
+   && TREE_INT_CST_LOW (node) != 0)
+pp_printf (buffer, "-" HOST_WIDE_INT_PRINT_UNSIGNED,
+   -TREE_INT_CST_LOW (node));
+  else
+sprintf (pp_buffer (buffer)->digit_buffer,
+ HOST_WIDE_INT_PRINT_DOUBLE_HEX,
+ (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (node),
+ (unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (node));
+}
+
 
 /* Dump a PHI node PHI.  BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1.
The caller is responsible for calling pp_flush on BUFFER to finalize
@@ -1628,6 +1647,27 @@ dump_gimple_phi (pretty_printer *buffer, gimple phi, int spc, int flags)
   pp_string (buffer, "# ");
 }
 
+  if ((flags & TDF_RANGE)
+  && !POINTER_TYPE_P (TREE_TYPE (lhs))
+  && SSA_NAME_RANGE_INFO (lhs))
+{
+  double_int min, max;
+  value_range_type range_type;
+  get_range_info (lhs, min, max, range_type);
+  if (range_type == VR_VARYING)
+pp_printf (buffer, "# RANGE  VR_VARYING");
+  else if (range_type == VR_RANGE || range_type == VR_ANTI_RANGE)
+  {
+pp_printf (buffer, "# RANGE ");
+pp_printf (buffer, "%s[", range_type == VR_RANGE ? "" : "~");
+print_double_int (buffer, min);
+pp_printf (buffer, ", ");
+print_double_int (buffer, max);
+pp_printf (buffer, "]");
+newline_and_indent (buffer, spc);
+  }
+}
+
   if (flags & TDF_RAW)
   dump_gimple_fmt (buffer, spc, flags, "%G <%T, ", phi,
gimple_phi_result (phi));
@@ -1930,6 +1970,32 @@ pp_gimple_stmt_1 (pretty_printer *buffer, gimple gs, int spc, int flags)
 	}
 }
 
+  if ((flags & TDF_RANGE)
+  && gimple_has_lhs (gs))
+{
+  tree lhs = gimple_get_lhs (gs);
+  

Re: Generic lambda and implicit function template commits reverted

2013-09-15 Thread Jason Merrill

Looks good.

Jason


Re: Generic lambda and implicit function template commits reverted

2013-09-15 Thread Adam Butcher

On 15.09.2013 15:45, Jason Merrill wrote:

On 09/15/2013 06:22 AM, Adam Butcher wrote:
[PATCH 1/5] Fix uninitialized variables causing breakage with 
-Werror.
[PATCH 2/5] Don't accept 'auto' as the 'type' of a template 
parameter.


OK.



I've also added a case for rejecting 'auto' in a catch parameter.



[PATCH 3/5] Fix location diagnostics by returning to the deprecated
 'input_location' global; must be a better fix for this.

   Don't know why 'location_of (type)' gave ":" rather 
than

   "file:line:col:".  My current workaround is to return to using
   'input_location'.  This gives the correct result but I doubt it 
is

   acceptable.


This seems to be because make_auto_1 sets the location of the auto
type to BUILTINS_LOCATION; I don't remember why I did that.  Changing
it to use input_location seems appropriate.



Thanks.  Doing that makes this patch unnecessary.



[PATCH 4/5] Lift CALL_FROM_THUNK_P setting to above the potential
 'build_cplus_new' call to prevent ICE due to unexpected 
tree type.




Rather than this, I've moved the call to 'build_cplus_new' back down to 
after 'start_preparsed_function' as I needed to call 
'set_flags_from_callee' prior to it but within function scope to prevent 
regression of 49260 and 47263.


Deltas below.  No regressions in g++.dg with these updates.

Cheers,
Adam



Subject: [PATCH] * pt.c (make_auto_1): Use input_location rather than 
BUILTINS_LOCATION.

---
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 58f920e..70f13bb 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -20925,7 +20925,7 @@ static tree
 make_auto_1 (tree name)
 {
   tree au = cxx_make_type (TEMPLATE_TYPE_PARM);
-  TYPE_NAME (au) = build_decl (BUILTINS_LOCATION,
+  TYPE_NAME (au) = build_decl (input_location,
   TYPE_DECL, name, au);
   TYPE_STUB_DECL (au) = TYPE_NAME (au);
   TEMPLATE_TYPE_PARM_INDEX (au) = build_template_parm_index
--


[PATCH] Move 'build_cplus_new' call to after 'start_preparsed_function' 
and call 'set_flags_from_callee' prior to prevent ICE due to unexpected 
tree type and fix exception handling.

---
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c
index 0da22fd..c9118d8 100644
--- a/gcc/cp/lambda.c
+++ b/gcc/cp/lambda.c
@@ -885,13 +885,10 @@ maybe_add_lambda_conv_op (tree type)
}
 }
   else
-{
 call = build_call_a (callop,
 direct_argvec->length (),
 direct_argvec->address ());
-  if (MAYBE_CLASS_TYPE_P (TREE_TYPE (call)))
-   call = build_cplus_new (TREE_TYPE (call), call, tf_warning_or_error);
-}
+
   CALL_FROM_THUNK_P (call) = 1;

   tree stattype = build_function_type (fn_result, FUNCTION_ARG_CHAIN 
(callop));

@@ -987,6 +984,12 @@ maybe_add_lambda_conv_op (tree type)
 }
   tree body = begin_function_body ();
   tree compound_stmt = begin_compound_stmt (0);
+  if (!generic_lambda_p)
+{
+  set_flags_from_callee (call);
+  if (MAYBE_CLASS_TYPE_P (TREE_TYPE (call)))
+   call = build_cplus_new (TREE_TYPE (call), call, tf_warning_or_error);
+}
   call = convert_from_reference (call);
   finish_return_stmt (call);

--


[PATCH] Don't allow 'auto' in type of catch parameter.
---
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 6a4e863..80ceca1 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -10328,6 +10328,11 @@ grokdeclarator (const cp_declarator 
*declarator,

  error ("template parameter declared %");
  type = error_mark_node;
}
+ else if (decl_context == CATCHPARM)
+   {
+ error ("catch parameter declared %");
+ type = error_mark_node;
+   }
  else if (current_class_type && LAMBDA_TYPE_P (current_class_type))
{
  if (cxx_dialect < cxx1y)
--


[PATCH] cpp0x/auto9.C: Downgrade expected error to expected pedwarn.
---
diff --git a/gcc/testsuite/g++.dg/cpp0x/auto9.C 
b/gcc/testsuite/g++.dg/cpp0x/auto9.C

index 190bfa6..f357f2b 100644
--- a/gcc/testsuite/g++.dg/cpp0x/auto9.C
+++ b/gcc/testsuite/g++.dg/cpp0x/auto9.C
@@ -117,8 +117,8 @@ template  struct G {};		// { dg-error 
"auto" }

 template  struct H { H (); ~H (); };
 H h;   // { dg-error "invalid" }

-void qq (auto);// { dg-error "auto" }
-void qr (auto*);   // { dg-error "auto" }
+void qq (auto);// { dg-warning "auto" }
+void qr (auto*);   // { dg-warning "auto" }

 // PR c++/46145
 typedef auto autot;// { dg-error "auto" }
--





C++ PATCH for c++/41933 (variadic lambda capture)

2013-09-15 Thread Jason Merrill
This patch fixes one of the few remaining holes in GCC's C++11 support: 
lambda capture of a variadic function parameter pack.  The 
implementation involves introducing the internal notion of a FIELD_DECL 
pack, even though such a thing can not be written explicitly in C++11.


Tested x86_64-pc-linux-gnu, applying to trunk.
commit 85cb3c43f2b8aa7897b499e125a5d77e7a8a5a3c
Author: Jason Merrill 
Date:   Sun Sep 15 08:56:42 2013 -0700

	Core DR 904
	PR c++/41933
	* parser.c (cp_parser_lambda_introducer): Handle variadic capture.
	* lambda.c (add_capture): Handle variadic capture.
	(add_default_capture, lambda_capture_field_type): Likewise.
	(build_capture_proxy, register_capture_members): Likewise.
	* pt.c (register_specialization): Allow FIELD_DECL.
	(retrieve_specialization): Likewise.
	(find_parameter_packs_r): Handle FIELD_DECL and VAR_DECL.
	(tsubst_pack_expansion): Handle FIELD_DECL packs.
	(gen_elem_of_pack_expansion_instantiation): Likewise.
	(instantiate_class_template_1): Likewise.
	(tsubst_decl, tsubst_copy): Likewise.
	(tsubst_expr) [DECL_EXPR]: Handle capture proxy packs.
	(tsubst_copy_and_build) [VAR_DECL]: Likewise.
	* semantics.c (finish_non_static_data_member): Don't try to represent
	the type of a COMPOUND_REF of a FIELD_DECL pack.

diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c
index bf75834..1af301d 100644
--- a/gcc/cp/lambda.c
+++ b/gcc/cp/lambda.c
@@ -215,7 +215,8 @@ lambda_capture_field_type (tree expr, bool explicit_init_p)
 }
   else
 type = non_reference (unlowered_expr_type (expr));
-  if (!type || WILDCARD_TYPE_P (type) || type_uses_auto (type))
+  if (!type || WILDCARD_TYPE_P (type) || type_uses_auto (type)
+  || DECL_PACK_P (expr))
 {
   type = cxx_make_type (DECLTYPE_TYPE);
   DECLTYPE_TYPE_EXPR (type) = expr;
@@ -320,15 +321,21 @@ tree
 lambda_proxy_type (tree ref)
 {
   tree type;
+  if (ref == error_mark_node)
+return error_mark_node;
   if (REFERENCE_REF_P (ref))
 ref = TREE_OPERAND (ref, 0);
+  gcc_assert (TREE_CODE (ref) == COMPONENT_REF);
   type = TREE_TYPE (ref);
-  if (type && !WILDCARD_TYPE_P (non_reference (type)))
-return type;
-  type = cxx_make_type (DECLTYPE_TYPE);
-  DECLTYPE_TYPE_EXPR (type) = ref;
-  DECLTYPE_FOR_LAMBDA_PROXY (type) = true;
-  SET_TYPE_STRUCTURAL_EQUALITY (type);
+  if (!type || WILDCARD_TYPE_P (non_reference (type)))
+{
+  type = cxx_make_type (DECLTYPE_TYPE);
+  DECLTYPE_TYPE_EXPR (type) = ref;
+  DECLTYPE_FOR_LAMBDA_PROXY (type) = true;
+  SET_TYPE_STRUCTURAL_EQUALITY (type);
+}
+  if (DECL_PACK_P (TREE_OPERAND (ref, 1)))
+type = make_pack_expansion (type);
   return type;
 }
 
@@ -341,6 +348,9 @@ build_capture_proxy (tree member)
 {
   tree var, object, fn, closure, name, lam, type;
 
+  if (PACK_EXPANSION_P (member))
+member = PACK_EXPANSION_PATTERN (member);
+
   closure = DECL_CONTEXT (member);
   fn = lambda_function (closure);
   lam = CLASSTYPE_LAMBDA_EXPR (closure);
@@ -422,12 +432,20 @@ vla_capture_type (tree array_type)
and return it.  */
 
 tree
-add_capture (tree lambda, tree id, tree initializer, bool by_reference_p,
+add_capture (tree lambda, tree id, tree orig_init, bool by_reference_p,
 	 bool explicit_init_p)
 {
   char *buf;
   tree type, member, name;
   bool vla = false;
+  bool variadic = false;
+  tree initializer = orig_init;
+
+  if (PACK_EXPANSION_P (initializer))
+{
+  initializer = PACK_EXPANSION_PATTERN (initializer);
+  variadic = true;
+}
 
   if (TREE_CODE (initializer) == TREE_LIST)
 initializer = build_x_compound_expr_from_list (initializer, ELK_INIT,
@@ -498,6 +516,9 @@ add_capture (tree lambda, tree id, tree initializer, bool by_reference_p,
   IDENTIFIER_MARKED (name) = true;
 }
 
+  if (variadic)
+type = make_pack_expansion (type);
+
   /* Make member variable.  */
   member = build_decl (input_location, FIELD_DECL, name, type);
   DECL_VLA_CAPTURE_P (member) = vla;
@@ -518,8 +539,14 @@ add_capture (tree lambda, tree id, tree initializer, bool by_reference_p,
   && current_class_type == LAMBDA_EXPR_CLOSURE (lambda))
 finish_member_declaration (member);
 
+  tree listmem = member;
+  if (variadic)
+{
+  listmem = make_pack_expansion (member);
+  initializer = orig_init;
+}
   LAMBDA_EXPR_CAPTURE_LIST (lambda)
-= tree_cons (member, initializer, LAMBDA_EXPR_CAPTURE_LIST (lambda));
+= tree_cons (listmem, initializer, LAMBDA_EXPR_CAPTURE_LIST (lambda));
 
   if (LAMBDA_EXPR_CLOSURE (lambda))
 return build_capture_proxy (member);
@@ -538,9 +565,14 @@ register_capture_members (tree captures)
 return;
 
   register_capture_members (TREE_CHAIN (captures));
+
+  tree field = TREE_PURPOSE (captures);
+  if (PACK_EXPANSION_P (field))
+field = PACK_EXPANSION_PATTERN (field);
+
   /* We set this in add_capture to avoid duplicates.  */
-  IDENTIFIER_MARKED (DECL_NAME (TREE_PURPOSE (captures))) = false;

Re: Recent IPA regression with internal functions

2013-09-15 Thread Jan Hubicka
> 2013-09-13  Jakub Jelinek  
> 
>   * ipa-prop.c (ipa_compute_jump_functions_for_edge): Return early
>   for internal calls.

That seems resonable.  I wonder if we want to consider internal calls to form
callgarph edges at all: perhaps we can just modify cgraph builder+verifier
to skip them and consider them to be normal instruction

Honza
> 
> --- gcc/ipa-prop.c.jj 2013-09-13 16:48:54.0 +0200
> +++ gcc/ipa-prop.c2013-09-13 17:28:28.086058903 +0200
> @@ -1551,6 +1551,8 @@ ipa_compute_jump_functions_for_edge (str
>  return;
>vec_safe_grow_cleared (args->jump_functions, arg_num);
>  
> +  if (gimple_call_internal_p (call))
> +return;
>if (ipa_func_spec_opts_forbid_analysis_p (cs->caller))
>  return;
>  
> 
> 
>   Jakub


Fwd: Re: [Patch, Fortran] PR57697 - Fix an issue with defined assignment [fwd: bur...@net-b.de]

2013-09-15 Thread Tobias Burnus
Yet another try to send this email - this time from a different
server. For completeness:
* The original email didn't made it, nor a repost. But the mail
  server didn't bounce back.
* For another email, only the reply made it - but not the original
  email: http://gcc.gnu.org/ml/fortran/2013-09/msg00025.html
Locally, it works as I BCC'ed myself to the emails. 
--- Begin Message ---


--- Begin Message ---
Re-sent as it didn't show up in the archive. (I wonder why this and 
another email didn't made it, but the follow-up to that email did.)


Tobias Burnus wrote:

Hi Thomas, hello all,

As it turned out, my patch wasn't working for the real-world code. I 
created a follow-up patch. See below.


* * *

Thomas Koenig wrote:

the patch is OK, also for 4.8.  Thanks a lot for fixing this.


Thanks for the review!


Just a couple of nits:
- You may want to remove the output from the test case.


Done. (Well, I missed one print line.)


- The two consecutive ifs in


   if (left != 0B)
 {
   if (_F.DA0 != 0B) goto L.2;
   _F.DA0 = (struct parent *) __builtin_malloc (4);
   L.2:;
   *_F.DA0 = *left;
 }
   L.1:;
   if (left != 0B) goto L.4;

are a little bit inelegant.  It is not really important, because
they will be merged on optimization, but if you find an easy
way to do this in the FE code, you might want to consider doing
so.  I would advise against spending a lot of work on this, though :-)


That's a bit difficult - part of the "if"s are generated at resolution 
time (resolve.c, like my patch) others are generated in trans-expr.c 
for realloc on assignment. I don't see a simple way to avoid the two 
conditions, unfortunately.


Committed to the trunk as Rev. 202601. (By the way, the automatic 
addition of the committal to the PR now works again :-)


* * *

As testing showed, it didn't fix the real-world code: ForTrilinos's 
ForTrilinos_ADT_3D_Burgers_6th_Pade did still fail as it has:


 *_F.DA65 = matrix_diff_x (&parm.621);
   _F.DA66 = ax->epetra_rowmatrix.universal; // Deref of "ax"!

The reason for the failure is that ax == NULL but only "ax" is 
allocatable while universal isn't. That's now fixed by the attached 
patch. With that patch, ForTrilions's 
ForTrilinos_ADT_3D_Burgers_6th_Pade and 
ForTrilinos_concrete_burgers_solver now pass (instead of segfault). 
Additionally, I changed ISYM_ASSOCIATED to ISYM_ALLOCATED which 
matches the internal name and is a bit more consistent. As either one 
boils down to a null-pointer check, it shouldn't lead to any code-gen 
difference on tree level.


Build and regtested on x86-64-gnu-linux.
OK?

Tobias
2013-09-15  Tobias Burnus  

	PR fortran/57697
	* resolve.c (generate_component_assignments): Correctly handle the
	case that the LHS is not allocated.

2013-09-15  Tobias Burnus  

	PR fortran/57697
	* gfortran.dg/defined_assignment_10.f90: Comment print statement.

diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index f2892e2..fbd9a6a 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -9547,17 +9547,20 @@ generate_component_assignments (gfc_code **code, gfc_namespace *ns)
 		t1, (*code)->expr1,
 NULL, NULL, (*code)->loc);
 
-		  /* For allocatable LHS, check whether it is allocated.  */
-		  if (gfc_expr_attr((*code)->expr1).allocatable)
+		  /* For allocatable LHS, check whether it is allocated.  Note
+		 that allocatable components with defined assignment are
+		 not yet support.  See PR 57696.  */
+		  if ((*code)->expr1->symtree->n.sym->attr.allocatable)
 		{
 		  gfc_code *block;
+		  gfc_expr *e =
+			gfc_lval_expr_from_sym ((*code)->expr1->symtree->n.sym);
 		  block = gfc_get_code (EXEC_IF);
 		  block->block = gfc_get_code (EXEC_IF);
 		  block->block->expr1
 			  = gfc_build_intrinsic_call (ns,
-GFC_ISYM_ASSOCIATED, "allocated",
-(*code)->loc, 2,
-gfc_copy_expr ((*code)->expr1), NULL);
+GFC_ISYM_ALLOCATED, "allocated",
+(*code)->loc, 1, e);
 		  block->block->next = temp_code;
 		  temp_code = block;
 		}
@@ -9570,9 +9573,11 @@ generate_component_assignments (gfc_code **code, gfc_namespace *ns)
 	  this_code->ext.actual->expr = gfc_copy_expr (t1);
 	  add_comp_ref (this_code->ext.actual->expr, comp1);
 
-	  /* If the LHS is not allocated, we pointer-assign the LHS address
-		 to the temporary - after the LHS has been allocated.  */
-	  if (gfc_expr_attr((*code)->expr1).allocatable)
+	  /* If the LHS variable is allocatable and wasn't allocated and
+ the temporary is allocatable, pointer assign the address of
+ the freshly allocated LHS to the temporary.  */
+	  if ((*code)->expr1->symtree->n.sym->attr.allocatable
+		  && gfc_expr_attr ((*code)->expr1).allocatable)
 		{
 		  gfc_code *block;
   gfc_expr *cond;
@@ -9583,9 +9588,8 @@ generate_component_assignments (gfc_code **code, gfc_namespace *n

Re: [Patch, Fortran] PR43366 - add invalid-diagnostic for poly assignment

2013-09-15 Thread Tobias Burnus

Now with attachment…

Tobias Burnus wrote:
Fortran 2008 permits assignment to polymorphic variables with some 
constraints. The patch, which was sitting in my tree, adds diagnostic 
to reject invalid use. For valid code, it runs into the existing 
not-yet-implemented error.


Build + regtested on x86-64-gnu-linux.
OK for the trunk?


2013-09-15  Tobias Burnus  

	PR fortran/43366
	* resolve.c (resolve_ordinary_assign): Add invalid-diagnostic for
	polymorphic assignment.

diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index f2892e2..1157f28 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -9010,14 +9010,15 @@ resolve_ordinary_assign (gfc_code *code, gfc_namespace *ns)
   bool rval = false;
   gfc_expr *lhs;
   gfc_expr *rhs;
   int llen = 0;
   int rlen = 0;
   int n;
   gfc_ref *ref;
+  symbol_attribute attr;
 
   if (gfc_extend_assign (code, ns))
 {
   gfc_expr** rhsptr;
 
   if (code->op == EXEC_ASSIGN_CALL)
 	{
@@ -9174,15 +9175,34 @@ resolve_ordinary_assign (gfc_code *code, gfc_namespace *ns)
 	gfc_current_ns->proc_name->attr.implicit_pure = 0;
 
   /* Fortran 2008, C1283.  */
   if (gfc_is_coindexed (lhs))
 	gfc_current_ns->proc_name->attr.implicit_pure = 0;
 }
 
-  /* F03:7.4.1.2.  */
+  /* F2008, 7.2.1.2.  */
+  attr = gfc_expr_attr (lhs);
+  if (lhs->ts.type == BT_CLASS && attr.allocatable)
+{
+  if (attr.codimension)
+	{
+	  gfc_error ("Assignment to polymorphic coarray at %L is not "
+		 "permitted", &lhs->where);
+	  return false;
+	}
+  if (!gfc_notify_std (GFC_STD_F2008, "Assignment to an allocatable "
+			   "polymorphic variable at %L", &lhs->where))
+	return false;
+  if (!gfc_option.flag_realloc_lhs)
+	{
+	  gfc_error ("Assignment to an allocatable polymorphic variable at %L "
+		 "requires -frealloc-lhs", &lhs->where);
+	  return false;
+	}
+}
   /* FIXME: Valid in Fortran 2008, unless the LHS is both polymorphic
  and coindexed; cf. F2008, 7.2.1.2 and PR 43366.  */
   if (lhs->ts.type == BT_CLASS)
 {
   gfc_error ("Variable must not be polymorphic in intrinsic assignment at "
 		 "%L - check that there is a matching specific subroutine "
 		 "for '=' operator", &lhs->where);


RE: [PATCH, PR 57748] Check for out of bounds access

2013-09-15 Thread Bernd Edlinger
Hello Richard,

attached is my second attempt at fixing PR 57748. This time the movmisalign
path is completely removed and a similar bug in the read handling of misaligned
structures with a non-BLKmode is fixed too. There are several new test cases 
for the
different possible failure modes.

This patch was boot-strapped and regression tested on  x86_64-unknown-linux-gnu
and i686-pc-linux-gnu.

Additionally I generated eCos and an eCos-application (on ARMv5 using packed
structures) with an arm-eabi cross compiler, and looked for differences in the
disassembled code with and without this patch, but there were none.

OK for trunk?

Regards
Bernd.2013-09-15  Bernd Edlinger  

PR middle-end/57748
* expr.c (expand_assignment): Remove misalignp code path.
Check for bitregion in offset arithmetic.
(expand_expr_real_1): Use EXAND_MEMORY on base object.

testsuite:

PR middle-end/57748
* gcc.dg/torture/pr57748-1.c: New test.
* gcc.dg/torture/pr57748-2.c: New test.
* gcc.dg/torture/pr57748-3.c: New test.
* gcc.dg/torture/pr57748-3a.c: New test.
* gcc.dg/torture/pr57748-4.c: New test.
* gcc.dg/torture/pr57748-4a.c: New test.



patch-pr57748.diff
Description: Binary data


Re: [RFC] Offloading Support in libgomp

2013-09-15 Thread Michael V. Zolotukhin
> Libgomp will start N-1 new threads, and all of them would want to look up
> mappings for i1,i2,...iK in the splay tree.  The first one wouldn't find
> anything and would map and insert all the values to the tree.  But the 
> following
> ones would look-up these addresses in the exactly same order, which will lead 
> to
> totally unbalanced tree.
> 
> Am I missing anything or is it a real problem?
On second thought, this access order doesn't necessarily mean accessing in
ascending/descending keys order, so there is no problem here.

Thanks, Michael


Re: Generic lambda and implicit function template commits reverted

2013-09-15 Thread Jason Merrill

On 09/15/2013 06:22 AM, Adam Butcher wrote:

[PATCH 1/5] Fix uninitialized variables causing breakage with -Werror.
[PATCH 2/5] Don't accept 'auto' as the 'type' of a template parameter.


OK.


[PATCH 3/5] Fix location diagnostics by returning to the deprecated
 'input_location' global; must be a better fix for this.

   Don't know why 'location_of (type)' gave ":" rather than
   "file:line:col:".  My current workaround is to return to using
   'input_location'.  This gives the correct result but I doubt it is
   acceptable.


This seems to be because make_auto_1 sets the location of the auto type 
to BUILTINS_LOCATION; I don't remember why I did that.  Changing it to 
use input_location seems appropriate.



[PATCH 4/5] Lift CALL_FROM_THUNK_P setting to above the potential
 'build_cplus_new' call to prevent ICE due to unexpected tree type.
[PATCH 5/5] Handle forward declaration of implicit function templates.
 Previously kept template parameter types in scope.


OK.

Jason




Re: Generic lambda and implicit function template commits reverted

2013-09-15 Thread Adam Butcher

Hi Jason,

Could you cast your eyes over these changes please?  I intend to roll
them up into the appropriate patches.  I will make sure I bootstrap
and "before-and-after" the g++.dg testsuite before pushing next time!


[PATCH 1/5] Fix uninitialized variables causing breakage with -Werror.

  Not actually sure that this should be necessary.  Initialization of
  'direct_argvec' and 'call' and subsequent references are behind
  '!generic_lambda_p' and 'generic_lambda_p' tests respectively.
  'generic_lambda_p' is declared 'const bool'.
  To pacify -Wmaybe-uninitialized, I have initialized them to 0.


[PATCH 2/5] Don't accept 'auto' as the 'type' of a template parameter.

  The implicit function template code was incorrectly firing in a 
template

  parameter list.


[PATCH 3/5] Fix location diagnostics by returning to the deprecated
'input_location' global; must be a better fix for this.

  Don't know why 'location_of (type)' gave ":" rather than
  "file:line:col:".  My current workaround is to return to using
  'input_location'.  This gives the correct result but I doubt it is
  acceptable.


[PATCH 4/5] Lift CALL_FROM_THUNK_P setting to above the potential
'build_cplus_new' call to prevent ICE due to unexpected tree type.

  Plain old bug which I introduced when reorganizing the conversion op 
code.



[PATCH 5/5] Handle forward declaration of implicit function templates.
Previously kept template parameter types in scope.

  Another bug.  Template parameter list erroneously left in scope.


Cheers,
Adam


[PATCH 1/5] Fix uninitialized variables causing breakage with -Werror.
---
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c
index 2d20333..0da22fd 100644
--- a/gcc/cp/lambda.c
+++ b/gcc/cp/lambda.c
@@ -792,8 +792,8 @@ maybe_add_lambda_conv_op (tree type)
  particular, parameter pack expansions are marked 
PACK_EXPANSION_LOCAL_P in

  the body CALL, but not in DECLTYPE_CALL.  */

-  vec *direct_argvec;
-  tree decltype_call = 0, call;
+  vec *direct_argvec = 0;
+  tree decltype_call = 0, call = 0;
   tree fn_result = TREE_TYPE (TREE_TYPE (callop));

   if (generic_lambda_p)
--


[PATCH 2/5] Don't accept 'auto' as the 'type' of a template parameter.
---
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index e6e24f8..6a4e863 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -10323,7 +10323,12 @@ grokdeclarator (const cp_declarator 
*declarator,


   if (type_uses_auto (type))
{
- if (current_class_type && LAMBDA_TYPE_P (current_class_type))
+ if (template_parm_flag)
+   {
+ error ("template parameter declared %");
+ type = error_mark_node;
+   }
+ else if (current_class_type && LAMBDA_TYPE_P (current_class_type))
{
  if (cxx_dialect < cxx1y)
pedwarn (location_of (type), 0,
--


[PATCH 3/5] Fix location diagnostics by returning to the deprecated 
'input_location' global; must be a better fix for this.


Using 'location_of (type)' yields ": " rather than 
"file:line:col: "

---
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 6a4e863..a948580 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -10331,18 +10331,18 @@ grokdeclarator (const cp_declarator 
*declarator,

  else if (current_class_type && LAMBDA_TYPE_P (current_class_type))
{
  if (cxx_dialect < cxx1y)
-   pedwarn (location_of (type), 0,
+   pedwarn (input_location, 0,
 "use of % in lambda parameter declaration "
 "only available with "
 "-std=c++1y or -std=gnu++1y");
}
  else if (cxx_dialect < cxx1y)
-   pedwarn (location_of (type), 0,
+   pedwarn (input_location, 0,
 "use of % in parameter declaration "
 "only available with "
 "-std=c++1y or -std=gnu++1y");
  else
-   pedwarn (location_of (type), OPT_Wpedantic,
+   pedwarn (input_location, OPT_Wpedantic,
 "ISO C++ forbids use of % in parameter "
 "declaration");
}
--


[PATCH 4/5] Lift CALL_FROM_THUNK_P setting to above the potential 
'build_cplus_new' call to prevent ICE due to unexpected tree type.

---
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c
index 0da22fd..0154840 100644
--- a/gcc/cp/lambda.c
+++ b/gcc/cp/lambda.c
@@ -883,16 +883,17 @@ maybe_add_lambda_conv_op (tree type)
 tf_warning_or_error);
  --processing_template_decl;
}
+  CALL_FROM_THUNK_P (call) = 1;
 }
   else
 {
   call = build_call_a (callop,
   direct_argvec->length (),
   direct_argvec->address ());
+  CALL_FROM_THUNK_P (call) = 1;
   if (MAYBE_CLASS_TYPE_P (TREE_TYPE (call)))
call = build_cplus_new (TREE_TYPE (call), call, tf_warning_or_error);
 }
-  CALL_FROM_THUNK_P (call

[Patch, Fortran] PR58356 - fix ICE with finalizer in type extension

2013-09-15 Thread Tobias Burnus

A rather obvious patch.

Build and regtested on x86-64-gnu-linux.
OK for the trunk?

Tobias
2013-09-15  Tobias Burnus  

	PR fortran/58356
	* class.c (generate_finalization_wrapper): Init proc_tree if
	not yet resolved.

2013-09-15  Tobias Burnus  

	PR fortran/58356
	* gfortran.dg/finalize_19.f90: New.

diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c
index 629b052..7117e83 100644
--- a/gcc/fortran/class.c
+++ b/gcc/fortran/class.c
@@ -1881,6 +1881,8 @@ generate_finalization_wrapper (gfc_symbol *derived, gfc_namespace *ns,
 
   for (fini = derived->f2k_derived->finalizers; fini; fini = fini->next)
 	{
+	  if (!fini->proc_tree)
+	fini->proc_tree = gfc_find_sym_in_symtree (fini->proc_sym);
 	  if (fini->proc_tree->n.sym->attr.elemental)
 	{
 	  fini_elem = fini;
diff --git a/gcc/testsuite/gfortran.dg/finalize_19.f90 b/gcc/testsuite/gfortran.dg/finalize_19.f90
new file mode 100644
index 000..1eeb6af
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/finalize_19.f90
@@ -0,0 +1,21 @@
+! { dg-do compile }
+!
+! PR fortran/58356
+!
+! Contributed by Andrew Benson
+!
+module ct
+  type :: cfl
+   contains
+ final :: cfld
+  end type cfl
+  type, extends(cfl) :: cfde
+   contains
+  end type cfde
+contains
+  subroutine cfld(self)
+implicit none
+type(cfl), intent(inout) :: self
+return
+  end subroutine cfld
+end module ct


Re: [PATCH 2/6] Andes nds32: machine description of nds32 porting (3).

2013-09-15 Thread Richard Sandiford
Some comments about the final part:

Chung-Ju Wu  writes:
> +(define_constraint "Ibms"
> +  "The immediate value with power of 2"
> +  (and (match_code "const_int")
> +   (match_test "(TARGET_ISA_V3 || TARGET_ISA_V3M)
> + && (floor_log2 (ival) < 8)
> + && (ival > 0)
> + && (ival == (1 << floor_log2 (ival)))")))

I think the last three lines are equivalent to:

   IN_RANGE (exact_log2 (ival), 0, 7)

> +(define_constraint "Ifex"
> +  "The immediate value with power of 2 minus 1"
> +  (and (match_code "const_int")
> +   (match_test "(TARGET_ISA_V3 || TARGET_ISA_V3M)
> + && (ival < 256)
> + && (ival > 0)
> + && (floor_log2 (ival + 1) - 1 < 8)
> + && ((ival + 1) == (1 << floor_log2 (ival + 1)))")))

And here:

   IN_RANGE (exact_log2 (ival + 1), 1, 8)

> +#ifndef nds32_OPTS_H
> +#define nds32_OPTS_H

Very minor, but the mixture of case looks odd.

> +;; -
> +;; Boolean DImode instructions.
> +;; -
> +
> +;; Boolean and,ior,xor insns.
> +
> +;; 'and' operation.
> +
> +(define_expand "anddi3"
> +  [(set (match_operand:DI 0 "register_operand" "")
> + (and:DI (match_operand:DI 1 "register_operand" "")
> + (match_operand:DI 2 "register_operand" "")))]
> +  ""
> +  ""
> +)
> +
> +; Use '#' to split instruction.
> +(define_insn "*anddi3_insn"
> +  [(set (match_operand:DI 0 "register_operand"  "=&r, &r")
> + (and:DI (match_operand:DI 1 "register_operand"  " %0,  r")
> + (match_operand:DI 2 "register_operand"  "  r,  r")))]
> +  ""
> +  "#"
> +  [(set_attr "length" "8")])
> +
> +; Use '#' to split instruction.
> +; The zero extend of operand 2 clears the high word of the output operand.
> +(define_insn_and_split "*anddi_zesidi_di"
> +  [(set (match_operand:DI 0 "register_operand"  
> "=&r, &r")
> + (and:DI (zero_extend:DI (match_operand:SI 2 "register_operand"  "  r,  
> r"))
> + (match_operand:DI 1 "register_operand"  "  0,  
> r")))]
> +  ""
> +  "#"
> +  "reload_completed"
> +  [(set (match_dup 0) (and:SI (match_dup 1) (match_dup 2)))
> +   (set (match_dup 3) (const_int 0))]
> +{
> +  operands[3] = gen_highpart (SImode, operands[0]);
> +  operands[0] = gen_lowpart (SImode, operands[0]);
> +  operands[1] = gen_lowpart (SImode, operands[1]);
> +}
> +  [(set_attr "length" "8")])
> +
> +; Use '#' to split instruction.
> +(define_insn "*anddi_sesidi_di"
> +  [(set (match_operand:DI 0 "register_operand"  
> "=&r, &r")
> + (and:DI (sign_extend:DI (match_operand:SI 2 "register_operand"  "  r,  
> r"))
> + (match_operand:DI 1 "register_operand"  "  0,  
> r")))]
> +  ""
> +  "#"
> +  [(set_attr "length" "8")])
> +
> +
> +;; 'ior' operation.
> +
> +(define_expand "iordi3"
> +  [(set (match_operand:DI 0 "register_operand" "")
> + (ior:DI (match_operand:DI 1 "register_operand" "")
> + (match_operand:DI 2 "register_operand" "")))]
> +  ""
> +  ""
> +)
> +
> +; Use '#' to split instruction.
> +(define_insn "*iordi3_insn"
> +  [(set (match_operand:DI 0 "register_operand"  "=&r, &r")
> + (ior:DI (match_operand:DI 1 "register_operand"  " %0,  r")
> + (match_operand:DI 2 "register_operand"  "  r,  r")))]
> +  ""
> +  "#"
> +  [(set_attr "length" "8")])
> +
> +; Use '#' to split instruction.
> +(define_insn "*iordi_zesidi_di"
> +  [(set (match_operand:DI 0 "register_operand"  
> "=&r, &r")
> + (ior:DI (zero_extend:DI (match_operand:SI 2 "register_operand"  "  r,  
> r"))
> + (match_operand:DI 1 "register_operand"  "  0, 
> ?r")))]
> +  ""
> +  "#"
> +  [(set_attr "length" "8")])
> +
> +; Use '#' to split instruction.
> +(define_insn "*iordi_sesidi_di"
> +  [(set (match_operand:DI 0 "register_operand"  
> "=&r, &r")
> + (ior:DI (sign_extend:DI (match_operand:SI 2 "register_operand"  "  r,  
> r"))
> + (match_operand:DI 1 "register_operand"  "  0,  
> r")))]
> +  ""
> +  "#"
> +  [(set_attr "length" "8")])
> +
> +
> +;; 'xor' operation.
> +
> +(define_expand "xordi3"
> +  [(set (match_operand:DI 0 "register_operand" "")
> + (xor:DI (match_operand:DI 1 "register_operand" "")
> + (match_operand:DI 2 "register_operand" "")))]
> +  ""
> +  ""
> +)
> +
> +; Use '#' to split instruction.
> +(define_insn "*xordi3_insn"
> +  [(set (match_operand:DI 0 "register_operand"  "=&r, &r")
> + (xor:DI (match_operand:DI 1 "register_operand"  " %0,  r")
> + (match_operand:DI 2 "register_operand"  "  r,  r")))]
> +  ""
> +  "#"
> +  [(set_attr "length" "8")])
> +
> +; Use '#' to split instruction.
> +(define_insn "*xordi_zesidi_di"
> +  [(set (match_operand:DI 0 "register_operand"

Re: [Patch, Fortran] PR57697 - Fix an issue with defined assignment

2013-09-15 Thread Thomas Koenig
Hi Tobias,

the patch is OK, also for 4.8.  Thanks a lot for fixing this.

Just a couple of nits:

- You may want to remove the output from the test case.

- The two consecutive ifs in

> 
>   if (left != 0B)
> {
>   if (_F.DA0 != 0B) goto L.2;
>   _F.DA0 = (struct parent *) __builtin_malloc (4);
>   L.2:;
>   *_F.DA0 = *left;
> }
>   L.1:;
>   if (left != 0B) goto L.4;

are a little bit inelegant.  It is not really important, because
they will be merged on optimization, but if you find an easy
way to do this in the FE code, you might want to consider doing
so.  I would advise against spending a lot of work on this, though :-)

Thomas


Re: [RFC] Offloading Support in libgomp

2013-09-15 Thread Michael V. Zolotukhin
Hi Jakub,
This patch looks ok for me in general, but I am a bit worried about using
splay-trees.  Couldn't we end up with their worst case linear performance
instead desired log?

Imagine the following scenario:
  #pragma parallel ... // to produce N-threads
  {
  #  pragma target map (i1, i2, ...iK)
{
  // some code to offload using i1, i2, ... iK
}
  }
Libgomp will start N-1 new threads, and all of them would want to look up
mappings for i1,i2,...iK in the splay tree.  The first one wouldn't find
anything and would map and insert all the values to the tree.  But the following
ones would look-up these addresses in the exactly same order, which will lead to
totally unbalanced tree.

Am I missing anything or is it a real problem?

Thanks, Michael
>   Jakub


Re: [v3] More noexcept for vectors

2013-09-15 Thread Marc Glisse
I had to separate the constructor that takes an allocator from the default 
constructor in debug/profile, since in release the noexcept only applies 
to one of them (and the testsuite asserts that release and debug agree on 
this). An alternative would be to make the release vector default 
constructor conditionally noexcept (depending on the allocator). Or to use 
explicit vector(const Allocator& = Allocator()); also in normal mode 
instead of splitting it in two.


I also removed a noexcept in profile mode where the release mode doesn't 
have noexcept.


Tested, no regression.

2013-09-15  Marc Glisse  

PR libstdc++/58338
* include/bits/stl_vector.h
(_Vector_impl::_Vector_impl(_Tp_alloc_type const&),
_Vector_impl::_Vector_impl(_Tp_alloc_type&&),
_Vector_impl::_M_swap_data,
_Vector_base::_Vector_base(const allocator_type&),
_Vector_base::_Vector_base(allocator_type&&),
_Vector_base::_Vector_base(_Vector_base&&),
vector::vector(const allocator_type&), vector::operator[],
vector::operator[] const, vector::front, vector::front const,
vector::back, vector::back const, vector::pop_back,
vector::_M_erase_at_end): Mark as noexcept.
(vector::~vector): Remove useless noexcept.
* include/debug/vector (vector::vector()): Split.
(vector::vector(const _Allocator&), vector::operator[],
vector::operator[] const, vector::front, vector::front const,
vector::back, vector::back const, vector::pop_back,
_M_requires_reallocation, _M_update_guaranteed_capacity,
_M_invalidate_after_nth): Mark as noexcept.
(vector::~vector): Remove useless noexcept.
* include/profile/vector (vector::vector()): Split.
(vector::vector(const _Allocator&), vector::operator[],
vector::operator[] const, vector::front, vector::front const,
vector::back, vector::back const): Mark as noexcept.
(vector::vector(vector&&, const _Allocator&)): Remove wrong noexcept.
(vector::~vector): Remove useless noexcept.

--
Marc GlisseIndex: include/bits/stl_vector.h
===
--- include/bits/stl_vector.h   (revision 202588)
+++ include/bits/stl_vector.h   (working copy)
@@ -80,32 +80,32 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
   : public _Tp_alloc_type
   {
pointer _M_start;
pointer _M_finish;
pointer _M_end_of_storage;
 
_Vector_impl()
: _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0)
{ }
 
-   _Vector_impl(_Tp_alloc_type const& __a)
+   _Vector_impl(_Tp_alloc_type const& __a) _GLIBCXX_NOEXCEPT
: _Tp_alloc_type(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0)
{ }
 
 #if __cplusplus >= 201103L
-   _Vector_impl(_Tp_alloc_type&& __a)
+   _Vector_impl(_Tp_alloc_type&& __a) noexcept
: _Tp_alloc_type(std::move(__a)),
  _M_start(0), _M_finish(0), _M_end_of_storage(0)
{ }
 #endif
 
-   void _M_swap_data(_Vector_impl& __x)
+   void _M_swap_data(_Vector_impl& __x) _GLIBCXX_NOEXCEPT
{
  std::swap(_M_start, __x._M_start);
  std::swap(_M_finish, __x._M_finish);
  std::swap(_M_end_of_storage, __x._M_end_of_storage);
}
   };
   
 public:
   typedef _Alloc allocator_type;
 
@@ -117,36 +117,36 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
   _M_get_Tp_allocator() const _GLIBCXX_NOEXCEPT
   { return *static_cast(&this->_M_impl); }
 
   allocator_type
   get_allocator() const _GLIBCXX_NOEXCEPT
   { return allocator_type(_M_get_Tp_allocator()); }
 
   _Vector_base()
   : _M_impl() { }
 
-  _Vector_base(const allocator_type& __a)
+  _Vector_base(const allocator_type& __a) _GLIBCXX_NOEXCEPT
   : _M_impl(__a) { }
 
   _Vector_base(size_t __n)
   : _M_impl()
   { _M_create_storage(__n); }
 
   _Vector_base(size_t __n, const allocator_type& __a)
   : _M_impl(__a)
   { _M_create_storage(__n); }
 
 #if __cplusplus >= 201103L
-  _Vector_base(_Tp_alloc_type&& __a)
+  _Vector_base(_Tp_alloc_type&& __a) noexcept
   : _M_impl(std::move(__a)) { }
 
-  _Vector_base(_Vector_base&& __x)
+  _Vector_base(_Vector_base&& __x) noexcept
   : _M_impl(std::move(__x._M_get_Tp_allocator()))
   { this->_M_impl._M_swap_data(__x._M_impl); }
 
   _Vector_base(_Vector_base&& __x, const allocator_type& __a)
   : _M_impl(__a)
   {
if (__x.get_allocator() == __a)
  this->_M_impl._M_swap_data(__x._M_impl);
else
  {
@@ -246,21 +246,21 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
*  @brief  Default constructor creates no elements.
*/
   vector()
   : _Base() { }
 
   /**
*  @brief  Creates a %vector with no elements.
*  @param  __a  An allocator object.
*/
   explicit
-  vector(const alloc