Thursday, June 27, 2024 10:39 AM
Uros Bizjak <ubiz...@gmail.com> wrote:

> > diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
> > index 5dfa7d49f58..20adb42e17b 100644
> > --- a/gcc/config/i386/i386-expand.cc
> > +++ b/gcc/config/i386/i386-expand.cc
> > @@ -414,6 +414,10 @@ ix86_expand_move (machine_mode mode, rtx
> operands[])
> >   {
> >  #if TARGET_PECOFF
> >    tmp = legitimize_pe_coff_symbol (op1, addend != NULL_RTX);
> > +#else
> > +    tmp = NULL_RTX;
> > +#endif
> > +
> >    if (tmp)
> >      {
> >        op1 = tmp;
> > @@ -425,7 +429,6 @@ ix86_expand_move (machine_mode mode, rtx
> operands[])
> >        op1 = operands[1];
> >        break;
> >      }
> > -#endif
> >   }
> >
> >        if (addend)
> 
> tmp can only be set by legitimize_pe_coff_symbol, so !TARGET_PECOFF
> will always get to the "else" part. Do this change simply by moving
> #endif, like the below:
> 
> --cut here--
> iff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
> index 5dfa7d49f58..407db6c215b 100644
> --- a/gcc/config/i386/i386-expand.cc
> +++ b/gcc/config/i386/i386-expand.cc
> @@ -421,11 +421,11 @@ ix86_expand_move (machine_mode mode, rtx
> operands[])
>                break;
>            }
>          else
> +#endif
>            {
>              op1 = operands[1];
>              break;
>            }
> -#endif
>        }
> 
>       if (addend)
> --cut here--
> 

I would prefer readability in the original version if there are no objections.

> Side note, legitimize_pe_coff_symbol is always called from #if
> TARGET_PECOFF, so:
> 
> rtx
> legitimize_pe_coff_symbol (rtx addr, bool inreg)
> {
>   if (!TARGET_PECOFF)
>     return NULL_RTX;
> 
> should be removed or converted to gcc_assert.
> 

Ok, it will be replaced with gcc_assert.

Regards,
Evgeny

Reply via email to