This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/36775] Incorrect code generated - value tested before it is set.
- From: "schwab at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Jul 2008 21:30:37 -0000
- Subject: [Bug middle-end/36775] Incorrect code generated - value tested before it is set.
- References: <bug-36775-16442@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from schwab at suse dot de 2008-07-09 21:30 -------
extern __inline__ errcode_t ext2fs_get_mem(unsigned long size, void *ptr)
{
void **pp = (void **)ptr;
*pp = malloc(size);
[...]
}
[...]
{
ext2_u32_list bb;
errcode_t retval;
retval = ext2fs_get_mem(sizeof(struct ext2_struct_u32_list), &bb);
This is writing a value of type void* through a pointer to a different type
(ext2_u32_list).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36775