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 tree-optimization/24568] [meta-bug] Missed optimization: trivialization of silly code



------- Comment #8 from steven at gcc dot gnu dot org  2007-03-29 13:29 -------
For the original test case, our current output before expand (i.e. the
final_cleanup dump) on hosts where sizeof(long)==sizeof(int) is this:

;; Function convertToMinutes (convertToMinutes)

convertToMinutes (milliDiff)
{
  int minutesDiff.24;
  int minutesDiff;

<bb 2>:
  if (milliDiff < 0) goto <L0>; else goto <L1>;

<L0>:;
  minutesDiff = -milliDiff / 60000;
  minutesDiff.24 = -minutesDiff;
  goto <bb 7> (<L6>);

<L1>:;
  if (milliDiff == 0) goto <L13>; else goto <L3>;

<L13>:;
  minutesDiff.24 = 0;
  goto <bb 7> (<L6>);

Invalid sum of outgoing probabilities 0.0%
Invalid sum of incoming frequencies 2000, should be 0
<L3>:;
  minutesDiff.24 = milliDiff / 60000;

Invalid sum of incoming frequencies 8000, should be 10000
<L6>:;
  return minutesDiff.24;

}


Note that on hosts where sizeof(long) != sizeof(int), you can't optimize the
original test case to i/60000.


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2006-02-26 19:10:03         |2007-03-29 13:29:35
               date|                            |


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


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