* [PATCH][PR91749][arm] FDPIC: Handle -mflip-thumb
@ 2019-09-16 13:39 Christophe Lyon
2019-09-16 16:43 ` Ramana Radhakrishnan
0 siblings, 1 reply; 2+ messages in thread
From: Christophe Lyon @ 2019-09-16 13:39 UTC (permalink / raw)
To: gcc Patches; +Cc: Martin Liška
[-- 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;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH][PR91749][arm] FDPIC: Handle -mflip-thumb
2019-09-16 13:39 [PATCH][PR91749][arm] FDPIC: Handle -mflip-thumb Christophe Lyon
@ 2019-09-16 16:43 ` Ramana Radhakrishnan
0 siblings, 0 replies; 2+ messages in thread
From: Ramana Radhakrishnan @ 2019-09-16 16:43 UTC (permalink / raw)
To: Christophe Lyon; +Cc: gcc Patches, Martin Liška
On Mon, Sep 16, 2019 at 2:40 PM Christophe Lyon
<christophe.lyon@linaro.org> wrote:
>
> [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?
OK.
Ramana
>
> Thanks,
>
> Christophe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-09-16 16:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-16 13:39 [PATCH][PR91749][arm] FDPIC: Handle -mflip-thumb Christophe Lyon
2019-09-16 16:43 ` Ramana Radhakrishnan
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).