From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joern Rennecke To: jvickers@acorn.com (John Vickers) Cc: egcs@cygnus.com Subject: Re: Was: Re: Loop optimizer misses simple optimisation? Date: Wed, 06 May 1998 11:36:00 -0000 Message-id: <199805061729.SAA25923@phal.cygnus.co.uk> References: X-SW-Source: 1998-05/msg00201.html > int a, b, c, d; > ... > c = b / c; > d = b % c; > > becomes: > > c = a / b; > d = a - c * b; This would have to depend on the cost of the modulo operation - and if b is constant or can be made constant by constant-propagation, this also ight make a difference to the cost.