* [Ada] Fix ICE on component of complex as Out parameter
@ 2015-12-20 10:38 Eric Botcazou
0 siblings, 0 replies; only message in thread
From: Eric Botcazou @ 2015-12-20 10:38 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 510 bytes --]
This is a regression present on the mainline only, a small oversight in the
overhaul of the implementation of renaming.
Tested on x86_64-suse-linux, applied on the mainline.
2015-12-20 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils2.c (gnat_rewrite_reference) <REALPART_EXPR>: New
case identical to FLOAT_EXPR.
<IMAGPART_EXPR>: Likewise.
2015-12-20 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/complex1.adb: New test.
* gnat.dg/complex1_pkg.ads: New helper.
--
Eric Botcazou
[-- Attachment #2: p.diff --]
[-- Type: text/x-patch, Size: 432 bytes --]
Index: gcc-interface/utils2.c
===================================================================
--- gcc-interface/utils2.c (revision 231856)
+++ gcc-interface/utils2.c (working copy)
@@ -2664,6 +2664,8 @@ gnat_rewrite_reference (tree ref, rewrit
CASE_CONVERT:
case FLOAT_EXPR:
case FIX_TRUNC_EXPR:
+ case REALPART_EXPR:
+ case IMAGPART_EXPR:
case VIEW_CONVERT_EXPR:
result
= build1 (code, type,
[-- Attachment #3: complex1.adb --]
[-- Type: text/x-adasrc, Size: 195 bytes --]
-- { dg-do compile }
with Ada.Numerics.Complex_types; use Ada.Numerics.Complex_types;
with Complex1_Pkg; use Complex1_Pkg;
procedure Complex1 is
Z : Complex;
begin
Coord (Z.Re, Z.Im);
end;
[-- Attachment #4: complex1_pkg.ads --]
[-- Type: text/x-adasrc, Size: 81 bytes --]
package Complex1_Pkg is
procedure Coord (x,y : out Float);
end Complex1_Pkg;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-12-20 10:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-20 10:38 [Ada] Fix ICE on component of complex as Out parameter Eric Botcazou
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).