From owner-freebsd-arch@FreeBSD.ORG Sat May 5 21:32:14 2007 Return-Path: X-Original-To: arch@freebsd.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8E40A16A403; Sat, 5 May 2007 21:32:14 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 0F07913C459; Sat, 5 May 2007 21:32:13 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.1/8.14.1) with ESMTP id l45LW3KJ049989; Sun, 6 May 2007 01:32:03 +0400 (MSD) (envelope-from ache@nagual.pp.ru) Received: (from ache@localhost) by nagual.pp.ru (8.14.1/8.14.1/Submit) id l45LW3xY049988; Sun, 6 May 2007 01:32:03 +0400 (MSD) (envelope-from ache) Date: Sun, 6 May 2007 01:32:02 +0400 From: Andrey Chernov To: "Sean C. Farley" Message-ID: <20070505213202.GA49925@nagual.pp.ru> References: <20070501135439.B36275@thor.farley.org> <20070502.102822.-957833022.imp@bsdimp.com> <20070502183100.P1317@baba.farley.org> <20070502230413.Y30614@thor.farley.org> <20070503160351.GA15008@nagual.pp.ru> <20070504085905.J39482@thor.farley.org> <20070504213312.GA33163@nagual.pp.ru> <20070504174657.D1343@thor.farley.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070504174657.D1343@thor.farley.org> User-Agent: Mutt/1.5.15 (2007-04-06) Cc: Daniel Eischen , arch@freebsd.org Subject: Re: HEADS DOWN X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 May 2007 21:32:14 -0000 On Sat, May 05, 2007 at 03:56:21PM -0500, Sean C. Farley wrote: > Interestingly, gcc 3.4.6 on -STABLE does not do such a great job even > with -minline-all-stringops. I do have CPUTYPE?=pentium4 in > /etc/make.conf. Maybe this is only an issue with i386 similar to what > you mention below? Even "cc -O" do that, without any flags, see live example below: a.c: #include #include #include main() { printf("%d\n", strlen(getenv("HOME"))); } cc -O -S a.c cat a.s .file "a.c" .section .rodata.str1.1,"aMS",@progbits,1 .LC0: .string "HOME" .LC1: .string "%d\n" .text .p2align 2,,3 .globl main .type main, @function main: pushl %ebp movl %esp, %ebp pushl %edi subl $4, %esp andl $-16, %esp subl $28, %esp pushl $.LC0 call getenv addl $8, %esp movl %eax, %edi cld movl $-1, %ecx movb $0, %al repnz scasb notl %ecx decl %ecx pushl %ecx pushl $.LC1 call printf movl -4(%ebp), %edi leave ret .size main, .-main .ident "GCC: (GNU) 3.4.6 [FreeBSD] 20060825" -- http://ache.pp.ru/