public inbox for glibc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rsa at us dot ibm dot com" <sourceware-bugzilla@sourceware.org> To: glibc-bugs@sources.redhat.com Subject: [Bug libc/10107] New: 32-bit PowerPC POWER6 memcpy uses erroneous cmpldi but should use cmplwi Date: Mon, 27 Apr 2009 17:05:00 -0000 [thread overview] Message-ID: <20090427170435.10107.rsa@us.ibm.com> (raw) The 32-bit PowerPC POWER6 memcpy uses the cmpldi insn when it should use a cmplwi. /* Compare the contents of register 'r5' to the value '16' where r5 */ /* holds '12'. */ cmpldi cr1,5,16 This doesn't normally prove to be a problem except when the 'length' parameter to memcpy, held in register r5 is a computed value and the result has the high 32-bits of the register populated with junk due 64-bit operation (in the error case a rlwinm insn),e.g. 0x1007c240 <r_gset+152>: rlwinm r9,r0,0,0,29 0x1007c244 <r_gset+156>: addi r5,r9,16 0x1007c248 <r_gset+160>: bl 0x100dc750 <memcpy@plt> This causes the cmpldi to result in 'greater' than when comparing '12' to '16' which is erroneous. The correction instruction is cmplwi which ignores the high 32-bits or 'r5': cmplwi cr1,5,16 I'll supply a patch and a testcase shortly. -- Summary: 32-bit PowerPC POWER6 memcpy uses erroneous cmpldi but should use cmplwi Product: glibc Version: 2.9 Status: NEW Severity: normal Priority: P1 Component: libc AssignedTo: rsa at us dot ibm dot com ReportedBy: rsa at us dot ibm dot com CC: glibc-bugs at sources dot redhat dot com GCC build triplet: powerpc-linux GCC host triplet: powerpc-linux GCC target triplet: powerpc-linux http://sourceware.org/bugzilla/show_bug.cgi?id=10107 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
next reply other threads:[~2009-04-27 17:05 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2009-04-27 17:05 rsa at us dot ibm dot com [this message] 2009-04-27 17:08 ` [Bug libc/10107] " rsa at us dot ibm dot com 2009-04-27 17:09 ` rsa at us dot ibm dot com 2009-04-30 15:38 ` rsa at us dot ibm dot com 2009-04-30 15:38 ` rsa at us dot ibm dot com 2009-06-16 15:30 ` drepper at redhat dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20090427170435.10107.rsa@us.ibm.com \ --to=sourceware-bugzilla@sourceware.org \ --cc=glibc-bugs@sources.redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).