From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28401 invoked by alias); 19 Jan 2009 22:23:45 -0000 Received: (qmail 28393 invoked by uid 22791); 19 Jan 2009 22:23:44 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from vms044pub.verizon.net (HELO vms044pub.verizon.net) (206.46.252.44) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 19 Jan 2009 22:23:40 +0000 Received: from [192.168.1.102] ([68.37.236.200]) by vms044.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0KDQ00DPDOV7KXO0@vms044.mailsrvcs.net> for ecos-patches@ecos.sourceware.org; Mon, 19 Jan 2009 16:23:31 -0600 (CST) Date: Mon, 19 Jan 2009 22:23:00 -0000 From: Jose Vasconcellos Subject: redboot fconfig crash with gcc 4.3.2 To: ecos-patches@ecos.sourceware.org Message-id: <4974FD62.9090602@verizon.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit User-Agent: Thunderbird 2.0.0.19 (X11/20090105) X-IsSubscribed: yes Mailing-List: contact ecos-patches-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-patches-owner@ecos.sourceware.org X-SW-Source: 2009-01/txt/msg00016.txt.bz2 Redboot gets an exception when trying to set any IP address with fconfig when using gcc-4.3.2 on an ixp425 target (armeb). The issue seems to be an alignment problem as val_ptr contains an odd address; it looks like gcc is optimizing and trying to do a copy on a word boundary. The removal of the cast fixes the problem. --- fconfig.c 2009-01-18 14:34:11.000000000 -0500 +++ fconfig.c.new 2009-01-18 14:35:22.000000000 -0500 @@ -388,7 +388,7 @@ break; #ifdef CYGPKG_REDBOOT_NETWORKING case CONFIG_IP: - memcpy(&hold_ip_val.s_addr, &((in_addr_t *)val_ptr)->s_addr, sizeof(in_addr_t)); + memcpy(&hold_ip_val.s_addr, val_ptr, sizeof(in_addr_t)); if (!_gethostbyname(line, &new_ip_val)) { return CONFIG_BAD; }