r274303 - in /trunk/gcc: ada/ChangeLog ada/exp_...

pmderodat@gcc.gnu.org pmderodat@gcc.gnu.org
Mon Aug 12 09:07:00 GMT 2019


Author: pmderodat
Date: Mon Aug 12 09:01:33 2019
New Revision: 274303

URL: https://gcc.gnu.org/viewcvs?rev=274303&root=gcc&view=rev
Log:
[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.

Added:
    trunk/gcc/testsuite/gnat.dg/slice10.adb
Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/exp_ch4.adb
    trunk/gcc/ada/exp_ch6.adb
    trunk/gcc/ada/exp_util.adb
    trunk/gcc/testsuite/ChangeLog



More information about the Gcc-cvs mailing list