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: unassig...@gcc.gnu.org ReportedBy: uweig...@gcc.gnu.org CC: rguent...@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.)