This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Optimization of address clause applied to a slice.


The construct  A(Subtype)'Address can be rewritten a A (Lo)'address, because the
address of the slice is the address of it first component. This transformation
is safe and efficient, and supports the use of this construct in an address
clause, even when the type of the underlying array is packed.

See gnat.dg/addr_slice.adb

Tested on i686-pc-linux-gnu, committed on trunk

2008-05-23  Ed Schonberg  <schonberg@adacore.com>

	* sem_attr.adb (Resolve_Attribute, case 'address): If the prefix is a
	slice, convert it to an indexed component, which is equivalent, more
	efficient, and usable even if the slice itself is not addressable.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]