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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2016-08-14 00:00:00         |2021-12-25

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The following two functions should produce the same assembly code in this case:
[[gnu::const]]
static inline int g(int b, int c) {return b * 2 + 4;}
int foo (int b, int c)
{
  int res = 0;
  if (b)
    res = g(b, c);
  if (c)
    return res;
  return 0;
}
int foo1 (int b, int c)
{
  int res = 0;
  if (c)
   { if (b) res = g(b, c); else res = 0; return res;}
  return 0;
}

Reply via email to