From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15529 invoked by alias); 29 Nov 2012 14:13:13 -0000 Received: (qmail 15411 invoked by uid 48); 29 Nov 2012 14:12:54 -0000 From: "amylaar at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/55523] gencondmd C++ conversion breaks peephole2 predicates use of get_attr_* Date: Thu, 29 Nov 2012 14:13:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: build X-Bugzilla-Severity: normal X-Bugzilla-Who: amylaar 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-11/txt/msg02882.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55523 --- Comment #3 from Jorn Wolfgang Rennecke 2012-11-29 14:12:53 UTC --- (In reply to comment #2) > Yeah, either you'd need to provide prototype for the function in > epiphany-protos.h, or you shouldn't include those calls in the condition of the > peephole2, but instead in the C sequence do if (!get_attr_*) FAIL; > Including insn-attr.h in the generated gencondmd.c is not an option, that would > be a cyclic dependency (as insn-attr.h generation depends on insn-conditions.md > and insn-conditions.md generation depends on gencondmd.c compilation and that > would need to depend on insn-attr.h). Well, I do declare the get_attr_* function in epiphany-protos.h for now, but I think that's a rather ugly work around. I have to duplicate an auto-generated prototype. And writing an identity wrapper for a generated function and then providing a prototype for the wrapper function isn't really making things any simpler. There is no fundamental reason why we can't generate the get_attr_* prototypes before compiling gencondmd, this is just an artifact of how we structured the generator programs. I suppose using FAIL would solve the dependency issue, but I'm never quite sure what that means. In the context of expanders, it sometimes causes (caused?) ICEs. The documentation gives a list of specific instruction patterns that support FAIL, but doesn't mention peephole2 in this context. Will a recognized-but-FAILed peephole2 cause different decisions on if, an if so, which, other peephole2 patterns can match?