This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/15438] [3.5 Regression] miscompilation with attribute (__malloc__)


------- Additional Comments From belyshev at lubercy dot com  2004-05-15 16:25 -------
Created an attachment (id=6305)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6305&action=view)
testcase (223 bytes)

I think this one clarifies situation:

cat > bug.i << EOF
int a;

void __attribute__ ((malloc)) *foo ()
{
	a = 1;
}

int main (void)
{
	int *p = &a;
	*p = 0;
	foo ();
	if (!*p)
		abort ();
	return 0;
}
EOF
gcc bug.i -O
./a.out
Aborted


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
Attachment #6287 is|0                           |1
           obsolete|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15438


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]