From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id 72DF13858031 for ; Thu, 6 Jan 2022 17:13:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 72DF13858031 Received: by mail-wr1-x436.google.com with SMTP id e9so4594350wra.2 for ; Thu, 06 Jan 2022 09:13:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=AvphCuXX9R1bWdrzxTEIhfgN5BoxJJnnp8g+r2mfBpo=; b=syzWP48TLJJFlYQR2XeLKFokVGZwn9fgvgZGhsfW0sIXnd59GpHTVAee3HLFejiEvi KSuzo/HIDejf17tuKcpFdZrPCL8wcZyDXo+Z9diqaCCTOt7vJ3gqacED8vtJ+ORIZ2Nu pyDobcbfjuJPA+5IP2eKgYpm3DFus3I1oYGeU6sNxec8rhhhG+WV1wezXsvpHRwcXRGm Qc7miV1pjg7nlaGyE1LYVmhrlYhxklEcgI834CBR5oOs4A6BgUko1n/OD2VchEdPazVi Zpf/JiEeXVzeYr/lD+9tZc4SCIeByvx+RkUDp6L1w0HBty5imJd4FdmrtuOPkKIAZmea QeeQ== X-Gm-Message-State: AOAM533lIwpyKuDF7Sfboh1WRDR+WKq7pem1b2vhbRqPaQR/N/IEKsle EPb9BOswMAVmbcFiD9MdRhz21r++UWKTmg== X-Google-Smtp-Source: ABdhPJyUN3KFNq+oY8cn6ipCO1aFtWh2Hki7AuavFSDg3lznGnXWAXphyC+rV9rWrNMMFo9l6B9agA== X-Received: by 2002:adf:d1e2:: with SMTP id g2mr52944354wrd.179.1641489188539; Thu, 06 Jan 2022 09:13:08 -0800 (PST) Received: from adacore.com ([45.147.211.82]) by smtp.gmail.com with ESMTPSA id f13sm2791976wri.51.2022.01.06.09.13.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 09:13:07 -0800 (PST) Date: Thu, 6 Jan 2022 17:13:07 +0000 From: Pierre-Marie de Rodat To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [Ada] Simplify type conversions in source pointer arithmetic Message-ID: <20220106171307.GA2921673@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="huq684BweRXVnRxX" Content-Disposition: inline X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2022 17:13:10 -0000 --huq684BweRXVnRxX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Code cleanup; semantics is unaffacted. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_res.adb (Resolve_String_Literal): Simplify pointer arithmetic. --huq684BweRXVnRxX Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="patch.diff" diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -11737,7 +11737,7 @@ package body Sem_Res is Apply_Compile_Time_Constraint_Error (N, "character out of range??", CE_Range_Check_Failed, - Loc => Source_Ptr (Int (Loc) + J)); + Loc => Loc + Source_Ptr (J)); end if; end loop; --huq684BweRXVnRxX--