aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2023-02-13 22:13:32 +0100
committerMarc Poulhiès <poulhies@adacore.com>2023-05-23 09:50:59 +0200
commiteceeb07b21483a1f150cba8d65ef9a762442d2d9 (patch)
tree96deeadded731bbf4114de69b3a12018258ac28a
parent0333af4d174c86cb7b908ac702318f1de7bc6dec (diff)
downloadgcc-eceeb07b21483a1f150cba8d65ef9a762442d2d9.zip
gcc-eceeb07b21483a1f150cba8d65ef9a762442d2d9.tar.gz
gcc-eceeb07b21483a1f150cba8d65ef9a762442d2d9.tar.bz2
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.
-rw-r--r--gcc/ada/exp_ch4.adb8
1 files changed, 0 insertions, 8 deletions
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index f197c2e..70e779d 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -10119,14 +10119,6 @@ package body Exp_Ch4 is
Left_Opnd => Left_Opnd (N),
Right_Opnd => Right_Opnd (N)));
- -- The level of parentheses is useless in GNATprove mode, and
- -- bumping its level here leads to wrong columns being used in
- -- check messages, hence skip it in this mode.
-
- if not GNATprove_Mode then
- Set_Paren_Count (Right_Opnd (Neg), 1);
- end if;
-
if Scope (Ne) /= Standard_Standard then
Set_Entity (Right_Opnd (Neg), Corresponding_Equality (Ne));
end if;