This is the mail archive of the gcc-patches@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]

Re: [PATCH]: Fix PR tree-optimization/21407


Daniel Berlin wrote:
int main(void)
{
	struct foo a;
	a.a = 5;
	func(&a);
	return 0;
}




One important thing i forgot to point out is that at the tree level, the
above func (&a) turns into

In C, this optimization actually prevents quite a lot of call clobbering
of structure fields that is unnecessary.

But, in my opinion, it is an invalid optimization -- unless you can show that the callee isn't going to look at those fields.


I'd like to understand why you think the code you posted is invalid.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304


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