public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Optimize X << Y with low bits of Y known to be 0 (PR tree-optimization/71563)
@ 2016-12-20 19:57 Jakub Jelinek
  2016-12-20 20:45 ` Marc Glisse
  0 siblings, 1 reply; 8+ messages in thread
From: Jakub Jelinek @ 2016-12-20 19:57 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

Hi!

If the shift count has enough known zero low bits (non-zero bits only
above the ceil_log2 (precision)), then the only valid shift count that
is not out of bounds is 0, so we can as well fold it into the first
argument of the shift.  This resolves a regression introduced by partly
optimizing it at the gimple level, which results in it not being optimized
at the RTL level that managed to do that completely.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2016-12-20  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/71563
	* match.pd: Simplify X << Y into X if Y is known to be 0 or
	out of range value - has low bits known to be zero.

	* gcc.dg/tree-ssa/pr71563.c: New test.

--- gcc/match.pd.jj	2016-12-10 13:05:39.000000000 +0100
+++ gcc/match.pd	2016-12-20 15:44:30.892704283 +0100
@@ -1497,6 +1497,21 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
     (if (tem)
      (shiftrotate @0 { tem; }))))))
 
+/* Simplify X << Y where Y's low width bits are 0 to X, as only valid
+   Y is 0.  Similarly for X >> Y.  */
+#if GIMPLE
+(for shift (lshift rshift)
+ (simplify
+  (shift @0 @1)
+   (if (TREE_CODE (@1) == SSA_NAME && INTEGRAL_TYPE_P (TREE_TYPE (@1)))
+    (with {
+      int width = ceil_log2 (element_precision (TREE_TYPE (@0)));
+      int prec = TYPE_PRECISION (TREE_TYPE (@1));
+     }
+     (if ((get_nonzero_bits (@1) & wi::mask (width, false, prec)) == 0)
+      @0)))))
+#endif
+
 /* Rewrite an LROTATE_EXPR by a constant into an
    RROTATE_EXPR by a new constant.  */
 (simplify
--- gcc/testsuite/gcc.dg/tree-ssa/pr71563.c.jj	2016-12-20 15:57:16.624722177 +0100
+++ gcc/testsuite/gcc.dg/tree-ssa/pr71563.c	2016-12-20 15:57:01.000000000 +0100
@@ -0,0 +1,23 @@
+/* PR tree-optimization/71563 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+void link_error (void);
+
+void
+foo (int k)
+{
+  int t = 1 << ((1 / k) << 8);
+  if (t != 1)
+    link_error ();
+}
+
+void
+bar (int k, int l)
+{
+  int t = l << (k << 8);
+  if (t != l)
+    link_error ();
+}
+
+/* { dg-final { scan-tree-dump-not "link_error" "optimized" } } */

	Jakub

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Optimize X << Y with low bits of Y known to be 0 (PR tree-optimization/71563)
  2016-12-20 19:57 [PATCH] Optimize X << Y with low bits of Y known to be 0 (PR tree-optimization/71563) Jakub Jelinek
@ 2016-12-20 20:45 ` Marc Glisse
  2016-12-20 20:52   ` Jakub Jelinek
  0 siblings, 1 reply; 8+ messages in thread
From: Marc Glisse @ 2016-12-20 20:45 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Richard Biener, gcc-patches

On Tue, 20 Dec 2016, Jakub Jelinek wrote:

> If the shift count has enough known zero low bits (non-zero bits only
> above the ceil_log2 (precision)), then the only valid shift count that
> is not out of bounds is 0, so we can as well fold it into the first
> argument of the shift.  This resolves a regression introduced by partly
> optimizing it at the gimple level, which results in it not being optimized
> at the RTL level that managed to do that completely.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> 2016-12-20  Jakub Jelinek  <jakub@redhat.com>
>
> 	PR tree-optimization/71563
> 	* match.pd: Simplify X << Y into X if Y is known to be 0 or
> 	out of range value - has low bits known to be zero.

Hello,

would it make sense to extend it to rotates later?

Note that you can write (shift @0 SSA_NAME@1) in the pattern instead of a 
separate test.

-- 
Marc Glisse

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Optimize X << Y with low bits of Y known to be 0 (PR tree-optimization/71563)
  2016-12-20 20:45 ` Marc Glisse
@ 2016-12-20 20:52   ` Jakub Jelinek
  2016-12-29 21:20     ` [PATCH] genmatch fix " Jakub Jelinek
  2016-12-29 21:49     ` [PATCH] Optimize X << Y with low bits of Y known to be 0 (PR tree-optimization/71563, take 2) Jakub Jelinek
  0 siblings, 2 replies; 8+ messages in thread
From: Jakub Jelinek @ 2016-12-20 20:52 UTC (permalink / raw)
  To: gcc-patches; +Cc: Richard Biener

On Tue, Dec 20, 2016 at 09:30:17PM +0100, Marc Glisse wrote:
> would it make sense to extend it to rotates later?

I wasn't 100% sure if rotates also require 0..prec-1 rotate counts, or
if they accept arbitrary ones.

> Note that you can write (shift @0 SSA_NAME@1) in the pattern instead of a
> separate test.

That is what I tried first, but there is some bug in genmatch.c that
prevents it.  The:
 (for vec (VECTOR_CST CONSTRUCTOR)
  (simplify
   (shiftrotate @0 vec@1)
results in case SSA_NAME: being added to a switch:
    case SSA_NAME:
      if (do_valueize (valueize, op1) != NULL_TREE)
        {
          gimple *def_stmt = SSA_NAME_DEF_STMT (op1);
          if (gassign *def = dyn_cast <gassign *> (def_stmt))
            switch (gimple_assign_rhs_code (def))
              {
              case CONSTRUCTOR:
and the SSA_NAME@1 in another simplification resulted in another
    case SSA_NAME:
into the same switch (rather than appending to the case SSA_NAME).

	Jakub

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] genmatch fix (PR tree-optimization/71563)
  2016-12-20 20:52   ` Jakub Jelinek
@ 2016-12-29 21:20     ` Jakub Jelinek
  2017-01-02  7:55       ` Jakub Jelinek
  2016-12-29 21:49     ` [PATCH] Optimize X << Y with low bits of Y known to be 0 (PR tree-optimization/71563, take 2) Jakub Jelinek
  1 sibling, 1 reply; 8+ messages in thread
From: Jakub Jelinek @ 2016-12-29 21:20 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

Hi!

On Tue, Dec 20, 2016 at 09:45:03PM +0100, Jakub Jelinek wrote:
> That is what I tried first, but there is some bug in genmatch.c that
> prevents it.  The:
>  (for vec (VECTOR_CST CONSTRUCTOR)
>   (simplify
>    (shiftrotate @0 vec@1)
> results in case SSA_NAME: being added to a switch:
>     case SSA_NAME:
>       if (do_valueize (valueize, op1) != NULL_TREE)
>         {
>           gimple *def_stmt = SSA_NAME_DEF_STMT (op1);
>           if (gassign *def = dyn_cast <gassign *> (def_stmt))
>             switch (gimple_assign_rhs_code (def))
>               {
>               case CONSTRUCTOR:
> and the SSA_NAME@1 in another simplification resulted in another
>     case SSA_NAME:
> into the same switch (rather than appending to the case SSA_NAME).

This patch attempts to deal with that.  The change for the new version of
the patch with SSA_NAME@1 I'll post right away is (twice).  Two case SSA_NAME:
in a single switch of course don't work well.

--- gimple-match.c.jj   2016-12-29 21:57:22.000000000 +0100
+++ gimple-match.c      2016-12-29 22:11:58.824526121 +0100
@@ -63732,6 +63732,14 @@ if (integer_all_onesp (op0))
              default:;
              }
         }
+       {
+         {
+/* #line 1524 "../../gcc/match.pd" */
+           tree captures[2] ATTRIBUTE_UNUSED = { op0, op1 };
+           if (gimple_simplify_79 (res_code, res_ops, seq, valueize, type, captures, RSHIFT_EXPR))
+             return true;
+         }
+       }
       break;
     case VECTOR_CST:
       {
@@ -63743,16 +63751,6 @@ if (integer_all_onesp (op0))
        }
         break;
       }
-    case SSA_NAME:
-      {
-       {
-/* #line 1524 "../../gcc/match.pd" */
-         tree captures[2] ATTRIBUTE_UNUSED = { op0, op1 };
-         if (gimple_simplify_79 (res_code, res_ops, seq, valueize, type, captures, RSHIFT_EXPR))
-           return true;
-       }
-        break;
-      }
     default:;
     }
   switch (TREE_CODE (op0))


	Jakub

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] Optimize X << Y with low bits of Y known to be 0 (PR tree-optimization/71563, take 2)
  2016-12-20 20:52   ` Jakub Jelinek
  2016-12-29 21:20     ` [PATCH] genmatch fix " Jakub Jelinek
@ 2016-12-29 21:49     ` Jakub Jelinek
  2017-01-04  9:01       ` Richard Biener
  1 sibling, 1 reply; 8+ messages in thread
From: Jakub Jelinek @ 2016-12-29 21:49 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

Hi!

On Tue, Dec 20, 2016 at 09:45:03PM +0100, Jakub Jelinek wrote:
> > Note that you can write (shift @0 SSA_NAME@1) in the pattern instead of a
> > separate test.
> 
> That is what I tried first, but there is some bug in genmatch.c that
> prevents it.  The:
>  (for vec (VECTOR_CST CONSTRUCTOR)
>   (simplify
>    (shiftrotate @0 vec@1)
> results in case SSA_NAME: being added to a switch:
>     case SSA_NAME:
>       if (do_valueize (valueize, op1) != NULL_TREE)
>         {
>           gimple *def_stmt = SSA_NAME_DEF_STMT (op1);
>           if (gassign *def = dyn_cast <gassign *> (def_stmt))
>             switch (gimple_assign_rhs_code (def))
>               {
>               case CONSTRUCTOR:
> and the SSA_NAME@1 in another simplification resulted in another
>     case SSA_NAME:
> into the same switch (rather than appending to the case SSA_NAME).

And here is the corresponding updated version of the patch:

2016-12-29  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/71563
	* match.pd: Simplify X << Y into X if Y is known to be 0 or
	out of range value - has low bits known to be zero.

	* gcc.dg/tree-ssa/pr71563.c: New test.

--- gcc/match.pd.jj	2016-12-21 10:00:10.809244456 +0100
+++ gcc/match.pd	2016-12-29 21:56:56.891858831 +0100
@@ -1515,6 +1515,21 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
     (if (tem)
      (shiftrotate @0 { tem; }))))))
 
+/* Simplify X << Y where Y's low width bits are 0 to X, as only valid
+   Y is 0.  Similarly for X >> Y.  */
+#if GIMPLE
+(for shift (lshift rshift)
+ (simplify
+  (shift @0 SSA_NAME@1)
+   (if (INTEGRAL_TYPE_P (TREE_TYPE (@1)))
+    (with {
+      int width = ceil_log2 (element_precision (TREE_TYPE (@0)));
+      int prec = TYPE_PRECISION (TREE_TYPE (@1));
+     }
+     (if ((get_nonzero_bits (@1) & wi::mask (width, false, prec)) == 0)
+      @0)))))
+#endif
+
 /* Rewrite an LROTATE_EXPR by a constant into an
    RROTATE_EXPR by a new constant.  */
 (simplify
--- gcc/testsuite/gcc.dg/tree-ssa/pr71563.c.jj	2016-12-29 21:56:12.668414342 +0100
+++ gcc/testsuite/gcc.dg/tree-ssa/pr71563.c	2016-12-29 21:56:12.668414342 +0100
@@ -0,0 +1,23 @@
+/* PR tree-optimization/71563 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+void link_error (void);
+
+void
+foo (int k)
+{
+  int t = 1 << ((1 / k) << 8);
+  if (t != 1)
+    link_error ();
+}
+
+void
+bar (int k, int l)
+{
+  int t = l << (k << 8);
+  if (t != l)
+    link_error ();
+}
+
+/* { dg-final { scan-tree-dump-not "link_error" "optimized" } } */


	Jakub

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] genmatch fix (PR tree-optimization/71563)
  2016-12-29 21:20     ` [PATCH] genmatch fix " Jakub Jelinek
@ 2017-01-02  7:55       ` Jakub Jelinek
  2017-01-03  6:52         ` Richard Biener
  0 siblings, 1 reply; 8+ messages in thread
From: Jakub Jelinek @ 2017-01-02  7:55 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

On Thu, Dec 29, 2016 at 10:18:34PM +0100, Jakub Jelinek wrote:
> On Tue, Dec 20, 2016 at 09:45:03PM +0100, Jakub Jelinek wrote:
> > That is what I tried first, but there is some bug in genmatch.c that
> > prevents it.  The:
> >  (for vec (VECTOR_CST CONSTRUCTOR)
> >   (simplify
> >    (shiftrotate @0 vec@1)
> > results in case SSA_NAME: being added to a switch:
> >     case SSA_NAME:
> >       if (do_valueize (valueize, op1) != NULL_TREE)
> >         {
> >           gimple *def_stmt = SSA_NAME_DEF_STMT (op1);
> >           if (gassign *def = dyn_cast <gassign *> (def_stmt))
> >             switch (gimple_assign_rhs_code (def))
> >               {
> >               case CONSTRUCTOR:
> > and the SSA_NAME@1 in another simplification resulted in another
> >     case SSA_NAME:
> > into the same switch (rather than appending to the case SSA_NAME).
> 
> This patch attempts to deal with that.  The change for the new version of
> the patch with SSA_NAME@1 I'll post right away is (twice).  Two case SSA_NAME:
> in a single switch of course don't work well.

Oops, forgot to add the actual patch, here it is:

2017-01-02  Jakub Jelinek  <jakub@redhat.com>

	* genmatch.c (dt_node::gen_kids_1): If generic_exprs include SSA_NAME
	and exprs_len || fns_len, emit the code for SSA_NAME next to the exprs
	and fns handling, rather than in a separate case SSA_NAME.

--- gcc/genmatch.c.jj	2016-11-09 16:34:58.000000000 +0100
+++ gcc/genmatch.c	2016-12-29 22:11:25.088950033 +0100
@@ -2913,6 +2913,20 @@ dt_node::gen_kids_1 (FILE *f, int indent
 
       indent -= 6;
       fprintf_indent (f, indent, "    }\n");
+      /* See if there is SSA_NAME among generic_exprs and if yes, emit it
+	 here rather than in the next loop.  */
+      for (unsigned i = 0; i < generic_exprs.length (); ++i)
+	{
+	  expr *e = as_a <expr *>(generic_exprs[i]->op);
+	  id_base *op = e->operation;
+	  if (*op == SSA_NAME && (exprs_len || fns_len))
+	    {
+	      fprintf_indent (f, indent + 4, "{\n");
+	      generic_exprs[i]->gen (f, indent + 6, gimple);
+	      fprintf_indent (f, indent + 4, "}\n");
+	    }
+	}
+
       fprintf_indent (f, indent, "  break;\n");
     }
 
@@ -2922,6 +2936,9 @@ dt_node::gen_kids_1 (FILE *f, int indent
       id_base *op = e->operation;
       if (*op == CONVERT_EXPR || *op == NOP_EXPR)
 	fprintf_indent (f, indent, "CASE_CONVERT:\n");
+      else if (*op == SSA_NAME && (exprs_len || fns_len))
+	/* Already handled above.  */
+	continue;
       else
 	fprintf_indent (f, indent, "case %s:\n", op->id);
       fprintf_indent (f, indent, "  {\n");


	Jakub

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] genmatch fix (PR tree-optimization/71563)
  2017-01-02  7:55       ` Jakub Jelinek
@ 2017-01-03  6:52         ` Richard Biener
  0 siblings, 0 replies; 8+ messages in thread
From: Richard Biener @ 2017-01-03  6:52 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches

On January 2, 2017 8:55:45 AM GMT+01:00, Jakub Jelinek <jakub@redhat.com> wrote:
>On Thu, Dec 29, 2016 at 10:18:34PM +0100, Jakub Jelinek wrote:
>> On Tue, Dec 20, 2016 at 09:45:03PM +0100, Jakub Jelinek wrote:
>> > That is what I tried first, but there is some bug in genmatch.c
>that
>> > prevents it.  The:
>> >  (for vec (VECTOR_CST CONSTRUCTOR)
>> >   (simplify
>> >    (shiftrotate @0 vec@1)
>> > results in case SSA_NAME: being added to a switch:
>> >     case SSA_NAME:
>> >       if (do_valueize (valueize, op1) != NULL_TREE)
>> >         {
>> >           gimple *def_stmt = SSA_NAME_DEF_STMT (op1);
>> >           if (gassign *def = dyn_cast <gassign *> (def_stmt))
>> >             switch (gimple_assign_rhs_code (def))
>> >               {
>> >               case CONSTRUCTOR:
>> > and the SSA_NAME@1 in another simplification resulted in another
>> >     case SSA_NAME:
>> > into the same switch (rather than appending to the case SSA_NAME).
>> 
>> This patch attempts to deal with that.  The change for the new
>version of
>> the patch with SSA_NAME@1 I'll post right away is (twice).  Two case
>SSA_NAME:
>> in a single switch of course don't work well.
>
>Oops, forgot to add the actual patch, here it is:

OK.

Richard.

>2017-01-02  Jakub Jelinek  <jakub@redhat.com>
>
>	* genmatch.c (dt_node::gen_kids_1): If generic_exprs include SSA_NAME
>	and exprs_len || fns_len, emit the code for SSA_NAME next to the exprs
>	and fns handling, rather than in a separate case SSA_NAME.
>
>--- gcc/genmatch.c.jj	2016-11-09 16:34:58.000000000 +0100
>+++ gcc/genmatch.c	2016-12-29 22:11:25.088950033 +0100
>@@ -2913,6 +2913,20 @@ dt_node::gen_kids_1 (FILE *f, int indent
> 
>       indent -= 6;
>       fprintf_indent (f, indent, "    }\n");
>+      /* See if there is SSA_NAME among generic_exprs and if yes, emit
>it
>+	 here rather than in the next loop.  */
>+      for (unsigned i = 0; i < generic_exprs.length (); ++i)
>+	{
>+	  expr *e = as_a <expr *>(generic_exprs[i]->op);
>+	  id_base *op = e->operation;
>+	  if (*op == SSA_NAME && (exprs_len || fns_len))
>+	    {
>+	      fprintf_indent (f, indent + 4, "{\n");
>+	      generic_exprs[i]->gen (f, indent + 6, gimple);
>+	      fprintf_indent (f, indent + 4, "}\n");
>+	    }
>+	}
>+
>       fprintf_indent (f, indent, "  break;\n");
>     }
> 
>@@ -2922,6 +2936,9 @@ dt_node::gen_kids_1 (FILE *f, int indent
>       id_base *op = e->operation;
>       if (*op == CONVERT_EXPR || *op == NOP_EXPR)
> 	fprintf_indent (f, indent, "CASE_CONVERT:\n");
>+      else if (*op == SSA_NAME && (exprs_len || fns_len))
>+	/* Already handled above.  */
>+	continue;
>       else
> 	fprintf_indent (f, indent, "case %s:\n", op->id);
>       fprintf_indent (f, indent, "  {\n");
>
>
>	Jakub


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Optimize X << Y with low bits of Y known to be 0 (PR tree-optimization/71563, take 2)
  2016-12-29 21:49     ` [PATCH] Optimize X << Y with low bits of Y known to be 0 (PR tree-optimization/71563, take 2) Jakub Jelinek
@ 2017-01-04  9:01       ` Richard Biener
  0 siblings, 0 replies; 8+ messages in thread
From: Richard Biener @ 2017-01-04  9:01 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches

On Thu, 29 Dec 2016, Jakub Jelinek wrote:

> Hi!
> 
> On Tue, Dec 20, 2016 at 09:45:03PM +0100, Jakub Jelinek wrote:
> > > Note that you can write (shift @0 SSA_NAME@1) in the pattern instead of a
> > > separate test.
> > 
> > That is what I tried first, but there is some bug in genmatch.c that
> > prevents it.  The:
> >  (for vec (VECTOR_CST CONSTRUCTOR)
> >   (simplify
> >    (shiftrotate @0 vec@1)
> > results in case SSA_NAME: being added to a switch:
> >     case SSA_NAME:
> >       if (do_valueize (valueize, op1) != NULL_TREE)
> >         {
> >           gimple *def_stmt = SSA_NAME_DEF_STMT (op1);
> >           if (gassign *def = dyn_cast <gassign *> (def_stmt))
> >             switch (gimple_assign_rhs_code (def))
> >               {
> >               case CONSTRUCTOR:
> > and the SSA_NAME@1 in another simplification resulted in another
> >     case SSA_NAME:
> > into the same switch (rather than appending to the case SSA_NAME).
> 
> And here is the corresponding updated version of the patch:

Ok.

Thanks,
Richard.

> 2016-12-29  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR tree-optimization/71563
> 	* match.pd: Simplify X << Y into X if Y is known to be 0 or
> 	out of range value - has low bits known to be zero.
> 
> 	* gcc.dg/tree-ssa/pr71563.c: New test.
> 
> --- gcc/match.pd.jj	2016-12-21 10:00:10.809244456 +0100
> +++ gcc/match.pd	2016-12-29 21:56:56.891858831 +0100
> @@ -1515,6 +1515,21 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
>      (if (tem)
>       (shiftrotate @0 { tem; }))))))
>  
> +/* Simplify X << Y where Y's low width bits are 0 to X, as only valid
> +   Y is 0.  Similarly for X >> Y.  */
> +#if GIMPLE
> +(for shift (lshift rshift)
> + (simplify
> +  (shift @0 SSA_NAME@1)
> +   (if (INTEGRAL_TYPE_P (TREE_TYPE (@1)))
> +    (with {
> +      int width = ceil_log2 (element_precision (TREE_TYPE (@0)));
> +      int prec = TYPE_PRECISION (TREE_TYPE (@1));
> +     }
> +     (if ((get_nonzero_bits (@1) & wi::mask (width, false, prec)) == 0)
> +      @0)))))
> +#endif
> +
>  /* Rewrite an LROTATE_EXPR by a constant into an
>     RROTATE_EXPR by a new constant.  */
>  (simplify
> --- gcc/testsuite/gcc.dg/tree-ssa/pr71563.c.jj	2016-12-29 21:56:12.668414342 +0100
> +++ gcc/testsuite/gcc.dg/tree-ssa/pr71563.c	2016-12-29 21:56:12.668414342 +0100
> @@ -0,0 +1,23 @@
> +/* PR tree-optimization/71563 */
> +/* { dg-do compile } */
> +/* { dg-options "-O2 -fdump-tree-optimized" } */
> +
> +void link_error (void);
> +
> +void
> +foo (int k)
> +{
> +  int t = 1 << ((1 / k) << 8);
> +  if (t != 1)
> +    link_error ();
> +}
> +
> +void
> +bar (int k, int l)
> +{
> +  int t = l << (k << 8);
> +  if (t != l)
> +    link_error ();
> +}
> +
> +/* { dg-final { scan-tree-dump-not "link_error" "optimized" } } */
> 
> 
> 	Jakub
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-01-04  9:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-20 19:57 [PATCH] Optimize X << Y with low bits of Y known to be 0 (PR tree-optimization/71563) Jakub Jelinek
2016-12-20 20:45 ` Marc Glisse
2016-12-20 20:52   ` Jakub Jelinek
2016-12-29 21:20     ` [PATCH] genmatch fix " Jakub Jelinek
2017-01-02  7:55       ` Jakub Jelinek
2017-01-03  6:52         ` Richard Biener
2016-12-29 21:49     ` [PATCH] Optimize X << Y with low bits of Y known to be 0 (PR tree-optimization/71563, take 2) Jakub Jelinek
2017-01-04  9:01       ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).