Factor out the common subexpression month_remainder * DAYS_PER_MONTH
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 25 Aug 2005 05:01:43 +0000 (05:01 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 25 Aug 2005 05:01:43 +0000 (05:01 +0000)
commit2666483857633ee224137bc13a3c8a7c529e4a01
tree47fc66fe9ced6f7ca19ffb7f8174df87be38a4ef
parent93bdb36d7e0333307a04cfae9ef9528824a1df76
Factor out the common subexpression month_remainder * DAYS_PER_MONTH
in interval_mul and interval_div.  This avoids an optimization bug
in A Certain Company's compiler (and given their explanation, I wouldn't
be surprised if other compilers blow it too).  Besides the code seems
more clear this way --- in the original formulation, you had to mentally
recognize the common subexpression in order to understand what was going
on.
src/backend/utils/adt/timestamp.c