> On May 29, 2024, at 02:57, Richard Biener wrote:
>
> On Tue, May 28, 2024 at 11:09 PM Qing Zhao wrote:
>>
>> Thank you for the comments. See my answers below:
>>
>> Joseph, please see the last question, I need your help on it. Thanks a lot
>> for
Richard and Joseph:
> On May 28, 2024, at 17:09, Qing Zhao wrote:
>
>>>
>>> diff --git a/gcc/varasm.cc b/gcc/varasm.cc
>>> index fa17eff551e8..d75b23668925 100644
>>> --- a/gcc/varasm.cc
>>> +++ b/gcc/varasm.cc
>>> @@ -5082,6
Hi,
This is the 10th version of the patch.
Which is rebased on the latest trunk.
Compare with the 9th version, all the difference are in patch #2, including
a small C FE change in the routine "digest_init". all others are middle-end
changes.
please review the changes for the patch #2:
updates p
'counted_by (COUNT)'
The 'counted_by' attribute may be attached to the C99 flexible
array member of a structure. It indicates that the number of the
elements of the array is given by the field "COUNT" in the
same structure as the flexible array member.
GCC may use this inf
Including the following changes:
* The definition of the new internal function .ACCESS_WITH_SIZE
in internal-fn.def.
* C FE converts every reference to a FAM with a "counted_by" attribute
to a call to the internal function .ACCESS_WITH_SIZE.
(build_component_ref in c_typeck.cc)
This includ
gcc/c-family/ChangeLog:
* c-ubsan.cc (get_bound_from_access_with_size): New function.
(ubsan_instrument_bounds): Handle call to .ACCESS_WITH_SIZE.
gcc/testsuite/ChangeLog:
* gcc.dg/ubsan/flex-array-counted-by-bounds-2.c: New test.
* gcc.dg/ubsan/flex-array-counted
to carry the TYPE of the flexible array.
Such information is needed during tree-object-size.cc.
We cannot use the result type or the type of the 1st argument
of the routine .ACCESS_WITH_SIZE to decide the element type
of the original array due to possible type casting in the
source code.
gcc/c/C
gcc/ChangeLog:
* tree-object-size.cc (access_with_size_object_size): New function.
(call_object_size): Call the new function.
gcc/testsuite/ChangeLog:
* gcc.dg/builtin-object-size-common.h: Add a new macro EXPECT.
* gcc.dg/flex-array-counted-by-3.c: New test.
> On May 30, 2024, at 15:43, Joseph Myers wrote:
>
> On Thu, 30 May 2024, Qing Zhao wrote:
>
>> In order to make this working, the routine digest_init in c-typeck.cc
>> is updated to fold calls to .ACCESS_WITH_SIZE to its first argument
>> when require_
> On May 31, 2024, at 08:58, Richard Biener wrote:
>
> On Thu, 30 May 2024, Qing Zhao wrote:
>
>> Including the following changes:
>> * The definition of the new internal function .ACCESS_WITH_SIZE
>> in internal-fn.def.
>> * C FE converts every r
> On May 23, 2024, at 07:46, Richard Biener wrote:
>
> On Wed, May 22, 2024 at 8:53 PM Qing Zhao wrote:
>>
>>
>>
>>> On May 22, 2024, at 03:38, Richard Biener
>>> wrote:
>>>
>>> On Tue, May 21, 2024 at 11:36 PM David Mal
> On Jun 3, 2024, at 02:29, Richard Biener wrote:
>
> On Fri, May 31, 2024 at 11:23 PM Qing Zhao wrote:
>>
>>
>>
>>> On May 23, 2024, at 07:46, Richard Biener
>>> wrote:
>>>
>>> On Wed, May 22, 2024 at 8:53 PM Qing Zhao wr
Hi, Kewen,
Thanks for the patch, LGTM.
Qing
> On Aug 9, 2024, at 05:50, Kewen.Lin wrote:
>
> Hi,
>
> As PR116148#c7 shows, fam-in-union-alone-in-struct-2.c still
> fails on hppa which is a BE environment, but by checking more
> (also confirmed by John in PR116148#c12), it's due to that
> si
:32, Qing Zhao wrote:
>
> The 2nd ping for the following patch:
>
> https://gcc.gnu.org/pipermail/gcc-patches/2024-July/657150.html
>
> thanks.
>
> Qing
>
>> On Jul 22, 2024, at 09:01, Qing Zhao wrote:
>>
>> Hi, Richard,
>>
>> Could you
Gentle ping on this simple patch.
thanks.
Qing
> On Aug 5, 2024, at 16:17, Qing Zhao wrote:
>
> Compared to the first version, the major changes are:
>
> 1. Changed the error as a warning with -Wattributes per Jakub and Jason's
> comments.
> 2. Update documentat
With the addition of the 'counted_by' attribute and its wide roll-out
within the Linux kernel, a use case has been found that would be very
nice to have for object allocators: being able to set the counted_by
counter variable without knowing its name.
For example, given:
struct foo {
...
> On Aug 13, 2024, at 17:05, Dimitar Dimitrov wrote:
>
> On Tue, Aug 13, 2024 at 07:34:09PM +0200, Hans-Peter Nilsson wrote:
>>> From: Sam James
>>> Date: Tue, 13 Aug 2024 18:17:29 +0100
>>
>>> Hans-Peter Nilsson writes:
>>>
I stumbled on this being a regression for cris-elf as well;
> On Aug 20, 2024, at 05:58, Richard Biener wrote:
>
> On Tue, Aug 13, 2024 at 5:34 PM Qing Zhao wrote:
>>
>> With the addition of the 'counted_by' attribute and its wide roll-out
>> within the Linux kernel, a use case has been found that would be very
> On Aug 21, 2024, at 04:44, Richard Biener wrote:
>
> On Tue, Aug 20, 2024 at 3:41 PM Qing Zhao wrote:
>>
>>
>>
>>> On Aug 20, 2024, at 05:58, Richard Biener
>>> wrote:
>>>
>>> On Tue, Aug 13, 2024 at 5:34 PM Qing Zhao wr
(Resend since the previous one has no subject).
> On Aug 21, 2024, at 04:44, Richard Biener wrote:
>
> On Tue, Aug 20, 2024 at 3:41 PM Qing Zhao wrote:
>>
>>
>>
>>> On Aug 20, 2024, at 05:58, Richard Biener
>>> wrote:
>>>
> On Aug 21, 2024, at 10:34, Martin Uecker wrote:
>
> Am Mittwoch, dem 21.08.2024 um 14:12 + schrieb Qing Zhao:
>
> ...
>>
>>>
>>>> + if (__builtin_get_counted_by (__p->FAM)) \
>>>> + *(__builtin_get_counted_by(__p->FAM)) = C
> On Aug 21, 2024, at 10:45, Martin Uecker wrote:
>
> Am Mittwoch, dem 21.08.2024 um 16:34 +0200 schrieb Martin Uecker:
>> Am Mittwoch, dem 21.08.2024 um 14:12 +0000 schrieb Qing Zhao:
>>
>>>
>>> Yes, I do feel that the approach __builtin_get_count
> On Aug 21, 2024, at 11:43, Martin Uecker wrote:
>
> Am Mittwoch, dem 21.08.2024 um 15:24 + schrieb Qing Zhao:
>>>
>>> But if we changed it to return a void pointer, we could make this
>>> a compile-time check:
>>>
>>> auto ret =
Hi, Bill,
Thank you for the info.
> On Aug 21, 2024, at 17:36, Bill Wendling wrote:
>
>>
>> Bill, could you please provide a little bit more info on the possibility of
>> a new builtin __builtin_has_attribute() in CLANG?
>>
> From what I gathered, it would require some moderate surgery to
> On Aug 21, 2024, at 17:54, Bill Wendling wrote:
>
>> if (__builtin_get_counted_by(p->array)) {
>>size_t max_value =
>> type_max(typeof(*__builtin_get_counted_by(p->array)));
>>if (count > type_max)
>>...fail cleanly...
>>*__builtin_get_counted_by(p->ar
> On Aug 21, 2024, at 18:08, Bill Wendling wrote:
>
>>>
>>> to test.
>>
>> For the unary operator __counted_by(PTR), “PTR” must have a counted_by
>> attribute, if not, there will be a compilation time error.
>>
>> Then the user could write the following code:
>>
>> If __builtin_has_att
eneric operator for this
purpose.
Any comments on this?
Thanks a lot for your help.
Qing
> On Aug 21, 2024, at 11:43, Martin Uecker wrote:
>
> Am Mittwoch, dem 21.08.2024 um 15:24 +0000 schrieb Qing Zhao:
>>>
>>> But if we changed it to return a void pointer, we c
> On Aug 26, 2024, at 15:46, Bill Wendling wrote:
>
> On Wed, Aug 21, 2024 at 8:43 AM Martin Uecker wrote:
>>
>> Am Mittwoch, dem 21.08.2024 um 15:24 +0000 schrieb Qing Zhao:
>>>>
>>>> But if we changed it to return a void pointer,
> On Aug 26, 2024, at 16:30, Kees Cook wrote:
>
> On Mon, Aug 26, 2024 at 07:30:15PM +0000, Qing Zhao wrote:
>> Hi, Martin,
>>
>> Looks like that there is some issue when I tried to use the _Generic for the
>> testing cases, and then I narrowed down to a
>
> On Aug 26, 2024, at 17:01, Martin Uecker wrote:
>
> Am Montag, dem 26.08.2024 um 13:30 -0700 schrieb Kees Cook:
>> On Mon, Aug 26, 2024 at 07:30:15PM +, Qing Zhao wrote:
>>> Hi, Martin,
>>>
>>> Looks like that there is some issue when I trie
on, Aug 26, 2024 at 07:30:15PM +, Qing Zhao wrote:
>>>>> Hi, Martin,
>>>>>
>>>>> Looks like that there is some issue when I tried to use the _Generic for
>>>>> the testing cases, and then I narrowed down to a
>>>>> small te
Hi,
Thanks for the information.
Yes, providing a unary operator similar as __counted_by(PTR) as suggested by
multiple people previously is a cleaner approach.
Then the programmer will use the following:
__builtin_choose_expr(
__builtin_has_attribute (__p->FAM, "counted_by”)
> On Jun 4, 2024, at 03:43, Richard Biener wrote:
>
> On Mon, Jun 3, 2024 at 4:48 PM David Malcolm wrote:
>>
>> On Mon, 2024-06-03 at 08:29 +0200, Richard Biener wrote:
>>> On Fri, May 31, 2024 at 11:23 PM Qing Zhao
>>> wrote:
>>>>
&
> On Jun 4, 2024, at 17:55, David Malcolm wrote:
>
> On Fri, 2024-05-31 at 13:11 +0000, Qing Zhao wrote:
>>
>>
>>> On May 31, 2024, at 08:58, Richard Biener
>>> wrote:
>>>
>>> On Thu, 30 May 2024, Qing Zhao wrote:
>>>
>
> On Jun 5, 2024, at 03:26, Richard Biener wrote:
>
> On Tue, Jun 4, 2024 at 10:31 PM Qing Zhao wrote:
>>
>>
>>
>>> On Jun 4, 2024, at 03:43, Richard Biener wrote:
>>>
>>> On Mon, Jun 3, 2024 at 4:48 PM David Malcolm wrote:
>&g
> On Jun 5, 2024, at 13:07, Richard Biener wrote:
>
>
>
>> Am 05.06.2024 um 18:39 schrieb Qing Zhao :
>>
>>
>>
>>> On Jun 5, 2024, at 03:26, Richard Biener wrote:
>>>
>>>> On Tue, Jun 4, 2024 at 10:31 PM Qing Zhao wrote
> On Jun 5, 2024, at 09:49, David Malcolm wrote:
>
> On Tue, 2024-06-04 at 22:09 +0000, Qing Zhao wrote:
>>
>>
>>> On Jun 4, 2024, at 17:55, David Malcolm
>>> wrote:
>>>
>>> On Fri, 2024-05-31 at 13:11 +, Qing Zhao wrote:
>&g
Hi, Richard,
> On Jun 5, 2024, at 13:58, Qing Zhao wrote:
>>
>>>>>>>>> Like this?
>>>>>>>>>
>>>>>>>>> diff --git a/libcpp/include/line-map.h b/libcpp/include/line-map.h
>>>>>>>>
more complicate testing case that has one
basic block copied multiple times by the jump thread, do you have any pointer
to such testing cases?
Thanks a lot for any help.
Qing
> On Jun 7, 2024, at 15:13, Qing Zhao wrote:
>
> Hi, Richard,
>
>> On Jun 5, 2024, at 13:5
Hi, Richard,
Could you please take a look at the patch and let me know any comment you have
(especially on the middle-end part)?
David, let me know if you have further comment and suggestions.
Thanks a lot.
Qing
> On Jul 12, 2024, at 10:03, Qing Zhao wrote:
>
> due to code du
The 2nd ping for the following patch:
https://gcc.gnu.org/pipermail/gcc-patches/2024-July/657150.html
thanks.
Qing
> On Jul 22, 2024, at 09:01, Qing Zhao wrote:
>
> Hi, Richard,
>
> Could you please take a look at the patch and let me know any comment you
> have (especi
Hi, Kewen,
Thanks a lot for fixing this testing case issue.
Yes, the change LGTM though I can’t approve it.
Qing
> On Jul 31, 2024, at 05:22, Kewen.Lin wrote:
>
> Hi,
>
> As Andrew pointed out in PR116148, fam-in-union-alone-in-struct-2.c
> was designed for little-endian, the recent commit r
As discussed in PR116016:https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116016#c48
We should explicitly document this limitation and issue error messages for C++.
The "counted_by" attribute currently is only supported in C, mention this
explicitly in documentation and also issue error when see "cou
> On Aug 5, 2024, at 09:53, Jakub Jelinek wrote:
>
> On Mon, Aug 05, 2024 at 01:33:01PM +0000, Qing Zhao wrote:
>> As discussed in
>> PR116016:https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116016#c48
>>
>> We should explicitly document this limitation a
> On Aug 5, 2024, at 12:51, Jakub Jelinek wrote:
>
> On Mon, Aug 05, 2024 at 04:46:09PM +0000, Qing Zhao wrote:
>> So, you want me to add counted_by test-suite for C23? (Which should be
>> supported)
>> Okay, but I will do it in another separate patch since this
On Aug 5, 2024, at 13:54, Jakub Jelinek wrote:
On Mon, Aug 05, 2024 at 01:48:25PM -0400, Jason Merrill wrote:
On 8/5/24 9:53 AM, Jakub Jelinek wrote:
On Mon, Aug 05, 2024 at 01:33:01PM +, Qing Zhao wrote:
As discussed in PR116016:https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116016#c48
We
On Aug 5, 2024, at 06:33, Martin Uecker wrote:
>
> Am Montag, dem 05.08.2024 um 11:50 +0200 schrieb Jakub Jelinek:
>> On Mon, Aug 05, 2024 at 11:45:56AM +0200, Alejandro Colomar wrote:
>>> [CC += Kees, Qing]
>>>
>>> Hi Joseph,
>>>
>>> On Sun, Aug 04, 2024 at 08:34:24PM GMT, Alejandro Colomar wr
Compared to the first version, the major changes are:
1. Changed the error as a warning with -Wattributes per Jakub and Jason's
comments.
2. Update documentation accordingly.
3. Move the testing case to g++.dg/ext
Add one more new testing case for C++11
Adjust the testing case according t
On Aug 5, 2024, at 16:59, Alejandro Colomar wrote:
The “counted-by” attribute currently is not in the TYPE system, and
we plan to add it into the TYPE system later through language
standard (or an GCC extension). If that happens, then both the
“sizeof” and the “__lengthof__” operators should
() =>
array_type_nelts_minus_one()
2: 2bb966a0a89 = 2: 2bb966a0a89 Merge definitions of array_type_nelts_top()
3: d22b5e1c015 ! 3: e2dbfc43b14 c: Add __lengthof__() operator
@@ Metadata
Author: Alejandro Colomar
## Commit message ##
-c: Add __lengthof__() operator
+c: Add _
Some comments on the documentation part.
(Hopefully, this time my quoting format is good, I checked the email
sent back to myself, no formatting issue, but when I checked the emails
in the archive,
https://gcc.gnu.org/pipermail/gcc-patches/2024-August/659593.html,
yst, I see the quoting forma
Hi,
This is the 9th version of the patch.
Compare with the 8th version, the difference are:
updates per Joseph's comments:
1. in C FE, add checking for counted_by attribute for the new multiple
definitions of the same tag for C23 in the routine
"tagged_types_tu_compatible_p".
Add a new tes
'counted_by (COUNT)'
The 'counted_by' attribute may be attached to the C99 flexible
array member of a structure. It indicates that the number of the
elements of the array is given by the field "COUNT" in the
same structure as the flexible array member.
GCC may use this inf
Including the following changes:
* The definition of the new internal function .ACCESS_WITH_SIZE
in internal-fn.def.
* C FE converts every reference to a FAM with a "counted_by" attribute
to a call to the internal function .ACCESS_WITH_SIZE.
(build_component_ref in c_typeck.cc)
This includ
to carry the TYPE of the flexible array.
Such information is needed during tree-object-size.cc.
We cannot use the result type or the type of the 1st argument
of the routine .ACCESS_WITH_SIZE to decide the element type
of the original array due to possible type casting in the
source code.
gcc/c/C
gcc/ChangeLog:
* tree-object-size.cc (access_with_size_object_size): New function.
(call_object_size): Call the new function.
gcc/testsuite/ChangeLog:
* gcc.dg/builtin-object-size-common.h: Add a new macro EXPECT.
* gcc.dg/flex-array-counted-by-3.c: New test.
gcc/c-family/ChangeLog:
* c-ubsan.cc (get_bound_from_access_with_size): New function.
(ubsan_instrument_bounds): Handle call to .ACCESS_WITH_SIZE.
gcc/testsuite/ChangeLog:
* gcc.dg/ubsan/flex-array-counted-by-bounds-2.c: New test.
* gcc.dg/ubsan/flex-array-counted
Hi,
The request for GCC to accept that the C99 flexible array member can be
in a union or alone in a struct has been made a long time ago around 2012
for supporting several practical cases including glibc.
A GCC PR has been opened for such request at that time:
https://gcc.gnu.org/bugzilla/show
gcc/c/ChangeLog:
* c-decl.cc (finish_struct): Change errors to pedwarns for the cases
flexible array members in union or alone in structures.
gcc/cp/ChangeLog:
* class.cc (diagnose_flexarrays): Change error to pdewarn for the case
flexible array members alone in s
for allow flexible array members in unions and alone in structures [PR53548]
The request for GCC to accept that the C99 flexible array member can be
in a union or alone in a structure has been made a long time ago around 2012
for supporting several practical cases including glibc.
A GCC PR has be
gcc/testsuite/ChangeLog:
* gcc.dg/flex-array-in-union-1.c: New test.
* gcc.dg/flex-array-in-union-2.c: New test.
---
gcc/testsuite/gcc.dg/flex-array-in-union-1.c | 37 +
gcc/testsuite/gcc.dg/flex-array-in-union-2.c | 42
2 files changed, 79 ins
gcc/testsuite/ChangeLog:
* c-c++-common/builtin-clear-padding-3.c: Adjust testcase.
* g++.dg/ext/flexary12.C: Likewise.
* g++.dg/ext/flexary19.C: Likewise.
* g++.dg/ext/flexary2.C: Likewise.
* g++.dg/ext/flexary3.C: Likewise.
* g++.dg/ext/flexary36.C
> On Apr 19, 2024, at 16:54, Tom Tromey wrote:
>
>>>>>> Qing Zhao writes:
>
>> +The size of the union is as if the flexiable array member were omitted
>> +except that it may have more trailing padding than the omission would imply.
>> +
>>
Thanks a lot.
Qing
> On Apr 22, 2024, at 16:38, Joseph Myers wrote:
>
> This version of patch 1/5 is OK for GCC 15.
>
> --
> Joseph S. Myers
> josmy...@redhat.com
>
> On Apr 23, 2024, at 14:04, Joseph Myers wrote:
>
> On Fri, 19 Apr 2024, Qing Zhao wrote:
>
>> +The size of the union is as if the flexiable array member were omitted
>> +except that it may have more trailing padding than the omission would imply.
>
> "
> On Apr 23, 2024, at 15:03, Joseph Myers wrote:
>
> On Tue, 23 Apr 2024, Qing Zhao wrote:
>
>> However, I am not very confident on the wording of the doc, is the
>> current wording good enough for this? Or do you have any suggestion on
>> how to make it bett
> On Apr 23, 2024, at 14:53, Joseph Myers wrote:
>
> On Fri, 19 Apr 2024, Qing Zhao wrote:
>
>> gcc/testsuite/ChangeLog:
>>
>> * gcc.dg/flex-array-in-union-1.c: New test.
>> * gcc.dg/flex-array-in-union-2.c: New test.
>
> There should
024, at 09:54, Qing Zhao wrote:
>
> Hi,
>
> This is the 9th version of the patch.
>
> Compare with the 8th version, the difference are:
>
> updates per Joseph's comments:
>
> 1. in C FE, add checking for counted_by attribute for the new multiple
> definitio
> On Apr 23, 2024, at 15:51, Joseph Myers wrote:
>
> On Fri, 19 Apr 2024, Qing Zhao wrote:
>
>> gcc/c/ChangeLog:
>>
>> * c-decl.cc (finish_struct): Change errors to pedwarns for the cases
>> flexible array members in union or alone in structur
The request for GCC to accept that the C99 flexible array member can be
in a union or alone in a structure has been made a long time ago around 2012
for supporting several practical cases including glibc.
A GCC PR has been opened for such request at that time:
https://gcc.gnu.org/bugzilla/show_bu
to support flexible array members in unions and alone in structures.
Adjust testcases for flexible array member
in union and alone in structure extension.
gcc/c/ChangeLog:
* c-decl.cc (finish_struct): Change errors to pedwarns for the cases
flexible array members in union or al
Hi,
This is the 2nd version for
Allow flexible array members in unions and alone in structures [PR53548]
(for your reference, the 1st version is at:
https://gcc.gnu.org/pipermail/gcc-patches/2024-April/649737.html)
compared to the 1st version, the major difference are:
A. C FE updates based on
gcc/testsuite/ChangeLog:
* c-c++-common/fam-in-union-alone-in-struct-1.c: New testcase.
* c-c++-common/fam-in-union-alone-in-struct-2.c: New testcase.
* c-c++-common/fam-in-union-alone-in-struct-3.c: New testcase.
---
.../fam-in-union-alone-in-struct-1.c | 52
> On Apr 25, 2024, at 10:13, Siddhesh Poyarekar wrote:
>
> On 2024-04-25 10:06, Qing Zhao wrote:
>> gcc/testsuite/ChangeLog:
>> * c-c++-common/fam-in-union-alone-in-struct-1.c: New testcase.
>> * c-c++-common/fam-in-union-alone-in-struct-2.c: New testcase.
Hi,
This is the 3rd version for
Allow flexible array members in unions and alone in structures [PR53548]
(for your reference, the 1st version is at:
https://gcc.gnu.org/pipermail/gcc-patches/2024-April/649737.html
The 2nd version is at:
https://gcc.gnu.org/pipermail/gcc-patches/2024-April/650019
The request for GCC to accept that the C99 flexible array member can be
in a union or alone in a structure has been made a long time ago around 2012
for supporting several practical cases including glibc.
A GCC PR has been opened for such request at that time:
https://gcc.gnu.org/bugzilla/show_bu
to support flexible array members
in unions and alone in structures. Adjust testcases for flexible array member
in union and alone in structure extension.
gcc/c/ChangeLog:
* c-decl.cc (finish_struct): Change errors to pedwarns for the cases
flexible array members in union or al
gcc/testsuite/ChangeLog:
* c-c++-common/fam-in-union-alone-in-struct-1.c: New testcase.
* c-c++-common/fam-in-union-alone-in-struct-2.c: New testcase.
* c-c++-common/fam-in-union-alone-in-struct-3.c: New testcase.
---
.../fam-in-union-alone-in-struct-1.c | 52
Add testing cases to test the _bos for flexible array members in unions
or alone in structures.
gcc/c/ChangeLog:
* c-decl.cc (add_flexible_array_elts_to_size): Handle the cases
when the DECL is union.
gcc/cp/ChangeLog:
* decl.cc (layout_var_decl): Handle the cases when t
On Apr 30, 2024, at 15:29, Jason Merrill wrote:
On 4/30/24 07:58, Qing Zhao wrote:
Add testing cases to test the _bos for flexible array members in unions
or alone in structures.
gcc/c/ChangeLog:
* c-decl.cc (add_flexible_array_elts_to_size): Handle the cases
when the DECL is union.
gcc/cp
On Apr 30, 2024, at 15:27, Jason Merrill wrote:
On 4/30/24 07:58, Qing Zhao wrote:
The request for GCC to accept that the C99 flexible array member can be
in a union or alone in a structure has been made a long time ago around 2012
for supporting several practical cases including glibc.
A GCC
On Apr 30, 2024, at 15:45, Qing Zhao wrote:
gcc/doc/extend.texi | 34 ++
1 file changed, 34 insertions(+)
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 7b54a241a7bf..cba98c8aadd7 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
> On Apr 30, 2024, at 15:52, Jason Merrill wrote:
>
> On 4/30/24 14:49, Qing Zhao wrote:
>>> On Apr 30, 2024, at 15:45, Qing Zhao wrote:
>>>
>>>
>>>
>>>>> gcc/doc/extend.texi | 34 ++
>&g
On Apr 30, 2024, at 17:55, Kees Cook wrote:
On Tue, Apr 30, 2024 at 05:51:20PM -0400, Jason Merrill wrote:
On 4/30/24 14:45, Qing Zhao wrote:
On Apr 30, 2024, at 15:27, Jason Merrill wrote:
On 4/30/24 07:58, Qing Zhao wrote:
The request for GCC to accept that the C99 flexible array member
Hi,
This is the 4th version for
Allow flexible array members in unions and alone in structures [PR53548]
(for your reference, the 1st version is at:
https://gcc.gnu.org/pipermail/gcc-patches/2024-April/649737.html
The 2nd version is at:
https://gcc.gnu.org/pipermail/gcc-patches/2024-April/650019
gcc/testsuite/ChangeLog:
* c-c++-common/fam-in-union-alone-in-struct-1.c: New testcase.
* c-c++-common/fam-in-union-alone-in-struct-2.c: New testcase.
* c-c++-common/fam-in-union-alone-in-struct-3.c: New testcase.
---
.../fam-in-union-alone-in-struct-1.c | 52
The request for GCC to accept that the C99 flexible array member can be
in a union or alone in a structure has been made a long time ago around 2012
for supporting several practical cases including glibc.
A GCC PR has been opened for such request at that time:
https://gcc.gnu.org/bugzilla/show_bu
"add_flexible_array_elts_to_size" and "layout_var_decl" to handle
the cases when the DECL is union.
Add testing cases to test the _bos for flexible array members in unions
or alone in structures.
gcc/c/ChangeLog:
* c-decl.cc (add_flexible_array_elts_to_size): Handle the cases
to support flexible array members
in unions and alone in structures. Adjust testcases for flexible array member
in union and alone in structure extension.
gcc/c/ChangeLog:
* c-decl.cc (finish_struct): Change errors to pedwarns for the cases
flexible array members in union or al
On May 1, 2024, at 09:35, Jason Merrill wrote:
On 5/1/24 08:19, Qing Zhao wrote:
"add_flexible_array_elts_to_size" and "layout_var_decl" to handle
the cases when the DECL is union.
Add testing cases to test the _bos for flexible array members in unions
or alone
Hi,
This is the 5th version for
Allow flexible array members in unions and alone in structures [PR53548]
(for your reference, the 1st version is at:
https://gcc.gnu.org/pipermail/gcc-patches/2024-April/649737.html
The 2nd version is at:
https://gcc.gnu.org/pipermail/gcc-patches/2024-April/650019
The request for GCC to accept that the C99 flexible array member can be
in a union or alone in a structure has been made a long time ago around 2012
for supporting several practical cases including glibc.
A GCC PR has been opened for such request at that time:
https://gcc.gnu.org/bugzilla/show_bu
to support flexible array members
in unions and alone in structures. Adjust testcases for flexible array member
in union and alone in structure extension.
gcc/c/ChangeLog:
* c-decl.cc (finish_struct): Change errors to pedwarns for the cases
flexible array members in union or al
gcc/testsuite/ChangeLog:
* c-c++-common/fam-in-union-alone-in-struct-1.c: New testcase.
* c-c++-common/fam-in-union-alone-in-struct-2.c: New testcase.
* c-c++-common/fam-in-union-alone-in-struct-3.c: New testcase.
---
.../fam-in-union-alone-in-struct-1.c | 52
"add_flexible_array_elts_to_size" C++ FE routine "layout_var_decl" to handle
the cases when the DECL is union.
Add testing cases to test the _bos for flexible array members in unions
or alone in structures.
gcc/c/ChangeLog:
* c-decl.cc (add_flexible_array_elts_to_size): Handle the case
Hi, Sebastian,
Looks like that the behavior you described is correct.
What’s your major concern? ( a little confused).
Qing
On May 6, 2024, at 09:29, Sebastian Huber
wrote:
On 06.05.24 09:08, Richard Biener wrote:
On Sat, 4 May 2024, Sebastian Huber wrote:
On 07.08.23 16:22, Qing Zhao via
2nd Ping for the middle-end change approval. -:)
**Approval status:
All C FE changes have been approved.
**Review status:
All Middle-end changes have been reviewed by Sid, no remaining issue.
Okay for GCC15?
thanks.
Qing
Begin forwarded message:
From: Qing Zhao
Subject: Re
On May 7, 2024, at 10:02, Qing Zhao wrote:
2nd Ping for the middle-end change approval. -:)
**Approval status:
All C FE changes have been approved.
**Review status:
All Middle-end changes have been reviewed by Sid, no remaining issue.
Okay for GCC15?
For convenience, the
wrote:
>
> On 06.05.24 16:20, Qing Zhao wrote:
>> Hi, Sebastian,
>> Looks like that the behavior you described is correct.
>> What’s your major concern? ( a little confused).
>
> I am concerned that the static initialization of structures with flexible
> array members no
On May 7, 2024, at 13:57, Sebastian Huber
wrote:
On 07.05.24 16:26, Qing Zhao wrote:
Hi, Sebastian,
Thanks for your explanation.
Our goal is to deprecate the GCC extension on structure containing a flexible
array member not at the end of another structure. In order to achieve this
goal, we
201 - 300 of 1419 matches
Mail list logo