aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2019-08-12 09:01:33 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-08-12 09:01:33 +0000
commit009070260dd9ac941d30b119638a6f3839eb2e6b (patch)
treeb23510c1664e59ed694e7ecd7a92ff0171fe8549 /gcc/tree.c
parentad430786085ad3e5fee751414799d8ccae60fbc3 (diff)
downloadgcc-009070260dd9ac941d30b119638a6f3839eb2e6b.zip
gcc-009070260dd9ac941d30b119638a6f3839eb2e6b.tar.gz
gcc-009070260dd9ac941d30b119638a6f3839eb2e6b.tar.bz2
[Ada] Fix internal error on comparison of unaligned slices
This fixes an internal error in the code generator when it is trying to take the address of a slice which does not start on a byte boundary, in order to generate a comparison between slices with a dynamic length. This case is not supported by the code generator and comes from an explicit representation clause on a record type, so it must be detected and handled by the front-end by expanding the comparison on an element-by-element basis. 2019-08-12 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * exp_ch4.adb (Expand_N_Op_Eq): Expand the array equality if either operand is a possibly unaligned slice. * exp_ch6.adb (Expand_Simple_Function_Return): Do not generate a copy for a possibly unaligned object if it is represented as a scalar. * exp_util.adb (Is_Possibly_Unaligned_Slice): Do not always return false if the target doesn't have strict alignment. gcc/testsuite/ * gnat.dg/slice10.adb: New testcase. From-SVN: r274303
Diffstat (limited to 'gcc/tree.c')
0 files changed, 0 insertions, 0 deletions