This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR middle-end/31309
- From: Ian Lance Taylor <iant at google dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 10 Jan 2008 22:14:28 -0800
- Subject: Re: [PATCH] Fix PR middle-end/31309
- References: <200801102347.18797.ebotcazou@adacore.com>
Eric Botcazou <ebotcazou@adacore.com> writes:
> + enum machine_mode copy_mode;
>
> if (tgtblk == 0)
> {
> @@ -2149,11 +2150,19 @@ copy_blkmode_from_reg (rtx tgtblk, rtx s
> padding_correction
> = (BITS_PER_WORD - ((bytes % UNITS_PER_WORD) * BITS_PER_UNIT));
>
> - /* Copy the structure BITSIZE bites at a time.
> + /* Copy the structure BITSIZE bits at a time. If the target lives in
> + memory, take care of not reading/writing past its end by selecting
> + a copy mode suited to BITSIZE. This should always be possible given
> + how it is computed.
>
> We could probably emit more efficient code for machines which do not use
> strict alignment, but it doesn't seem worth the effort at the current
> time. */
> +
> + if (!MEM_P (tgtblk)
> + || ((copy_mode = mode_for_size (bitsize, MODE_INT, 1)) == BLKmode))
> + copy_mode = word_mode;
I don't see anything setting copy_mode if this condition is false. Am
I missing something?
Ian