ada: Remove special-case for parentheses in expansion for GNATprove
commiteceeb07b21483a1f150cba8d65ef9a762442d2d9
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 13 Feb 2023 21:13:32 +0000 (13 22:13 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 23 May 2023 07:50:59 +0000 (23 09:50 +0200)
tree96deeadded731bbf4114de69b3a12018258ac28a
parent0333af4d174c86cb7b908ac702318f1de7bc6dec
ada: Remove special-case for parentheses in expansion for GNATprove

When expanding of inequality operators for GNAT we were adding extra
parens, supposedly to "fix Sprint output" (source print); for GNATprove
we didn't, as these extra parens were leading to wrong columns for check
messages.

Adding these extra parens couldn't be a right, because Sprint should
produce reasonable output regardless of the parens, especially since we
don't care about parens when creating AST in expansion. Avoiding them
for GNATprove couldn't be right either, because source printing should
work regardless of the GNAT/GNATprove mode.

The proper fix for GNAT is rather to not add parens at all and tune
source printing, if necessary. The proper fix for GNATprove is not have
them either, as it confuses the heuristic in First_Sloc, which is then
used by Compute_Sloc.

gcc/ada/

* exp_ch4.adb (Expand_N_Op_Ne): Simply don't add extra parens.
gcc/ada/exp_ch4.adb