From: Sandra Loosemore <sandra@codesourcery.com>
To: Kyrill Tkachov <kyrylo.tkachov@foss.arm.com>,
Mike Stump <mikestump@comcast.net>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [patch, testsuite, arm] Fix ICE in gcc.dg/gimplefe-28.c
Date: Mon, 23 Sep 2019 03:11:00 -0000 [thread overview]
Message-ID: <8cf7ddc5-a4a1-d26d-efbc-3126784bc914@codesourcery.com> (raw)
In-Reply-To: <0892dac2-ad82-26f4-c5fa-fa8bcc1d39c5@foss.arm.com>
[-- Attachment #1: Type: text/plain, Size: 278 bytes --]
On 9/20/19 2:18 AM, Kyrill Tkachov wrote:
>
> Yeah, an add_options_for_arm_vfp is what we ideally need here.
How about this version of the patch? The two test cases I also tweaked
to use it are the only ones that use the corresponding arm_vfp_ok
effective target.
-Sandra
[-- Attachment #2: arm-sqrt2.log --]
[-- Type: text/x-log, Size: 390 bytes --]
2019-09-22 Sandra Loosemore <sandra@codesourcery.com>
gcc/testsuite/
* lib/target-supports.exp
(check_effective_target_arm_vfp_ok_nocache): New.
(check_effective_target_arm_vfp_ok): Rewrite.
(add_options_for_arm_vfp): New.
(add_options_for_sqrt_insn): Add options for arm.
* gcc.target/arm/attr-neon-builtin-fail2.c: Use dg-add-options.
* gcc.target/arm/short-vfp-1.c: Likewise.
[-- Attachment #3: arm-sqrt2.patch --]
[-- Type: text/x-patch, Size: 3051 bytes --]
Index: gcc/testsuite/gcc.target/arm/attr-neon-builtin-fail2.c
===================================================================
--- gcc/testsuite/gcc.target/arm/attr-neon-builtin-fail2.c (revision 276004)
+++ gcc/testsuite/gcc.target/arm/attr-neon-builtin-fail2.c (working copy)
@@ -1,7 +1,8 @@
/* Check that calling a neon builtin from a function compiled with vfp fails. */
/* { dg-do compile } */
/* { dg-require-effective-target arm_vfp_ok } */
-/* { dg-options "-O2 -mfloat-abi=softfp" } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_vfp } */
extern __simd64_int8_t a, b;
Index: gcc/testsuite/gcc.target/arm/short-vfp-1.c
===================================================================
--- gcc/testsuite/gcc.target/arm/short-vfp-1.c (revision 276004)
+++ gcc/testsuite/gcc.target/arm/short-vfp-1.c (working copy)
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-require-effective-target arm_vfp_ok }
-/* { dg-options "-mfpu=vfp" } */
+/* { dg-add-options arm_vfp } */
int
test_sisf (float x)
Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp (revision 276004)
+++ gcc/testsuite/lib/target-supports.exp (working copy)
@@ -3489,18 +3489,43 @@ proc check_effective_target_arm_soft_ok
}
}
-# Return 1 if this is an ARM target supporting -mfpu=vfp
-# -mfloat-abi=softfp. Some multilibs may be incompatible with these
-# options.
+# Return 1 if this is an ARM target supporting -mfpu=vfp with an
+# appropriate abi.
-proc check_effective_target_arm_vfp_ok { } {
+proc check_effective_target_arm_vfp_ok_nocache { } {
+ global et_arm_vfp_flags
+ set et_arm_vfp_flags ""
if { [check_effective_target_arm32] } {
- return [check_no_compiler_messages arm_vfp_ok object {
- int dummy;
- } "-mfpu=vfp -mfloat-abi=softfp"]
- } else {
- return 0
+ foreach flags {"-mfpu=vfp" "-mfpu=vfp -mfloat-abi=softfp" "-mpu=vfp -mfloat-abi=hard"} {
+ if { [check_no_compiler_messages_nocache arm_fp_ok object {
+ #ifndef __ARM_FP
+ #error __ARM_FP not defined
+ #endif
+ } "$flags"] } {
+ set et_arm_vfp_flags $flags
+ return 1
+ }
+ }
}
+
+ return 0
+}
+
+proc check_effective_target_arm_vfp_ok { } {
+ return [check_cached_effective_target arm_vfp_ok \
+ check_effective_target_arm_vfp_ok_nocache]
+}
+
+# Add the options needed to compile code with -mfpu=vfp. We need either
+# -mfloat-abi=softfp or -mfloat-abi=hard, but if one is already
+# specified by the multilib, use it.
+
+proc add_options_for_arm_vfp { flags } {
+ if { ! [check_effective_target_arm_vfp_ok] } {
+ return "$flags"
+ }
+ global et_arm_vfp_flags
+ return "$flags $et_arm_vfp_flags"
}
# Return 1 if this is an ARM target supporting -mfpu=vfp3
@@ -6678,6 +6703,9 @@ proc add_options_for_sqrt_insn { flags }
if { [istarget amdgcn*-*-*] } {
return "$flags -ffast-math"
}
+ if { [istarget arm*-*-*] } {
+ return [add_options_for_arm_vfp "$flags"]
+ }
return $flags
}
next prev parent reply other threads:[~2019-09-23 3:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-13 19:06 Sandra Loosemore
2019-09-18 18:14 ` Mike Stump
2019-09-19 8:40 ` Kyrill Tkachov
2019-09-19 18:44 ` Sandra Loosemore
2019-09-20 8:18 ` Kyrill Tkachov
2019-09-23 3:11 ` Sandra Loosemore [this message]
2019-09-23 8:20 ` Kyrill Tkachov
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=8cf7ddc5-a4a1-d26d-efbc-3126784bc914@codesourcery.com \
--to=sandra@codesourcery.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=kyrylo.tkachov@foss.arm.com \
--cc=mikestump@comcast.net \
/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).