[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#86251: marked as done ([PR optimization/3511]: Inlined strlen() could be smarter)



Your message dated Mon, 9 Jun 2008 11:23:17 +0200
with message-id <20080609092317.GA4660@PC23>
and subject line Re: gcc: Inlined strlen() could be smarter
has caused the Debian Bug report #86251,
regarding [PR optimization/3511]: Inlined strlen() could be smarter
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
86251: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=86251
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: gcc
Version: 1:2.95.3-5
Severity: wishlist

gcc -S -O2 on the file

#include <string.h>

size_t mystrlen(const char *s) {
	if (!s) {
		s = "";
	}

	return strlen(s);
}

generates (on i386)

	.file	"a.c"
	.version	"01.01"
gcc2_compiled.:
.section	.rodata
.LC0:
	.string	""
.text
	.align 4
.globl mystrlen
	.type	 mystrlen,@function
mystrlen:
	pushl %ebp
	movl %esp,%ebp
	pushl %edi
	movl 8(%ebp),%edi
	testl %edi,%edi
	jne .L142
	movl $.LC0,%edi
.L142:
	movb $0,%al
	cld
	movl $-1,%ecx
	repnz
	scasb
	notl %ecx
	leal -1(%ecx),%eax
	popl %edi
	leave
	ret
.Lfe1:
	.size	 mystrlen,.Lfe1-mystrlen
	.ident	"GCC: (GNU) 2.95.3 20010125 (prerelease)"

As you can see, strlen() is not optimised out in the !pat case.

-- System Information
Debian Release: testing/unstable
Kernel Version: Linux gondor 2.2.17 #1 Mon Sep 11 22:22:16 EST 2000 i586 unknown

Versions of the packages gcc depends on:
ii  cpp            2.95.3-5       The GNU C preprocessor.
ii  cpp-2.95       2.95.3-4       The GNU C preprocessor.
ii  gcc-2.95       2.95.3-4       The GNU C compiler.


--- End Message ---
--- Begin Message ---
Version: 4.3.1-1

On 17.02.01 herbert@gondor.apana.org.au (herbert@gondor.apana.org.au) wrote:

> Package: gcc
> Version: 1:2.95.3-5
> Severity: wishlist
> 
> gcc -S -O2 on the file
> 
> As you can see, strlen() is not optimised out in the !pat case.
> 
changelog from latest gcc:

gcc-4.3 (4.3.1-1) unstable; urgency=high

  * Closing reports reported against gcc-4.0 and fixed in gcc-4.3:
    - General
      + Fix PR optimization/3511, inlined strlen() could be smarter.
        Close: #86251.

BTS seems not be able to handle the missing "s" -> Closing manually.

H.
-- 
sigmentation fault


--- End Message ---

Reply to: