From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4140 invoked by alias); 8 Jun 2012 16:48:48 -0000 Received: (qmail 4130 invoked by uid 22791); 8 Jun 2012 16:48:46 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED,TW_GJ X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 08 Jun 2012 16:48:23 +0000 From: "gjl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug other/53615] Buffer overflow in the compiler? Date: Fri, 08 Jun 2012 16:48:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: other X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gjl at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2012-06/txt/msg00467.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53615 --- Comment #1 from Georg-Johann Lay 2012-06-08 16:48:22 UTC --- Created attachment 27588 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27588 wek.c And here is the source file wek.c Compiled with the above options yields: $ avr-gcc -c wek.c -mmcu=atmega2561 -O3 -mstrict-X wek.c: In function 'foo': wek.c:86:20: error: can't find a register in class 'BASE_POINTER_REGS' while reloading 'asm' wek.c:86:20: error: 'asm' operand has impossible constraints At the beginning of the source you see a macro called CODE32 that is defined to a string literal which is used as inline assembler code template. If CODE32 is defined to a shorter string like #define CODE32 \ ";%2, %C1%1%A0, Z+\n\telpm %B0, Z\n\t" the compiler passes. By all of by understanding such an error should not depend on the length of the inline assembler template. Thus, does this indicates a buffer overflow or missing GTY or similar? Notice that the %-operands / %-operand sequence is unchanged in the shorter version of CODE32.