From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6415 invoked by alias); 28 Dec 2002 18:26:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 6392 invoked by uid 71); 28 Dec 2002 18:26:01 -0000 Resent-Date: 28 Dec 2002 18:26:01 -0000 Resent-Message-ID: <20021228182601.6391.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, Herbert Xu Resent-Reply-To: gcc-gnats@gcc.gnu.org, 85468@bugs.debian.org, 169004@bugs.debian.org Received: (qmail 6350 invoked from network); 28 Dec 2002 18:25:05 -0000 Received: from unknown (HELO hirsch.in-berlin.de) (192.109.42.6) by 209.249.29.67 with SMTP; 28 Dec 2002 18:25:05 -0000 Received: from tango.net.local (mail@dsl-213-023-020-190.arcor-ip.net [213.23.20.190]) (authenticated bits=0) by hirsch.in-berlin.de (8.12.1/8.12.1/Debian -2) with ESMTP id gBSIOp07005774 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT); Sat, 28 Dec 2002 19:24:52 +0100 Received: from doko by tango.net.local with local (Exim 4.12 #1 (Debian) [+araqnid]) id 18SLdh-0005TQ-00; Sat, 28 Dec 2002 19:24:49 +0100 Message-Id: Date: Sat, 28 Dec 2002 10:26:00 -0000 From: Matthias Klose Reply-To: 85468@bugs.debian.org, 169004@bugs.debian.org To: gcc-gnats@gcc.gnu.org, debian-gcc@lists.debian.org Cc: Herbert Xu X-Send-Pr-Version: 3.113 X-GNATS-Notify: Herbert Xu Subject: target/9082: [alpha,ia64] memcpy makes unaligned access X-SW-Source: 2002-12/txt/msg01344.txt.bz2 List-Id: >Number: 9082 >Category: target >Synopsis: [alpha,ia64] memcpy makes unaligned access >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Sat Dec 28 10:26:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Herbert Xu >Release: 3.2.1 (Debian) (Debian unstable) >Organization: The Debian Project >Environment: System: Debian GNU/Linux (unstable) Architecture: alpha-linux, ia64-linux host: alpha-linux Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,pascal,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-java-gc=boehm --enable-objc-gc i386-linux Thread model: posix gcc version 3.2.2 20021212 (Debian prerelease) >Description: [ Reported to the Debian BTS as report #85468, #169004 Please CC 85468@bugs.debian.org on replies. Log of report can be found at http://bugs.debian.org/85468 for alpha http://bugs.debian.org/169004 for ia64 ] [ reported for 2.95.2, rechecked with gcc-3_2-branch 20021212, Debian source code found at http://packages.debian.org/unstable/net/fping.html ] Herbert Xu writes: I attempted to make a minimal test case but failed as the stripped down version actually produced the correct code. The problem arose in fping. The relevant code is in fping.c:wait_for_reply(), memcpy(&sent_time, icp->icmp_data + offsetof(PING_DATA, ping_ts), sizeof(sent_time)); memcpy(&this_count, icp->icmp_data, sizeof(this_count)); Since icp->icmp_data is 4-byte aligned, one would expect the memcpys to do five 4-byte loads. However, the actual assembly produced with gcc -S -g -O2 is $LM490: .stabn 68,0,1157,$LM490 lds $f11,8($10) $LM491: .stabn 68,0,1155,$LM491 ldt $f10,16($10) ldt $f12,24($10) $LM492: .stabn 68,0,1157,$LM492 sts $f11,80($30) $LM493: .stabn 68,0,1155,$LM493 stt $f10,88($30) stt $f12,96($30) Which causes two unaligned traps. The followup for gcc-3.2: It still happens with 3.2 branch 20021212 on alpha. This is the assembly: 26bc: 08 00 2a a0 ldl t0,8(s1) 26c0: 10 00 4a a4 ldq t1,16(s1) 26c4: 18 00 6a a4 ldq t2,24(s1) 26c8: 40 00 3e b0 stl t0,64(sp) 26cc: 48 00 5e b4 stq t1,72(sp) 26d0: 50 00 7e b4 stq t2,80(sp) >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: