This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/42944] [4.5 Regression] errno misoptimization due to __attribute__ ((__const__)) on __errno_location()
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Feb 2010 10:58:09 -0000
- Subject: [Bug tree-optimization/42944] [4.5 Regression] errno misoptimization due to __attribute__ ((__const__)) on __errno_location()
- References: <bug-42944-1057@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from rguenth at gcc dot gnu dot org 2010-02-03 10:58 -------
The issue is simply that GCC thinks malloc does not set errno. Removing
const from __errno_location is just papering over this issue.
But that malloc sets errno is really really unfortunate. Because we have
no other way than clobbering global memory. Note that C99 does not specify
malloc affecting errno.
Mine.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |rguenth at gcc dot gnu dot
|dot org |org
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2010-02-03 10:58:09
date| |
Summary|errno misoptimization due to|[4.5 Regression] errno
|__attribute__ ((__const__)) |misoptimization due to
|on __errno_location() |__attribute__ ((__const__))
| |on __errno_location()
Target Milestone|--- |4.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42944