From patchwork Mon Sep 16 13:39:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173838 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp3512589ilq; Mon, 16 Sep 2019 06:40:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqzwBdNU7OLD6/RU4dDGpPh7GbpIlhRZ6mOJXf30QFLgJWIN1D7U0+JSyKZCEVGRw9ohdoCG X-Received: by 2002:a17:906:5584:: with SMTP id y4mr42276ejp.89.1568641212363; Mon, 16 Sep 2019 06:40:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568641212; cv=none; d=google.com; s=arc-20160816; b=a7peHgwaSmP4dxG2iW2WyK6JvoSzDMcDxwUZgzR7WRE4w2mMJJmmRZzToSyjwkPQJo cCh5GYbXnTzVM4l9AUS49PUr7PNc/waGL7cOwUcoL/vV4OhEzaFZnaZMEzQzLTcW20xZ cTwLF4j17n28zymWFYinki5PsnK82pWfZlyZTLhoXELvZCX7jCQh8JYXA0ckwW6vQJnr ehY9Nj+WEYqDABu8ouE7y/+ALwrCqM0UvUVA9PVpDi0hfXxYCbH1ZvNXTP/N+2/CSOcl /m/1xNShbQaw+AgqyGDCmSgFudUL+TQy3qs3jQuZx7G4sVs9SWPEz2umaSbjG2vsLa+x Lj7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:mime-version:dkim-signature :delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=TD/NYntYMW9PQlrtImdel4GtVUtCQRFjbAsKdwiftHM=; b=kES5cwVr7BGok5Ac7whnUuLMIGMB3pk+Bxu0Umuq49c6KnTCQTvwa0pz4mden7Zgrg uDNBxHQdAHl+3ESgw0Xnb9EIwLRDVqMnEylbkJGgVByASQmTRF08oWVYjace7+caDPK0 EPv82SZ6uV4xv/AjcuApK5GBJGOk7xFob4NVwtQQ6zrwdI2tAbML0Uku+MzJMw579Mf/ +DLuIPnQNPiGEWAjmhD9urK/bcfV9S1Sw9f63kAQ816oy+Ubku/ORI8+VYdU/HjyUw1Q no/GbUusqOJaPpOqlksEujMRdpK3mp0XYCWHqxL/MOJKgYzV6s5v4OqBHmAzIa2oNnTO VvQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=HaIxI4VD; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=JWRjcahw; spf=pass (google.com: domain of gcc-patches-return-509052-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-509052-patch=linaro.org@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id rs27si19537208ejb.379.2019.09.16.06.40.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Sep 2019 06:40:12 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-509052-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=HaIxI4VD; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=JWRjcahw; spf=pass (google.com: domain of gcc-patches-return-509052-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-509052-patch=linaro.org@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:cc:content-type; q=dns; s=default; b=vOVG37PeHiWz73+SIHEjVhL2ZFJ+R/n1CJrx2+uZ6Y/ tdg03lU/nPtCe8m5DFztbyvVAv7XtElkRbjvJRQiBHs48MnkJ6ZlrmR3BjtwiB9H Vl/OZJaaSlCVgs7sJJv0PYzO8kWhoOzQGYbiE8KR8DVLSXkdH91asBV1n43O67HU = 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 :mime-version:from:date:message-id:subject:to:cc:content-type; s=default; bh=uBxHGLCfazv64Z8Kx5sbS6yt5iI=; b=HaIxI4VD2tiErnJVk awxmOpCm7XNrfWZbTxJSO3kmQ/vjMtW1TuNbnP87pXwXLpnI0Otoi/OKLwj9ro2B JGFEhki2hwxk7d/MpPLYwuuGJaJEwxyP3KENa4qh6ueAbRRgdX1dzivA5Qmmcy2w vZ3txTsFThewj7XhEnSTvwq6zc= Received: (qmail 101661 invoked by alias); 16 Sep 2019 13:39:59 -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 101652 invoked by uid 89); 16 Sep 2019 13:39:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=resending, re-sending X-HELO: mail-lf1-f52.google.com Received: from mail-lf1-f52.google.com (HELO mail-lf1-f52.google.com) (209.85.167.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 16 Sep 2019 13:39:55 +0000 Received: by mail-lf1-f52.google.com with SMTP id r2so9475168lfn.8 for ; Mon, 16 Sep 2019 06:39:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:from:date:message-id:subject:to:cc; bh=Vwt4mluWnF2zwH6IL4ISAzN4j0jvJW9N9r1ujlTUL00=; b=JWRjcahwflNdeTNByEMVScPGzv/PZpmRTzi+kZApSq3S+Bpr02ZKWDcSg5PgUakSQ/ 9pLIK9OPrexDB3RkjwLFvhvyrDGuWqq050Z9Zz1fsiV+N1YKdVv9It+GnxP331b9/YcG XfQR9aLf2wZDGbWr6UMZdnzkhguZmJuoADsSLfZBosuS2Ew0TcQzvpSBBHktUE52TxEi n17toC/+FRv9ore6PSTYv3Ld36vKm5kAiFX7m5drbFCPnPvYVeH2j2Oi5l8/cFW97JZq GtK0I+CSzAr3cp3xm8q7xIz4uTb4SMoVCVGGHQG9d2oCqkwJhAkYgIk+8vTPczUwIAzx eP3Q== MIME-Version: 1.0 From: Christophe Lyon Date: Mon, 16 Sep 2019 15:39:42 +0200 Message-ID: Subject: [PATCH][PR91749][arm] FDPIC: Handle -mflip-thumb To: gcc Patches Cc: =?utf-8?q?Martin_Li=C5=A1ka?= X-IsSubscribed: yes [Re-sending in plain text-mode, sorry for the duplicates] Hi, In PR91749, we have ICEs because -mflip-thumb switches to Thumb-1 (the default target cpu does not support Thumb-2). Although we already filter this in arm_configure_build_target, we forgot to handle cases when the mode is changed via attributes (either in the source code, or via -mflip-thumb). This patch adds the same error message when trying to apply the "thumb" attribute and the target does not support Thumb-2 (only if we are in FDPIC mode, of course). OK? Thanks, Christophe gcc/ChangeLog: 2019-09-16 Christophe Lyon PR target/91749 * config/arm/arm.c (arm_valid_target_attribute_rec): Make sure the mode attributed is supported by FDPIC. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index c452771..ceabe0a 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -31175,7 +31175,11 @@ arm_valid_target_attribute_rec (tree args, struct gcc_options *opts) { argstr = NULL; if (!strcmp (q, "thumb")) - opts->x_target_flags |= MASK_THUMB; + { + opts->x_target_flags |= MASK_THUMB; + if (TARGET_FDPIC && !arm_arch_thumb2) + sorry ("FDPIC mode is not supported in Thumb-1 mode"); + } else if (!strcmp (q, "arm")) opts->x_target_flags &= ~MASK_THUMB;