This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch committed] Tweak gcc.dg/torture/builtin-math-7.c for sh
On Wed, Aug 26, 2009 at 9:19 AM, Kaz Kojima<kkojima@rr.iij4u.or.jp> wrote:
> Uros Bizjak <ubizjak@gmail.com> wrote:
>> BTW: Since sh-* and alpha-* both need -mieee, what do you think about
>> using dg-add-options and introducing for example add_options_for_ieee?
>> Something along the lines of existing dg_add_options_for_c99.
>>
>> Then we just add:
>>
>> /* { dg-add-options ieee } */
>>
>> without touching original dg-options.
>
> It looks smart and clean, though I'm not sure how to implement it.
Something like following patch (with an example):
--cut here--
Index: gcc.dg/torture/type-generic-1.c
===================================================================
--- gcc.dg/torture/type-generic-1.c (revision 151139)
+++ gcc.dg/torture/type-generic-1.c (working copy)
@@ -2,8 +2,8 @@
without any fast-math flags. */
/* { dg-do run } */
-/* { dg-options "-mieee" { target alpha*-*-* sh*-*-* } } */
/* { dg-skip-if "No Inf/NaN support" { spu-*-* } } */
+/* { dg-add-options ieee } */
#include "../tg-tests.h"
Index: lib/target-supports.exp
===================================================================
--- lib/target-supports.exp (revision 151139)
+++ lib/target-supports.exp (working copy)
@@ -2971,6 +2971,17 @@
return $flags
}
+# Add to FLAGS all the target-specific flags needed to enable
+# full IEEE compliance mode.
+
+proc add_options_for_ieee { flags } {
+ if { [istarget "alpha*-*-*"]
+ || [istarget "sh*-*-*"] } {
+ return "$flags -mieee"
+ }
+ return $flags
+}
+
# Return 1 if the target provides a full C99 runtime.
proc check_effective_target_c99_runtime { } {
--cut here--
Uros.