From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11817 invoked by alias); 19 May 2003 17:53:21 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 11755 invoked by uid 48); 19 May 2003 17:53:20 -0000 Date: Mon, 19 May 2003 17:53:00 -0000 Message-ID: <20030519175320.11753.qmail@sources.redhat.com> To: berndtrog@yahoo.com, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org From: ehrhardt@mathematik.uni-ulm.de Reply-To: ehrhardt@mathematik.uni-ulm.de, berndtrog@yahoo.com, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: inline-asm/10857: Inlining a function with inline-asm: "error: impossible constraint in `asm'" X-SW-Source: 2003-05/txt/msg02102.txt.bz2 List-Id: Synopsis: Inlining a function with inline-asm: "error: impossible constraint in `asm'" State-Changed-From-To: closed->open State-Changed-By: cae State-Changed-When: Mon May 19 17:53:20 2003 State-Changed-Why: Reopened based on submitter's comment. This is rejected by 3.3 at all optimization levels. I still don't think this should compile but previous versions of gcc accepted it. An arch independant example is below. Could someone please clarify if this supposed to compile at e.g. -S -O3? ----------------- cut ------------------------------- #define PORTD 0x12 static void write_byte(unsigned char adr, unsigned char data ) { __asm__ ("blah %0" : : "i" (adr)); } int main(void) { write_byte( PORTD, 4); return 0; } ----------------- cut ------------------------------- Both gcc-3.2 and older versions of gcc-3.4 accepted this if optimization level was high enough. It is rejected by gcc 3.3 nomatter what. Note that __builtin_constant_p (adr) holds for the inlined copy of write_byte. The patch the prevented this from compiling at -O3 went into gcc-3.4 between 20030331 and 20030519. regards Christian http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10857