From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19154 invoked by alias); 2 Jun 2014 11:29:45 -0000 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 Received: (qmail 19119 invoked by uid 48); 2 Jun 2014 11:29:42 -0000 From: "scovich at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug inline-asm/49611] Inline asm should support input/output of flags Date: Mon, 02 Jun 2014 11:29:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: inline-asm X-Bugzilla-Version: 4.5.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: scovich at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-06/txt/msg00069.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49611 --- Comment #9 from Ryan Johnson --- (In reply to Andi Kleen from comment #7) > You can do many of these things these days with asm goto, however it > typically requires non-structured control flow (goto labels). I filed this bug after determining that asm goto was unsuitable for this purpose. Goto labels are not a problem per se (actually kind of slick), but asm goto requires all outputs to pass through memory and so is only good for control flow (not computation plus exceptional case). It also requires the actual branching and all attendant glue to happen in assembly. Both limitations increase bulk and hamper the optimizer, and go against (what I thought was) the intention that inline asm normally be used for very small snippets of code the compiler can't handle. At some point you may as well just setcc and do a new comparison/branch outside the asm block; less bug-prone and would probably yield faster and cleaner code, too.