------- Comment #4 from ubizjak at gmail dot com 2010-04-17 15:11 ------- (In reply to comment #3) > Works with x86-64. > > Checking -m32, the same thing happens with or without the patch:
This happens because combine pulls memory references into the combined address operand. Since ix86_decompose_address expects registers everywhere, it fails. The same happens with: int * p(int *a, int i) { return &a[i]; } So, this particular case is unfixable on -m32. Try with -mregparm=3. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43766