X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id D6E66D1B4E3; Tue, 14 Oct 2003 00:49:11 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 74100-09; Mon, 13 Oct 2003 21:48:41 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 11FADD1B543; Mon, 13 Oct 2003 21:48:38 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h9E0mDe09671; Mon, 13 Oct 2003 20:48:13 -0400 (EDT) From: Bruce Momjian Message-Id: <200310140048.h9E0mDe09671@candle.pha.pa.us> Subject: Re: [HACKERS] Sun performance - Major discovery! In-Reply-To: <1253.1066083904@sss.pgh.pa.us> To: Tom Lane Date: Mon, 13 Oct 2003 20:48:13 -0400 (EDT) Cc: Neil Conway , Jeff , PostgreSQL Performance , PostgreSQL Hackers X-Mailer: ELM [version 2.4ME+ PL106 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/442 X-Sequence-Number: 4190 Done as you suggested. --------------------------------------------------------------------------- Tom Lane wrote: > Bruce Momjian writes: > > OK, patch attached and applied. It centralizes the optimization > > defaults into configure.in, rather than having CFLAGS= in the template > > files. > > I think there's a problem here: > > > + # configure sets CFLAGS to -O2 for gcc, so this is only for non-gcc > > + if test x"$CFLAGS" = x""; then > > + CFLAGS="-O" > > + fi > > if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then > > CFLAGS="$CFLAGS -g" > > fi > > since this will cause "configure --enable-debug" to default to selecting > CFLAGS="-O -g" for non-gcc compilers. On a lot of compilers that > combination does not work, and will generate tons of useless warnings. > I think it might be better to do > > if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then > CFLAGS="$CFLAGS -g" > + else > + # configure sets CFLAGS to -O2 for gcc, so this is only for non-gcc > + if test x"$CFLAGS" = x""; then > + CFLAGS="-O" > + fi > fi > > regards, tom lane > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073