From d6ffddab11ca2ff7ab0defc27a21d61e900e4b02 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Fri, 29 Nov 2019 09:07:53 +0000 Subject: [PATCH] re PR ada/92489 (internal error on Invalid_Value Attribute attribute) PR ada/92489 Backport from mainline 2019-07-01 Ed Schonberg * exp_attr.adb (Expand_Attribute_Reference, case Invalid_Value): Resolve result of call to Get_Simple_Init_Val, which may be a conversion of a literal. From-SVN: r278830 --- gcc/ada/ChangeLog | 10 ++++++++++ gcc/ada/exp_attr.adb | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index e2efd819c042..5464c6b3d686 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,13 @@ +2019-11-29 Eric Botcazou + + PR ada/92489 + Backport from mainline + 2019-07-01 Ed Schonberg + + * exp_attr.adb (Expand_Attribute_Reference, case Invalid_Value): + Resolve result of call to Get_Simple_Init_Val, which may be a + conversion of a literal. + 2019-11-25 Eric Botcazou PR ada/92362 diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb index 22368a19d0b8..cbf7db372ff7 100644 --- a/gcc/ada/exp_attr.adb +++ b/gcc/ada/exp_attr.adb @@ -4242,6 +4242,11 @@ package body Exp_Attr is when Attribute_Invalid_Value => Rewrite (N, Get_Simple_Init_Val (Ptyp, N)); + -- The value produced may be a conversion of a literal, which + -- must be resolved to establish its proper type. + + Analyze_And_Resolve (N); + ---------- -- Last -- ---------- -- 2.47.2