------- Comment #6 from ubizjak at gmail dot com 2007-01-15 08:46 ------- (In reply to comment #2)
> The fact that the index variable is chosen to start with 1 instead of zero is > more interesting. It does not really matter that much, since both > possibilities have exactly the same cost. But the reason is that target > description pretends that the more complicated addressing mode is in fact > cheaper, thus misguiding ivopts to prefer it to the simpler one, if everything > else is equal. I tried to change values in ix86_address_cost() function, and I was able to fix this annoyance. However, gcc regressed in other areas (in some cases, it didn't produce offsets for symbol access) so this isn't proper solution either. Perhaps in case of same cost, should some generic preference be implemented in ivopts to choose "simpler" addressing mode, as simpler addressing modes usually result in smaller code? > -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24669