pgsql: Factor out the common subexpression month_remainder *

From: tgl(at)svr1(dot)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Factor out the common subexpression month_remainder *
Date: 2005-08-25 05:01:43
Message-ID: 20050825050143.65677D7A57@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
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.

Modified Files:
--------------
pgsql/src/backend/utils/adt:
timestamp.c (r1.150 -> r1.151)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/timestamp.c.diff?r1=1.150&r2=1.151)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2005-08-25 17:17:10 pgsql: Replace out-of-line tas() assembly code for MIPS with a properly
Previous Message Bruce Momjian 2005-08-25 03:53:24 pgsql: Back out pfrees for justify_hour function calls.