This is the mail archive of the gcc-bugs@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]

[Bug rtl-optimization/75964] insn combiner removes comparison after ABS


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=75964

Georg-Johann Lay <gjl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic

--- Comment #2 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
(In reply to Eric Botcazou from comment #1)
> > After pass .combine, the 2nd comparison is missing, presumably because
> > combiner invokes signed overflow on ABS which does not apply because all
> > computations are performed as unsigned.
> 
> Then you should have a warning with -Wstrict-overflow; this possibly comes
> from simplify-rtx.c:simplify_const_relational_operation in this case.

With -Wstrict-overflow=2 and avr-gcc-6.3 I get

warning: assuming signed overflow does not occur when assuming abs (x) >= 0 is
true [-Wstrict-overflow]

So it's not only wrong code but also wrong diagnostic...

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