[Bug rtl-optimization/101736] Option -fno-reorder-functions breaks exceptions in gcc 8.2.1

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Aug 2 22:42:26 GMT 2021


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-08-02
     Ever confirmed|0                           |1

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Here is a testcase which fails on the trunk still:
inline void
throw_expr ()
{
  throw 0;
}

void f(void) __attribute__((hot));
void f(void) {}

using namespace std;

int main1 (int t) __attribute__((noinline, hot));
int
main1 (int t)
{
  if (t) { f(); return 0;}
  try
  {
    throw_expr();
  }
  catch (int) { }
  return 0;
}
int main(void)
{
    return main1(0);
}
---------- CUT ------
I had to add some extra functions to force the partitioning to happen.

>From what I can tell -freorder-blocks-and-partition should be turned off if
-freorder-function is turned off.


More information about the Gcc-bugs mailing list