* [PATCH] PR target/89125
@ 2022-04-15 16:23 Steve Kargl
2022-04-23 18:40 ` Steve Kargl
0 siblings, 1 reply; 4+ messages in thread
From: Steve Kargl @ 2022-04-15 16:23 UTC (permalink / raw)
To: gcc-patches; +Cc: kargl
[-- Attachment #1: Type: text/plain, Size: 2062 bytes --]
Can someone, anyone, please commit the attach patch, which is
also attached to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89125
where one can read the audit trail. The original patch was
submitted 2 years ago, and required manual intervention due to
the recent *.c to *.cc rename.
Back story: When GCC is configured and built on non-glibc platforms,
it seems very little to no effort is made to enumerate the available
C99 libm functions. It is all or nothing for C99 libm. The patch
introduces a new function, used on only FreeBSD, to inform gcc that
it has C99 libm functions (minus a few which clearly GCC does not check
nor test).
The patch introduces no regression on x86_64-*-freebsd while
allowing an additional 31 new passes.
=== gcc Summary ===
w/o patch w patch
# of expected passes 175405 175434
# of unexpected failures 1081 1051
# of unexpected successes 20 20
# of expected failures 1459 1459
# of unresolved testcases 10 10
# of unsupported tests 3252 3252
=== g++ Summary ===
w/o patch w patch
# of expected passes 225338 225341
# of unexpected failures 678 676
# of expected failures 2071 2071
# of unresolved testcases 11 11
# of unsupported tests 10353 10353
=== gfortran Summary ===
w/o patch w patch
# of expected passes 65901 65901
# of unexpected failures 12 12
# of expected failures 272 272
# of unsupported tests 100 100
2022-04-15 Steven G. Kargl <kargl@gcc.gnu.org>
PR target/89125
* config/freebsd.h: Define TARGET_LIBC_HAS_FUNCTION to be
bsd_libc_has_function.
* gcc/targhooks.cc(bsd_libc_has_function): New function.
Expand the supported math functions to inclue C99 libm.
* gcc/targhooks.h: Prototype for bsd_libc_has_function.
--
Steve
[-- Attachment #2: pr89125.diff --]
[-- Type: text/x-diff, Size: 1627 bytes --]
diff --git a/gcc/config/freebsd.h b/gcc/config/freebsd.h
index 28ebcad88d4..d89ee7dfc97 100644
--- a/gcc/config/freebsd.h
+++ b/gcc/config/freebsd.h
@@ -55,7 +55,7 @@ along with GCC; see the file COPYING3. If not see
#endif
#undef TARGET_LIBC_HAS_FUNCTION
-#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function
+#define TARGET_LIBC_HAS_FUNCTION bsd_libc_has_function
/* Use --as-needed -lgcc_s for eh support. */
#ifdef HAVE_LD_AS_NEEDED
diff --git a/gcc/targhooks.cc b/gcc/targhooks.cc
index e22bc66a6c8..ff127763cf2 100644
--- a/gcc/targhooks.cc
+++ b/gcc/targhooks.cc
@@ -1843,6 +1843,20 @@ no_c99_libc_has_function (enum function_class fn_class ATTRIBUTE_UNUSED,
return false;
}
+/* Assume some c99 functions are present at the runtime including sincos. */
+bool
+bsd_libc_has_function (enum function_class fn_class,
+ tree type ATTRIBUTE_UNUSED)
+{
+ if (fn_class == function_c94
+ || fn_class == function_c99_misc
+ || fn_class == function_sincos)
+ return true;
+
+ return false;
+}
+
+
tree
default_builtin_tm_load_store (tree ARG_UNUSED (type))
{
diff --git a/gcc/targhooks.h b/gcc/targhooks.h
index ecfa11287ef..ecce55ebe79 100644
--- a/gcc/targhooks.h
+++ b/gcc/targhooks.h
@@ -212,6 +212,7 @@ extern bool default_libc_has_function (enum function_class, tree);
extern bool default_libc_has_fast_function (int fcode);
extern bool no_c99_libc_has_function (enum function_class, tree);
extern bool gnu_libc_has_function (enum function_class, tree);
+extern bool bsd_libc_has_function (enum function_class, tree);
extern tree default_builtin_tm_load_store (tree);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] PR target/89125
2022-04-15 16:23 [PATCH] PR target/89125 Steve Kargl
@ 2022-04-23 18:40 ` Steve Kargl
2022-04-25 7:26 ` Richard Biener
0 siblings, 1 reply; 4+ messages in thread
From: Steve Kargl @ 2022-04-23 18:40 UTC (permalink / raw)
To: gcc-patches; +Cc: kargl
ping.
On Fri, Apr 15, 2022 at 09:23:43AM -0700, Steve Kargl wrote:
> Can someone, anyone, please commit the attach patch, which is
> also attached to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89125
> where one can read the audit trail. The original patch was
> submitted 2 years ago, and required manual intervention due to
> the recent *.c to *.cc rename.
>
> Back story: When GCC is configured and built on non-glibc platforms,
> it seems very little to no effort is made to enumerate the available
> C99 libm functions. It is all or nothing for C99 libm. The patch
> introduces a new function, used on only FreeBSD, to inform gcc that
> it has C99 libm functions (minus a few which clearly GCC does not check
> nor test).
>
> The patch introduces no regression on x86_64-*-freebsd while
> allowing an additional 31 new passes.
>
> === gcc Summary ===
> w/o patch w patch
> # of expected passes 175405 175434
> # of unexpected failures 1081 1051
> # of unexpected successes 20 20
> # of expected failures 1459 1459
> # of unresolved testcases 10 10
> # of unsupported tests 3252 3252
>
> === g++ Summary ===
> w/o patch w patch
> # of expected passes 225338 225341
> # of unexpected failures 678 676
> # of expected failures 2071 2071
> # of unresolved testcases 11 11
> # of unsupported tests 10353 10353
>
> === gfortran Summary ===
> w/o patch w patch
> # of expected passes 65901 65901
> # of unexpected failures 12 12
> # of expected failures 272 272
> # of unsupported tests 100 100
>
>
> 2022-04-15 Steven G. Kargl <kargl@gcc.gnu.org>
>
> PR target/89125
> * config/freebsd.h: Define TARGET_LIBC_HAS_FUNCTION to be
> bsd_libc_has_function.
> * gcc/targhooks.cc(bsd_libc_has_function): New function.
> Expand the supported math functions to inclue C99 libm.
> * gcc/targhooks.h: Prototype for bsd_libc_has_function.
>
> --
> Steve
> diff --git a/gcc/config/freebsd.h b/gcc/config/freebsd.h
> index 28ebcad88d4..d89ee7dfc97 100644
> --- a/gcc/config/freebsd.h
> +++ b/gcc/config/freebsd.h
> @@ -55,7 +55,7 @@ along with GCC; see the file COPYING3. If not see
> #endif
>
> #undef TARGET_LIBC_HAS_FUNCTION
> -#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function
> +#define TARGET_LIBC_HAS_FUNCTION bsd_libc_has_function
>
> /* Use --as-needed -lgcc_s for eh support. */
> #ifdef HAVE_LD_AS_NEEDED
> diff --git a/gcc/targhooks.cc b/gcc/targhooks.cc
> index e22bc66a6c8..ff127763cf2 100644
> --- a/gcc/targhooks.cc
> +++ b/gcc/targhooks.cc
> @@ -1843,6 +1843,20 @@ no_c99_libc_has_function (enum function_class fn_class ATTRIBUTE_UNUSED,
> return false;
> }
>
> +/* Assume some c99 functions are present at the runtime including sincos. */
> +bool
> +bsd_libc_has_function (enum function_class fn_class,
> + tree type ATTRIBUTE_UNUSED)
> +{
> + if (fn_class == function_c94
> + || fn_class == function_c99_misc
> + || fn_class == function_sincos)
> + return true;
> +
> + return false;
> +}
> +
> +
> tree
> default_builtin_tm_load_store (tree ARG_UNUSED (type))
> {
> diff --git a/gcc/targhooks.h b/gcc/targhooks.h
> index ecfa11287ef..ecce55ebe79 100644
> --- a/gcc/targhooks.h
> +++ b/gcc/targhooks.h
> @@ -212,6 +212,7 @@ extern bool default_libc_has_function (enum function_class, tree);
> extern bool default_libc_has_fast_function (int fcode);
> extern bool no_c99_libc_has_function (enum function_class, tree);
> extern bool gnu_libc_has_function (enum function_class, tree);
> +extern bool bsd_libc_has_function (enum function_class, tree);
>
> extern tree default_builtin_tm_load_store (tree);
>
--
Steve
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] PR target/89125
2022-04-23 18:40 ` Steve Kargl
@ 2022-04-25 7:26 ` Richard Biener
2022-04-25 7:44 ` Steve Kargl
0 siblings, 1 reply; 4+ messages in thread
From: Richard Biener @ 2022-04-25 7:26 UTC (permalink / raw)
To: Steve Kargl; +Cc: GCC Patches, kargl
On Sat, Apr 23, 2022 at 8:40 PM Steve Kargl via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> ping.
I have tested the patch on x86_64-linux and pushed it.
Richard.
> On Fri, Apr 15, 2022 at 09:23:43AM -0700, Steve Kargl wrote:
> > Can someone, anyone, please commit the attach patch, which is
> > also attached to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89125
> > where one can read the audit trail. The original patch was
> > submitted 2 years ago, and required manual intervention due to
> > the recent *.c to *.cc rename.
> >
> > Back story: When GCC is configured and built on non-glibc platforms,
> > it seems very little to no effort is made to enumerate the available
> > C99 libm functions. It is all or nothing for C99 libm. The patch
> > introduces a new function, used on only FreeBSD, to inform gcc that
> > it has C99 libm functions (minus a few which clearly GCC does not check
> > nor test).
> >
> > The patch introduces no regression on x86_64-*-freebsd while
> > allowing an additional 31 new passes.
> >
> > === gcc Summary ===
> > w/o patch w patch
> > # of expected passes 175405 175434
> > # of unexpected failures 1081 1051
> > # of unexpected successes 20 20
> > # of expected failures 1459 1459
> > # of unresolved testcases 10 10
> > # of unsupported tests 3252 3252
> >
> > === g++ Summary ===
> > w/o patch w patch
> > # of expected passes 225338 225341
> > # of unexpected failures 678 676
> > # of expected failures 2071 2071
> > # of unresolved testcases 11 11
> > # of unsupported tests 10353 10353
> >
> > === gfortran Summary ===
> > w/o patch w patch
> > # of expected passes 65901 65901
> > # of unexpected failures 12 12
> > # of expected failures 272 272
> > # of unsupported tests 100 100
> >
> >
> > 2022-04-15 Steven G. Kargl <kargl@gcc.gnu.org>
> >
> > PR target/89125
> > * config/freebsd.h: Define TARGET_LIBC_HAS_FUNCTION to be
> > bsd_libc_has_function.
> > * gcc/targhooks.cc(bsd_libc_has_function): New function.
> > Expand the supported math functions to inclue C99 libm.
> > * gcc/targhooks.h: Prototype for bsd_libc_has_function.
> >
> > --
> > Steve
>
> > diff --git a/gcc/config/freebsd.h b/gcc/config/freebsd.h
> > index 28ebcad88d4..d89ee7dfc97 100644
> > --- a/gcc/config/freebsd.h
> > +++ b/gcc/config/freebsd.h
> > @@ -55,7 +55,7 @@ along with GCC; see the file COPYING3. If not see
> > #endif
> >
> > #undef TARGET_LIBC_HAS_FUNCTION
> > -#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function
> > +#define TARGET_LIBC_HAS_FUNCTION bsd_libc_has_function
> >
> > /* Use --as-needed -lgcc_s for eh support. */
> > #ifdef HAVE_LD_AS_NEEDED
> > diff --git a/gcc/targhooks.cc b/gcc/targhooks.cc
> > index e22bc66a6c8..ff127763cf2 100644
> > --- a/gcc/targhooks.cc
> > +++ b/gcc/targhooks.cc
> > @@ -1843,6 +1843,20 @@ no_c99_libc_has_function (enum function_class fn_class ATTRIBUTE_UNUSED,
> > return false;
> > }
> >
> > +/* Assume some c99 functions are present at the runtime including sincos. */
> > +bool
> > +bsd_libc_has_function (enum function_class fn_class,
> > + tree type ATTRIBUTE_UNUSED)
> > +{
> > + if (fn_class == function_c94
> > + || fn_class == function_c99_misc
> > + || fn_class == function_sincos)
> > + return true;
> > +
> > + return false;
> > +}
> > +
> > +
> > tree
> > default_builtin_tm_load_store (tree ARG_UNUSED (type))
> > {
> > diff --git a/gcc/targhooks.h b/gcc/targhooks.h
> > index ecfa11287ef..ecce55ebe79 100644
> > --- a/gcc/targhooks.h
> > +++ b/gcc/targhooks.h
> > @@ -212,6 +212,7 @@ extern bool default_libc_has_function (enum function_class, tree);
> > extern bool default_libc_has_fast_function (int fcode);
> > extern bool no_c99_libc_has_function (enum function_class, tree);
> > extern bool gnu_libc_has_function (enum function_class, tree);
> > +extern bool bsd_libc_has_function (enum function_class, tree);
> >
> > extern tree default_builtin_tm_load_store (tree);
> >
>
>
> --
> Steve
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] PR target/89125
2022-04-25 7:26 ` Richard Biener
@ 2022-04-25 7:44 ` Steve Kargl
0 siblings, 0 replies; 4+ messages in thread
From: Steve Kargl @ 2022-04-25 7:44 UTC (permalink / raw)
To: Richard Biener; +Cc: GCC Patches, kargl
On Mon, Apr 25, 2022 at 09:26:26AM +0200, Richard Biener wrote:
> On Sat, Apr 23, 2022 at 8:40 PM Steve Kargl via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
> >
> > ping.
>
> I have tested the patch on x86_64-linux and pushed it.
>
Thanks.
--
Steve
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-04-25 7:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-15 16:23 [PATCH] PR target/89125 Steve Kargl
2022-04-23 18:40 ` Steve Kargl
2022-04-25 7:26 ` Richard Biener
2022-04-25 7:44 ` Steve Kargl
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).