Fix PR rtl-optimization/33822
Wed Dec 19 10:44:00 GMT 2007
Thanks for the review, now applied.
Eric Botcazou <firstname.lastname@example.org> writes:
> Btw, could we do something clever for the many similar calculations in
> alter_subreg and simplify_subreg (and maybe elsewhere):
> /* The SUBREG_BYTE represents offset, as if the value were stored
> in memory. Irritating exception is paradoxical subreg, where
> we define SUBREG_BYTE to be 0. On big endian machines, this
> value should be negative. For a moment, undo this exception. */
> if (byte == 0 && GET_MODE_SIZE (innermode) < GET_MODE_SIZE (outermode))
> int difference = (GET_MODE_SIZE (innermode) - GET_MODE_SIZE (outermode));
> if (WORDS_BIG_ENDIAN)
> final_offset += (difference / UNITS_PER_WORD) * UNITS_PER_WORD;
> if (BYTES_BIG_ENDIAN)
> final_offset += difference % UNITS_PER_WORD;
TBH, I don't think the alter_subreg code should exist at all.
It implies that simplify_subreg is being too strict or that
reload is being too lax.
I'd rather get rid of the alter_subreg code (definitely not 4.3
material!) and fix any fallout. Introducing a new function for the
above smacks too much of simplify_subreg_this_time_i_really_mean_it.
More information about the Gcc-patches