From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24240 invoked by alias); 13 Apr 2010 08:15:54 -0000 Received: (qmail 24133 invoked by uid 48); 13 Apr 2010 08:15:33 -0000 Date: Tue, 13 Apr 2010 08:15:00 -0000 Subject: [Bug c++/43745] New: g++ puts VTABLES in SRAM X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "tfrancuz at mp dot pl" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-04/txt/msg01269.txt.bz2 On AVR target g++ generates code which copies object’s VTABLES from FLASH to SRAM wasting the memory. Due to the Harvard architecture of AVR processors the solution is not trivial. This behavior can be observed in any c++ program which has object with virtual method, e.g: Class test { virtual void example(); }; The VTABLE of class test will be generated in FLASH and next copied to SRAM, any reference to virtual example() method will take the method address from SRAM. -- Summary: g++ puts VTABLES in SRAM Product: gcc Version: 4.3.5 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tfrancuz at mp dot pl http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43745