diff mbox

[C++] Nit fix in build_new_1

Message ID 20120927104435.GW1787@tucnak.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek Sept. 27, 2012, 10:44 a.m. UTC
Hi!

All INTEGER_CSTs are TREE_CONSTANT, I don't see the point
in testing that.  Ok for trunk?

2012-09-27  Jakub Jelinek  <jakub@redhat.com>

	* init.c (build_new_1): Don't test TREE_CONSTANT
	of INTEGER_CST.


	Jakub

Comments

Richard Biener Sept. 27, 2012, 10:59 a.m. UTC | #1
On Thu, Sep 27, 2012 at 12:44 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> All INTEGER_CSTs are TREE_CONSTANT, I don't see the point
> in testing that.  Ok for trunk?

Ok.

Thanks,
Richard.

> 2012-09-27  Jakub Jelinek  <jakub@redhat.com>
>
>         * init.c (build_new_1): Don't test TREE_CONSTANT
>         of INTEGER_CST.
>
> --- gcc/cp/init.c.jj    2012-09-25 11:59:43.000000000 +0200
> +++ gcc/cp/init.c       2012-09-27 12:42:32.382457943 +0200
> @@ -2235,8 +2235,7 @@ build_new_1 (VEC(tree,gc) **placement, t
>      {
>        tree inner_nelts = array_type_nelts_top (elt_type);
>        tree inner_nelts_cst = maybe_constant_value (inner_nelts);
> -      if (TREE_CONSTANT (inner_nelts_cst)
> -         && TREE_CODE (inner_nelts_cst) == INTEGER_CST)
> +      if (TREE_CODE (inner_nelts_cst) == INTEGER_CST)
>         {
>           bool overflow;
>           double_int result = TREE_INT_CST (inner_nelts_cst)
>
>         Jakub
diff mbox

Patch

--- gcc/cp/init.c.jj	2012-09-25 11:59:43.000000000 +0200
+++ gcc/cp/init.c	2012-09-27 12:42:32.382457943 +0200
@@ -2235,8 +2235,7 @@  build_new_1 (VEC(tree,gc) **placement, t
     {
       tree inner_nelts = array_type_nelts_top (elt_type);
       tree inner_nelts_cst = maybe_constant_value (inner_nelts);
-      if (TREE_CONSTANT (inner_nelts_cst)
-	  && TREE_CODE (inner_nelts_cst) == INTEGER_CST)
+      if (TREE_CODE (inner_nelts_cst) == INTEGER_CST)
 	{
 	  bool overflow;
 	  double_int result = TREE_INT_CST (inner_nelts_cst)