This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/31531] A microoptimization of isnegative of signed integer


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31531

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-02-12 04:35:53 UTC ---
The shortest testcase for the problem function:
int isnegative_optimized_4(unsigned int X) {
   int result; // Y is the conditional expression of if-else.
   if ((~X) >> 31) result = 0;
   else            result = 1;
   return result;
}

We need to combine the following gimple:
  D.2293_3 = ~X_2(D);
  D.2294_4 = (int) D.2293_3;
  D.2424_9 = D.2294_4 >= 0;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]