The avr target gives that alignment warning for every polymorphic class, because it doesn't define TARGET_VTABLE_ENTRY_ALIGN, which means the default kicks in, which is the size of a pointer. Since the AVR as an 8 bit platform has no alignment requirements, BIGGEST_ALIGNMENT is 8, which is less than the pointer size. The fix is trivial. A patch against trunk follows: Index: gcc/config/avr/avr.h =================================================================== --- gcc/config/avr/avr.h (revision 116509) +++ gcc/config/avr/avr.h (working copy) @@ -94,6 +94,7 @@ /* No data type wants to be aligned rounder than this. */ #define BIGGEST_ALIGNMENT 8 +#define TARGET_VTABLE_ENTRY_ALIGN 8 #define STRICT_ALIGNMENT 0
Confirmed, can you send your patch to gcc-patches@ as mentioned on http://gcc.gnu.org/contribute.html With all the requested information with the email as requested by that page.
Subject: Bug 28902 Author: aesok Date: Mon Sep 3 20:35:10 2007 New Revision: 128059 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128059 Log: PR target/28902 * config/avr/avr.h (TARGET_VTABLE_ENTRY_ALIGN): Define. Modified: trunk/gcc/ChangeLog trunk/gcc/config/avr/avr.h
Subject: Bug 28902 Author: aesok Date: Mon Sep 3 21:03:50 2007 New Revision: 128060 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128060 Log: PR target/28902 * config/avr/avr.h (TARGET_VTABLE_ENTRY_ALIGN): Define. Modified: branches/gcc-4_2-branch/gcc/ChangeLog branches/gcc-4_2-branch/gcc/config/avr/avr.h
Fixed.