[Bug optimization/12800] [tree-ssa] Store dropped after cast to pointer from integer of different size

bryner at brianryner dot com gcc-bugzilla@gcc.gnu.org
Sat Nov 29 01:15:00 GMT 2003


------- 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



More information about the Gcc-bugs mailing list