From: Eric Botcazou Date: Wed, 30 Aug 2017 19:09:16 +0000 (+0000) Subject: * varasm.c (decode_addr_const): Deal with INDIRECT_REF . X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=02d548063dec05650364fed2369d8f7d94c48fd8;p=gcc.git * varasm.c (decode_addr_const): Deal with INDIRECT_REF . From-SVN: r251545 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 37d888fa039..c797558849c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2017-08-30 Eric Botcazou + + * varasm.c (decode_addr_const): Deal with INDIRECT_REF . + 2017-08-30 Pat Haugen * config/rs6000/rs6000.c (rs6000_emit_prologue_move_from_cr): Rename from diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 331b6dd29f8..0fab4d4702a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2017-08-30 Eric Botcazou + + * gnat.dg/aggr22.ad[sb]: New test. + 2017-08-30 Pat Haugen * gcc.target/powerpc/cr_shrink-wrap.c: New. diff --git a/gcc/testsuite/gnat.dg/aggr22.adb b/gcc/testsuite/gnat.dg/aggr22.adb new file mode 100644 index 00000000000..a9eb2e700b6 --- /dev/null +++ b/gcc/testsuite/gnat.dg/aggr22.adb @@ -0,0 +1,14 @@ +-- { dg-do compile } + +package body Aggr22 is + + type Ptr is access all Integer; + type Arr is array (Positive range <>) of Ptr; + + procedure Proc is + A : Arr (1 .. 33); + begin + A := (1 => null, 2 .. 32 => My_Rec.I'Access, 33 => null); + end; + +end Aggr22; diff --git a/gcc/testsuite/gnat.dg/aggr22.ads b/gcc/testsuite/gnat.dg/aggr22.ads new file mode 100644 index 00000000000..4fe86db3e90 --- /dev/null +++ b/gcc/testsuite/gnat.dg/aggr22.ads @@ -0,0 +1,16 @@ +with System; + +package Aggr22 is + + type Rec is record + C : Character; + I : aliased Integer; + end record; + + My_Rec : aliased Rec; + pragma Import (Ada, My_Rec); + for My_Rec'Address use System'To_Address (16#40086000#); + + procedure Proc; + +end Aggr22; diff --git a/gcc/varasm.c b/gcc/varasm.c index adf99fb717a..e5393377a43 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -2924,6 +2924,13 @@ decode_addr_const (tree exp, struct addr_const *value) x = output_constant_def (target, 1); break; + case INDIRECT_REF: + /* This deals with absolute addresses. */ + offset += tree_to_shwi (TREE_OPERAND (target, 0)); + x = gen_rtx_MEM (QImode, + gen_rtx_SYMBOL_REF (Pmode, "origin of addresses")); + break; + default: gcc_unreachable (); }