public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Christophe Lyon <christophe.lyon@linaro.org>
To: gcc Patches <gcc-patches@gcc.gnu.org>
Cc: "Martin Liška" <mliska@suse.cz>
Subject: [PATCH][PR91749][arm] FDPIC: Handle -mflip-thumb
Date: Mon, 16 Sep 2019 13:39:00 -0000	[thread overview]
Message-ID: <CAKdteOZi-T-krNjfmCLtt2S61=KqDGLhYB3PJ61ozjtr4xgM3Q@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 553 bytes --]

[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

[-- Attachment #2: fdpic-flip-thumb.chlog.txt --]
[-- Type: text/plain, Size: 201 bytes --]

gcc/ChangeLog:

2019-09-16  Christophe Lyon  <christophe.lyon@linaro.org>

	PR target/91749
	* config/arm/arm.c (arm_valid_target_attribute_rec): Make sure the
	mode attributed is supported by FDPIC.


[-- Attachment #3: fdpic-flip-thumb.patch.txt --]
[-- Type: text/plain, Size: 563 bytes --]

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;

             reply	other threads:[~2019-09-16 13:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-16 13:39 Christophe Lyon [this message]
2019-09-16 16:43 ` Ramana Radhakrishnan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKdteOZi-T-krNjfmCLtt2S61=KqDGLhYB3PJ61ozjtr4xgM3Q@mail.gmail.com' \
    --to=christophe.lyon@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mliska@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).