This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR middle-end/31309


Ian Lance Taylor <iant@google.com> writes:

> 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?

Never mind, I see what you are doing.  Putting an assignment in a
conditional is unnecessarily confusing for the reader.  This patch is
OK if you do something slightly less clever.

Thanks.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]