public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Giuliano Belinassi <giulianob@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/autopar_devel] [Ada] Fix host/target confusion for attribute To_Address Date: Sat, 22 Aug 2020 22:48:27 +0000 (GMT) [thread overview] Message-ID: <20200822224827.F1892393C831@sourceware.org> (raw) https://gcc.gnu.org/g:668d318f9f91a226c20f7c6bce14a4e36212e1ef commit 668d318f9f91a226c20f7c6bce14a4e36212e1ef Author: Eric Botcazou <ebotcazou@adacore.com> Date: Thu Apr 23 16:22:28 2020 +0200 [Ada] Fix host/target confusion for attribute To_Address 2020-06-18 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * sem_attr.adb (Analyze_Attribute) <To_Address>: Use the address size of the target instead of the host when checking the value of a static expression. Also use standard idiom for exponentiation. Diff: --- gcc/ada/sem_attr.adb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index d444b9f1c9d..80451937715 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -6274,9 +6274,9 @@ package body Sem_Attr is if Is_OK_Static_Expression (E1) then Val := Expr_Value (E1); - if Val < -(2 ** UI_From_Int (Standard'Address_Size - 1)) + if Val < -(Uint_2 ** (System_Address_Size - 1)) or else - Val > 2 ** UI_From_Int (Standard'Address_Size) - 1 + Val > Uint_2 ** System_Address_Size - 1 then Error_Attr ("address value out of range for % attribute", E1); end if; @@ -6293,7 +6293,7 @@ package body Sem_Attr is elsif Val < 0 then Set_Etype (E1, Universal_Integer); - -- Otherwise set type to Unsigned_64 to accommodate max values + -- Otherwise set type to Unsigned_64 to accommodate large values else Set_Etype (E1, Standard_Unsigned_64);
reply other threads:[~2020-08-22 22:48 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20200822224827.F1892393C831@sourceware.org \ --to=giulianob@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).