From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30297 invoked by alias); 5 Jan 2011 12:58:22 -0000 Received: (qmail 30285 invoked by uid 22791); 5 Jan 2011 12:58:21 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 05 Jan 2011 12:58:17 +0000 From: "uweigand at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/47179] New: [4.5/4.6 Regression] SPU: errno misoptimization around malloc call X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: uweigand 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-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Wed, 05 Jan 2011 12:58:00 -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 X-SW-Source: 2011-01/txt/msg00382.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47179 Summary: [4.5/4.6 Regression] SPU: errno misoptimization around malloc call Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned@gcc.gnu.org ReportedBy: uweigand@gcc.gnu.org CC: rguenther@suse.de Target: spu-elf The problem described in PR 42944 is still present on SPU. This is because the SPU system library (newlib) uses: extern struct _reent _impure_data; #define errno (_impure_data._errno) in its version of errno.h, but GCC's call_may_clobber_ref_p_1 routine assumes errno is always either a global or else accessed via a pointer. It does not handle component references. (Note that the problem seems to be specific to the SPU, because of an optimization that makes use of the fact that SPU code is always single-threaded. On other platforms, newlib accesses errno via a pointer as well.)