This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/12800] [tree-ssa] Store dropped after cast to pointer from integer of different size
- From: "bryner at brianryner dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Nov 2003 01:15:20 -0000
- Subject: [Bug optimization/12800] [tree-ssa] Store dropped after cast to pointer from integer of different size
- References: <20031028001552.12800.falk@debian.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bryner at brianryner dot com 2003-11-29 01:15 -------
I think this problem, or something similar, occurs even when the pointer and
integer are the same size:
int*
allocint()
{
unsigned long p = malloc(sizeof(int));
int *i = (int *) p;
if (!i)
return NULL;
*i = 1;
return i;
}
does not store to *i before returning on x86, where sizeof(unsigned long) ==
sizeof(int*).
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |bryner at brianryner dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12800