From patchwork Sat Feb 2 14:05:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeroen Hofstee X-Patchwork-Id: 217666 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 4F67C2C0294 for ; Sun, 3 Feb 2013 01:05:38 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 197AA4A02E; Sat, 2 Feb 2013 15:05:35 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pTpAWZTr1-cO; Sat, 2 Feb 2013 15:05:34 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 172E54A039; Sat, 2 Feb 2013 15:05:33 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 029D94A039 for ; Sat, 2 Feb 2013 15:05:27 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WIyurv-tf8Rb for ; Sat, 2 Feb 2013 15:05:21 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail.virtualhost.nl (mail.virtualhost.nl [89.200.201.133]) by theia.denx.de (Postfix) with ESMTP id 8E5884A02E for ; Sat, 2 Feb 2013 15:05:19 +0100 (CET) Received: (qmail 20402 invoked by uid 1141); 2 Feb 2013 15:05:13 +0100 Received: from ip120-12-208-87.adsl2.static.versatel.nl (HELO [10.0.0.119]) (87.208.12.120) (smtp-auth username jeroen@myspectrum.nl, mechanism plain) by mail.virtualhost.nl (qpsmtpd/0.84) with (CAMELLIA256-SHA encrypted) ESMTPSA; Sat, 02 Feb 2013 15:05:13 +0100 Message-ID: <510D1D1E.7080705@myspectrum.nl> Date: Sat, 02 Feb 2013 15:05:18 +0100 From: Jeroen Hofstee User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: Albert ARIBAUD References: <20130201113111.DC53920055E@gemini.denx.de> <510CD045.8050207@denx.de> <510CE804.7020600@myspectrum.nl> <20130202123217.415914a7@lilith> In-Reply-To: <20130202123217.415914a7@lilith> Cc: Marek Vasut , Jeroen Hofstee , "u-boot@lists.denx.de" , "Priebe, Sebastian" , Heiko Schocher Subject: Re: [U-Boot] U-Boot Bug with newer GCC X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Hello Albert, On 02/02/2013 12:32 PM, Albert ARIBAUD wrote: > >>> >>> Sebastian wrote On 01.02.2013 08:55: >>>> we are using u-boot in our embedded system with arm-1136jfs cpu. >>>> We recently tried a new toolchain with GCC 4.7.2. >>>> If compiled with the new toolchain the feature CONFIG_AUTO_COMPLETE isn't working. > [..] AFAIK it has never been seen on mainline code, The twister board from mainline / current master also has this problem. I believe the mt_ventoux will have it as well, but can't test it. > and has been very elusive for those who experience it -- enabling debug > or simply adding/removing code makes it go away or reappear, leading me > to thinking that some of the added code either does a data abort itself, > or causes one in the mainline code it calls upon. yes, it is confusing. The following patch will e.g. make the trap go away on the twister. Yet there is nothing wrong with the original code it touches (or I fail to see what it is). Regards, Jeroen const char *cmd; @@ -224,11 +223,7 @@ static int complete_cmdv(int argc, char * const argv[], char last_char, int maxv * Some commands allow length modifiers (like "cp.b"); * compare command name only until first dot. */ - p = strchr(cmd, '.'); - if (p == NULL) - len = strlen(cmd); - else - len = p - cmd; + len = strlen(cmd); /* return the partial matches */ for (; cmdtp != cmdend; cmdtp++) { diff --git a/common/command.c b/common/command.c index 50c8429..520bd39 100644 --- a/common/command.c +++ b/common/command.c @@ -185,7 +185,6 @@ static int complete_cmdv(int argc, char * const argv[], char last_char, int maxv cmd_tbl_t *cmdtp = ll_entry_start(cmd_tbl_t, cmd); const int count = ll_entry_count(cmd_tbl_t, cmd); const cmd_tbl_t *cmdend = cmdtp + count; - const char *p; int len, clen; int n_found = 0;