public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/97643] New: Accepts invalid qualification conversion involving array of unknown bound [P0388]
@ 2020-10-30 18:33 leni536 at gmail dot com
2020-11-03 19:01 ` [Bug c++/97643] " mpolacek at gcc dot gnu.org
2020-12-03 19:52 ` cvs-commit at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: leni536 at gmail dot com @ 2020-10-30 18:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97643
Bug ID: 97643
Summary: Accepts invalid qualification conversion involving
array of unknown bound [P0388]
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: leni536 at gmail dot com
Target Milestone: ---
version: g++ (Compiler-Explorer-Build) 11.0.0 20201029 (experimental)
https://godbolt.org/z/a8sKr3
In C++20 the following code is ill-formed, but gcc accepts it:
void foo(int (*arr)[10]);
void bar(int (*arr)[]) {
int (* ptr)[10];
int (** ptr2)[] = &ptr; // not allowed
*ptr2 = arr;
foo(ptr);
}
The conversion happens from T1 = int (**)[10] to T2 = int (**)[] .
The cv-decomposition of the two types are:
T1 = pointer to | pointer to | array of 10 | int
T2 = pointer to | pointer to | array of unknown bound of | int
The cv-combined type is:
T3 = pointer to | const pointer to | array of unknown bound of | int
= int (*const*)[]
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/97643] Accepts invalid qualification conversion involving array of unknown bound [P0388]
2020-10-30 18:33 [Bug c++/97643] New: Accepts invalid qualification conversion involving array of unknown bound [P0388] leni536 at gmail dot com
@ 2020-11-03 19:01 ` mpolacek at gcc dot gnu.org
2020-12-03 19:52 ` cvs-commit at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-11-03 19:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97643
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mpolacek at gcc dot gnu.org
--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Accepted since my
commit 89e0a492af5bec8ffa2ec5d99c4858df50d22c16
Author: Marek Polacek <polacek@redhat.com>
Date: Wed Oct 9 20:58:00 2019 +0000
Implement C++20 P0388R4, DR 1307, and DR 330.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/97643] Accepts invalid qualification conversion involving array of unknown bound [P0388]
2020-10-30 18:33 [Bug c++/97643] New: Accepts invalid qualification conversion involving array of unknown bound [P0388] leni536 at gmail dot com
2020-11-03 19:01 ` [Bug c++/97643] " mpolacek at gcc dot gnu.org
@ 2020-12-03 19:52 ` cvs-commit at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-03 19:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97643
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Michael Meissner <meissner@gcc.gnu.org>:
https://gcc.gnu.org/g:9f1a6501994a2d18ec4fe2a6664637f48021b210
commit r11-5728-g9f1a6501994a2d18ec4fe2a6664637f48021b210
Author: Michael Meissner <meissner@linux.ibm.com>
Date: Thu Dec 3 14:50:26 2020 -0500
PowerPC: PR libgcc/97543 and libgcc/97643, fix long double issues
If you use a compiler with long double defaulting to 64-bit instead of
128-bit
with IBM extended double, you get linker warnings about mis-matches in the
gnu
attributes for long double (PR libgcc/97543). Even if the compiler is
configured to have long double be 64 bit as the default with the
configuration
option '--without-long-double-128' you get the warnings.
You also get the same issues if you use a compiler with long double
defaulting
to IEEE 128-bit instead of IBM extended double (PR libgcc/97643).
The issue is the way libgcc.a/libgcc.so is built. Right now when building
libgcc under Linux, the long double size is set to 128-bits when building
libgcc. However, the gnu attributes are set, leading to the warnings.
One feature of the current GNU attribute implementation is if you have a
shared
library (such as libgcc_s.so), the GNU attributes for the shared library is
an
inclusive OR of all of the objects within the library. This means if any
object file that uses the -mlong-double-128 option and uses long double,
the GNU
attributes for the library will indicate that it uses 128-bit IBM long
doubles. If you have a static library, you will get the warning only if
you
actually reference an object file with the attribute set.
This patch does two things:
1) All of the object files that support IBM 128-bit long doubles
explicitly set the ABI to IBM extended double.
2) I turned off GNU attributes for building the shared library or for
building the IBM 128-bit long double support.
libgcc/
2020-12-03 Michael Meissner <meissner@linux.ibm.com>
PR libgcc/97543
PR libgcc/97643
* config/rs6000/t-linux (IBM128_STATIC_OBJS): New make variable.
(IBM128_SHARED_OBJS): New make variable.
(IBM128_OBJS): New make variable. Set all objects to use the
explicit IBM format, and disable gnu attributes.
(IBM128_CFLAGS): New make variable.
(gcc_s_compile): Add -mno-gnu-attribute to all shared library
modules.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-12-03 19:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-30 18:33 [Bug c++/97643] New: Accepts invalid qualification conversion involving array of unknown bound [P0388] leni536 at gmail dot com
2020-11-03 19:01 ` [Bug c++/97643] " mpolacek at gcc dot gnu.org
2020-12-03 19:52 ` 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).