From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14023 invoked by alias); 24 Feb 2015 23:42:34 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 13998 invoked by uid 48); 24 Feb 2015 23:42:31 -0000 From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/64703] glibc sysdeps/powerpc/powerpc64/dl-machine.h miscompile Date: Wed, 25 Feb 2015 01:06:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-02/txt/msg02725.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64703 Martin Sebor changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |msebor at gcc dot gnu.org --- Comment #8 from Martin Sebor --- The test case is invalid because it accesses the value of the opd object via a pointer to a function when C allows an object to have its value accessed only by an lvalue of a compatible type. A simpler test case that demonstrates a similar issue is below: #include struct X { const char *s; }; struct Y { unsigned long n; }; const char* __attribute__ ((weak)) foo (unsigned long value) { struct Y y; if (value) { y.n = ((struct Y*)value)->n; value = (unsigned long)&y; } return ((struct X*)value)->s; } int main (void) { struct Y y = { 123 }; unsigned long n = (unsigned long)foo ((unsigned long)&y); assert (n == y.n); return 0; }