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]

Re: ifcvt.c and STORE_FLAG_VALUE


Philippe De Muyter wrote:
> 
> Bootstrapping on m68k-motorola-sysv yields also the following failure:
> 
> cc -c  -DIN_GCC    -g   -DHAVE_CONFIG_H    -I. -I/gcc -I/gcc/config -I/gcc/../include /gcc/ifcvt.c
> "/gcc/ifcvt.c", line 519: illegal lhs of assignment operator
> "/gcc/ifcvt.c", line 557: illegal lhs of assignment operator
> "/gcc/ifcvt.c", line 640: illegal lhs of assignment operator
> 
> That happens with -STORE_FLAG_VALUE when STORE_FLAG_VALUE is defined as -1

> I thought to define it as (-1), but as it it tested in preprocessor
> expressions for equality with -1, I did not dare to do that.

Sorry if I'm being dense, but the brackets in the macro definition
don't look like a courageous step to me.

Presumably you agree that normally we should have the brackets
in the definition, rather than hacking the point of use, but you
perhaps know of a preprocessor where this would break ?

Regards,

John.

>  My proposed fix
> is below.  OK to commit ?
> 
> Philippe De Muyter  <phdm@macqel.be>
> 
>         * ifcvt.c (noce_try_store_flag_constants): Do not negate
>         STORE_FLAG_VALUE.
[...]
> -      if (diff == STORE_FLAG_VALUE || diff == -STORE_FLAG_VALUE)
> +      if (diff == STORE_FLAG_VALUE || -diff == STORE_FLAG_VALUE)

Michael Meissner wrote:
> 
> Yes it is ok to commit, providing you put in a comment of why this is being
> done, or possibly change the line to:
> 
>         if (diff == STORE_FLAG_VALUE || diff == -(STORE_FLAG_VALUE))

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