From mboxrd@z Thu Jan 1 00:00:00 1970 From: "David S. Miller" To: tege@pdc.kth.se Cc: egcs@cygnus.com Subject: Re: This was fun to track down Date: Tue, 23 Sep 1997 14:16:00 -0000 Message-id: <199709232112.RAA03740@jenolan.rutgers.edu> References: <199709232053.WAA03509@squid.pdc.kth.se> X-SW-Source: 1997-09/msg00890.html Date: Tue, 23 Sep 1997 22:53:47 +0200 From: Torbjorn Granlund 1. It seems strange that convert_modes put a constant into a register. Maybe that is a bug. 2. If convert_modes is really right, the proper fix to expand_divmod would be to avoid calling it when op1 is constant. What if you are computing an offset from a Pmode ptr (which is the case in the test case I just sent to this list) and the CONST_INT is _negative_ and of a smaller mode than Pmode, and the CONST_INT is SImod and Pmode is DImode (32 and 64 bits respecticaly) on a 64-bit target? So I don't see convert_modes() as doing anything wrong, if anything you could say at best that it is missing an optimization opportunity, for the case when the CONST_INT is not negative. For "2" I say that your suggestion is just moving an optimization into expand_divmod() which really belongs in convert_modes(). And for the "CONST_INT and negative" case your suggestion would generate incorrect code on certain targets. Later, David "Sparc" Miller davem@caip.rutgers.edu