From patchwork Sat Jun 14 07:49:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 359757 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1A2BC140096 for ; Sat, 14 Jun 2014 17:49:32 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; q=dns; s=default; b=W5hue0ZWIXlcpyMP 9PeZO0hmhnSj0vpVA0Cm845M2S+88fhdPmegcGSLJRicbM/tp6gy8LWaE+diLdVF 71NRn6C+RzVYhDbU3va58sC60T90vd8nAOG4r1P0e7dXY7qEflfAHtei9SOLuzZR IMPXLPWneRiNgPmiCJ0rzo4Wsp4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; s=default; bh=Pp7UywEFyaJ/DHvXGysEyi c0FlM=; b=t/kg3/vrdj6dSBIa0fDHi0sURCcZxO7ygkKVDtzo0bYlbdzjaskgFo /lffN0EK+8VgPwuOPWd0quna3JSUiNjCkswyzj/G9D1Va7WUSGDC15YJOA/M0PyL /gH3FkoECjwIEA3oWuDeIDOeTU4R97YplS+L/SavjKpfthIyYl5sQ= Received: (qmail 4418 invoked by alias); 14 Jun 2014 07:49:24 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 4408 invoked by uid 89); 14 Jun 2014 07:49:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, MEDICAL_SUBJECT, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-we0-f171.google.com Received: from mail-we0-f171.google.com (HELO mail-we0-f171.google.com) (74.125.82.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 14 Jun 2014 07:49:22 +0000 Received: by mail-we0-f171.google.com with SMTP id q58so3720476wes.16 for ; Sat, 14 Jun 2014 00:49:19 -0700 (PDT) X-Received: by 10.194.243.104 with SMTP id wx8mr10710197wjc.32.1402732159793; Sat, 14 Jun 2014 00:49:19 -0700 (PDT) Received: from localhost ([2.26.169.52]) by mx.google.com with ESMTPSA id i8sm1425702wiw.22.2014.06.14.00.49.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Jun 2014 00:49:18 -0700 (PDT) From: Richard Sandiford To: Steve Ellcey Mail-Followup-To: Steve Ellcey , , rdsandiford@googlemail.com Cc: Subject: Re: [PATCH 8/8] Add a common .md file and define standard constraints there References: <878up3peii.fsf@talisman.default> <1402689965.17245.42.camel@ubuntu-sellcey> Date: Sat, 14 Jun 2014 08:49:12 +0100 In-Reply-To: <1402689965.17245.42.camel@ubuntu-sellcey> (Steve Ellcey's message of "Fri, 13 Jun 2014 13:06:05 -0700") Message-ID: <87fvj8ue13.fsf@talisman.default> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Steve Ellcey writes: > Richard, > > Something in these constraint patches broke my mips16 build (I cannot > build glibc in mips16 mode). I have cut down a test case and verified > that the problem started with this checkin: > > 2014-06-11 Richard Sandiford > > * common.md: New file. > * doc/md.texi: Update description of generic, machine-independent > constraints. > * config/s390/constraints.md (e): Delete. > * Makefile.in (md_file): Include common.md. > * config/m32c/t-m32c (md_file): Likewise. > * genpreds.c (general_mem): New array. > (etc) > > Attached is a small test case (its ugly but it comes from vfscanf in glibc) that > fails to compile for me with these options: > > -mips32r2 -mips16 -mabi=32 -std=gnu99 -fgnu89-inline -O2 -c x.c > > Error message: > > /tmp/ccAltddb.s: Assembler messages: > /tmp/ccAltddb.s:23: Error: invalid operands `sb $3,24($sp)' The problem here is that mips_regno_mode_ok_for_base_p allows invalid hard registers as bases if !strict_p. It was always a bit of a hack and the reason it was added no longer applies. Robert's LRA patch already included a fix, so maybe we should just apply that part now. The patch below fixes the testcase. Please could you give it a spin and see whether there's any other fallout? I assume this would have shown up in a testsuite run if you'd been able to get that far. Thanks, Richard 2014-03-26 Robert Suchanek * config/mips/mips.c (mips_regno_mode_ok_for_base_p): Remove use !strict_p for MIPS16. l diff --git gcc/config/mips/mips.c gcc/config/mips/mips.c index 45256e9..81b6c26 100644 --- gcc/config/mips/mips.c +++ gcc/config/mips/mips.c @@ -2241,22 +2241,9 @@ mips_regno_mode_ok_for_base_p (int regno, enum machine_mode mode, return true; /* In MIPS16 mode, the stack pointer can only address word and doubleword - values, nothing smaller. There are two problems here: - - (a) Instantiating virtual registers can introduce new uses of the - stack pointer. If these virtual registers are valid addresses, - the stack pointer should be too. - - (b) Most uses of the stack pointer are not made explicit until - FRAME_POINTER_REGNUM and ARG_POINTER_REGNUM have been eliminated. - We don't know until that stage whether we'll be eliminating to the - stack pointer (which needs the restriction) or the hard frame - pointer (which doesn't). - - All in all, it seems more consistent to only enforce this restriction - during and after reload. */ + values, nothing smaller. */ if (TARGET_MIPS16 && regno == STACK_POINTER_REGNUM) - return !strict_p || GET_MODE_SIZE (mode) == 4 || GET_MODE_SIZE (mode) == 8; + return GET_MODE_SIZE (mode) == 4 || GET_MODE_SIZE (mode) == 8; return TARGET_MIPS16 ? M16_REG_P (regno) : GP_REG_P (regno); }