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] |
Tested on x86-linux, committed on mainline. Previously, warnings were generated only if an object address violated an explicit alignment constraint put on the object itself. In some cases, this new check allows the compiler not to generate a run time check as it knows that the object is correctly aligned. test case: $ gcc -c test_alignment.ads test_alignment.ads:6:65: warning: specified address for "Y" not consistent with alignment (RM 13.3(27)) -- with System.Storage_Elements; package Test_Alignment is type T is new Integer; for T'Alignment use 8; X : T; for X'Address use System.Storage_Elements.To_Address (32); Y : T; for Y'Address use System.Storage_Elements.To_Address (33); end Test_Alignment; 2005-01-03 Samuel Tardieu <tardieu@adacore.com> * checks.adb (Apply_Alignment_Check): Generate a warning if an object address is incompatible with its base type alignment constraints when this can be decided statically.
Attachment:
difs.5
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |