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]

Re: Resend: reorder conditionals in i386.md


On Tue, 7 Aug 2001, Zack Weinberg wrote:

> The interesting cases are more of the form
> 
> 	if (expensive_test (operands[0]) && 0)
> 
> where the compiler cannot eliminate the call to expensive_test because
> it might have side effects.  We know better.

This sounds like a case for adding a __pure__ attribute to expensive_test,
as in <URL:http://gcc.gnu.org/ml/gcc-patches/1999-08n/msg00601.html>
(which reported 150kb compiler size reduction).  (Though I don't know
whether the compiler could optimise this case once the attribute is
given.)

-- 
Joseph S. Myers
jsm28@cam.ac.uk


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