public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/97088] New: 17_intro/names.cc and experimental/names.cc fail with --disable-libstdcxx-pch
@ 2020-09-17 15:07 clyon at gcc dot gnu.org
2020-09-17 16:22 ` [Bug libstdc++/97088] " joseph at codesourcery dot com
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: clyon at gcc dot gnu.org @ 2020-09-17 15:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97088
Bug ID: 97088
Summary: 17_intro/names.cc and experimental/names.cc fail with
--disable-libstdcxx-pch
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: clyon at gcc dot gnu.org
Target Milestone: ---
When configuring gcc with --disable-libstdcxx-pch, two libstdc++ fail on arm
(linux and newlib targets) and aarch64 (with newlib).
For instance on arm-eabi (using newlib):
In file included from
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/thumb/v7ve+simd/hard/libstdc++-v3/include/cmath:45,
from
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/thumb/v7ve+simd/hard/libstdc++-v3/include/arm-none-eabi/bits/stdc++.h:41,
from /libstdc++-v3/testsuite/17_intro/names.cc:203:
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/tools/arm-none-eabi/include/math.h:194:
error: expected ')' before ';' token
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/tools/arm-none-eabi/include/math.h:195:
error: expected ')' before ';' token
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/tools/arm-none-eabi/include/math.h:196:
error: expected ')' before ';' token
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/tools/arm-none-eabi/include/math.h:197:
error: expected ')' before ';' token
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/tools/arm-none-eabi/include/math.h:198:
error: expected ')' before ';' token
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/tools/arm-none-eabi/include/math.h:199:
error: expected ')' before ';' token
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/tools/arm-none-eabi/include/math.h:200:
error: expected ')' before ';' token
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/tools/arm-none-eabi/include/math.h:201:
error: expected ')' before ';' token
This happens because the testcase does
#define x (
and "x" is used as parameter names in several function prototypes in newlib's
math.h
Similarly for arm-linux-gnueabi (with glibc), I can see:
In file included from
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/sysroot-arm-none-linux-gnueabi/usr/include/signal.h:306,
from
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-linux-gnueabi/gcc3/arm-none-linux-gnueabi/libstdc++-v3/include/csignal:42,
from
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-linux-gnueabi/gcc3/arm-none-linux-gnueabi/libstdc++-v3/include/arm-none-linux-gnueabi/bits/stdc++.h:43,
from /libstdc++-v3/testsuite/17_intro/names.cc:203:
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/sysroot-arm-none-linux-gnueabi/usr/include/sys/ucontext.h:89:
error: expected unqualified-id before ':' token
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/sysroot-arm-none-linux-gnueabi/usr/include/sys/ucontext.h:89:
error: expected ')' before ':' token
When configured without --disable-libstdcxx-pch, the pch feature is
auto-enabled, and the testcase is compiled with -include bits/stdc++.h which
avoids the problem.
I think this is a problem with the test.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug libstdc++/97088] 17_intro/names.cc and experimental/names.cc fail with --disable-libstdcxx-pch
2020-09-17 15:07 [Bug libstdc++/97088] New: 17_intro/names.cc and experimental/names.cc fail with --disable-libstdcxx-pch clyon at gcc dot gnu.org
@ 2020-09-17 16:22 ` joseph at codesourcery dot com
2020-09-18 9:25 ` clyon at gcc dot gnu.org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: joseph at codesourcery dot com @ 2020-09-17 16:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97088
--- Comment #1 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
On Thu, 17 Sep 2020, clyon at gcc dot gnu.org wrote:
> This happens because the testcase does
> #define x (
> and "x" is used as parameter names in several function prototypes in newlib's
> math.h
That's a bug in newlib, which should be fixed there.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug libstdc++/97088] 17_intro/names.cc and experimental/names.cc fail with --disable-libstdcxx-pch
2020-09-17 15:07 [Bug libstdc++/97088] New: 17_intro/names.cc and experimental/names.cc fail with --disable-libstdcxx-pch clyon at gcc dot gnu.org
2020-09-17 16:22 ` [Bug libstdc++/97088] " joseph at codesourcery dot com
@ 2020-09-18 9:25 ` clyon at gcc dot gnu.org
2020-09-20 20:06 ` redi at gcc dot gnu.org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: clyon at gcc dot gnu.org @ 2020-09-18 9:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97088
--- Comment #2 from Christophe Lyon <clyon at gcc dot gnu.org> ---
(In reply to joseph@codesourcery.com from comment #1)
> On Thu, 17 Sep 2020, clyon at gcc dot gnu.org wrote:
>
> > This happens because the testcase does
> > #define x (
> > and "x" is used as parameter names in several function prototypes in newlib's
> > math.h
>
> That's a bug in newlib, which should be fixed there.
OK, so you mean that prototypes like
extern int __isinff (float x);
should not name their parameters? I can certainly submit the simple patch to
newlib.
Regarding the problem with glibc, the problem is in ucontext.h, where struct
_libc_fpstate is declared as:
struct _libc_fpstate
{
struct
{
unsigned int sign1:1;
unsigned int unused:15;
unsigned int sign2:1;
unsigned int exponent:14;
unsigned int j:1;
unsigned int mantissa1:31;
unsigned int mantissa0:32;
} fpregs[8];
unsigned int fpsr:32;
unsigned int fpcr:32;
unsigned char ftype[8];
unsigned int init_flag;
};
The offending field is 'j', because libstdc++'s 17_intro/names.cc defines 'j'
as '('. Do you mean that field should also be renamed? That sounds odd.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug libstdc++/97088] 17_intro/names.cc and experimental/names.cc fail with --disable-libstdcxx-pch
2020-09-17 15:07 [Bug libstdc++/97088] New: 17_intro/names.cc and experimental/names.cc fail with --disable-libstdcxx-pch clyon at gcc dot gnu.org
2020-09-17 16:22 ` [Bug libstdc++/97088] " joseph at codesourcery dot com
2020-09-18 9:25 ` clyon at gcc dot gnu.org
@ 2020-09-20 20:06 ` redi at gcc dot gnu.org
2020-09-21 13:09 ` redi at gcc dot gnu.org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2020-09-20 20:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97088
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Christophe Lyon from comment #2)
> OK, so you mean that prototypes like
> extern int __isinff (float x);
> should not name their parameters? I can certainly submit the simple patch to
> newlib.
The parameter should use a reserved name, e.g. __x.
This is a valid C program which will presumably fail to compile with newlib:
#define x 1234
#include <math.h>
int main() { return 0; }
The point of the test is to ensure that libstdc++ headers don't use
non-reserved names like 'x'. In this case it's found a newlib bug, not a
libstdc++ one.
The glibc case is a bit more complicated. 'j' is not a reserved name, but (at
least on x86) the __libc_fpstate types do use reserved names unless __USE_MISC
is defined. In strict modes a reserved name like __j will be used intead. Maybe
the test needs to account for that.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug libstdc++/97088] 17_intro/names.cc and experimental/names.cc fail with --disable-libstdcxx-pch
2020-09-17 15:07 [Bug libstdc++/97088] New: 17_intro/names.cc and experimental/names.cc fail with --disable-libstdcxx-pch clyon at gcc dot gnu.org
` (2 preceding siblings ...)
2020-09-20 20:06 ` redi at gcc dot gnu.org
@ 2020-09-21 13:09 ` redi at gcc dot gnu.org
2021-06-25 17:09 ` redi at gcc dot gnu.org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2020-09-21 13:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97088
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
<asm/types.h> also has this on ppc linux:
typedef struct {
__u32 u[4];
} __attribute__((aligned(16))) __vector128;
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug libstdc++/97088] 17_intro/names.cc and experimental/names.cc fail with --disable-libstdcxx-pch
2020-09-17 15:07 [Bug libstdc++/97088] New: 17_intro/names.cc and experimental/names.cc fail with --disable-libstdcxx-pch clyon at gcc dot gnu.org
` (3 preceding siblings ...)
2020-09-21 13:09 ` redi at gcc dot gnu.org
@ 2021-06-25 17:09 ` redi at gcc dot gnu.org
2021-06-25 17:10 ` redi at gcc dot gnu.org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2021-06-25 17:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97088
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
*** Bug 101211 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug libstdc++/97088] 17_intro/names.cc and experimental/names.cc fail with --disable-libstdcxx-pch
2020-09-17 15:07 [Bug libstdc++/97088] New: 17_intro/names.cc and experimental/names.cc fail with --disable-libstdcxx-pch clyon at gcc dot gnu.org
` (4 preceding siblings ...)
2021-06-25 17:09 ` redi at gcc dot gnu.org
@ 2021-06-25 17:10 ` redi at gcc dot gnu.org
2021-06-25 19:50 ` cvs-commit at gcc dot gnu.org
2021-06-28 15:25 ` cvs-commit at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2021-06-25 17:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97088
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Last reconfirmed| |2021-06-25
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This now happens even without --disable-libstdcxx-pch because in r12-1742 I
added
{ dg-add-options no_pch }
which means the PCH headers aren't used for the test.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug libstdc++/97088] 17_intro/names.cc and experimental/names.cc fail with --disable-libstdcxx-pch
2020-09-17 15:07 [Bug libstdc++/97088] New: 17_intro/names.cc and experimental/names.cc fail with --disable-libstdcxx-pch clyon at gcc dot gnu.org
` (5 preceding siblings ...)
2021-06-25 17:10 ` redi at gcc dot gnu.org
@ 2021-06-25 19:50 ` cvs-commit at gcc dot gnu.org
2021-06-28 15:25 ` cvs-commit at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-25 19:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97088
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:
https://gcc.gnu.org/g:e83a5a6b6893e910dc0b6b1cd034e1a258406c93
commit r12-1814-ge83a5a6b6893e910dc0b6b1cd034e1a258406c93
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Fri Jun 25 18:31:22 2021 +0100
libstdc++: More workarounds in 17_intro/names.cc test [PR 97088]
Conditionally #undef some more names that are used in system headers.
libstdc++-v3/ChangeLog:
PR libstdc++/97088
* testsuite/17_intro/names.cc: Undef more names for newlib and
also for arm-none-linux-gnueabi.
* testsuite/experimental/names.cc: Disable PCH.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug libstdc++/97088] 17_intro/names.cc and experimental/names.cc fail with --disable-libstdcxx-pch
2020-09-17 15:07 [Bug libstdc++/97088] New: 17_intro/names.cc and experimental/names.cc fail with --disable-libstdcxx-pch clyon at gcc dot gnu.org
` (6 preceding siblings ...)
2021-06-25 19:50 ` cvs-commit at gcc dot gnu.org
@ 2021-06-28 15:25 ` cvs-commit at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-28 15:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97088
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:
https://gcc.gnu.org/g:75f948f089ceb8888fd00913635264e20610d0f2
commit r12-1845-g75f948f089ceb8888fd00913635264e20610d0f2
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Mon Jun 28 15:13:34 2021 +0100
libstdc++: Fix backwards logic in 17_intro/names.cc test [PR 97088]
I meant to undef the names that clash with newlib headers for newlib,
but I only undef'd them for non-newlib targets. This means they still
cause errors for newlib, and aren't tested for other targets.
This fixes the test to check those names for non-newlib targets, and to
undef them to avoid errors for newlib.
libstdc++-v3/ChangeLog:
PR libstdc++/97088
* testsuite/17_intro/names.cc: Fix #if condition for names used
by newlib headers.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2021-06-28 15:25 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-17 15:07 [Bug libstdc++/97088] New: 17_intro/names.cc and experimental/names.cc fail with --disable-libstdcxx-pch clyon at gcc dot gnu.org
2020-09-17 16:22 ` [Bug libstdc++/97088] " joseph at codesourcery dot com
2020-09-18 9:25 ` clyon at gcc dot gnu.org
2020-09-20 20:06 ` redi at gcc dot gnu.org
2020-09-21 13:09 ` redi at gcc dot gnu.org
2021-06-25 17:09 ` redi at gcc dot gnu.org
2021-06-25 17:10 ` redi at gcc dot gnu.org
2021-06-25 19:50 ` cvs-commit at gcc dot gnu.org
2021-06-28 15:25 ` cvs-commit at gcc dot gnu.org
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).