https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114760

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think it's also a missed canonicalization for x << 1 vs. x + x (and 2*x).

unsigned a, b, c;
void foo (unsigned x)
{
  a = x << 1;
  b = x + x;
  c = 2 * x;
}

x + x gets folded to 2 * x before gimplification.  value-numbering figures
x << 1 is the same as 2 * x but we don't canonicalize it so pattern matching
needs to match both variants.

Reply via email to