mbox series

[v3,0/4] Allow flexible array members in unions and alone in structures [PR53548]

Message ID 20240430145833.1366425-1-qing.zhao@oracle.com
Headers show
Series Allow flexible array members in unions and alone in structures [PR53548] | expand

Message

Qing Zhao April 30, 2024, 2:58 p.m. UTC
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.html)

compared to the 2nd version, the major difference are:

A. Add two testing cases for _bos per Sid's comments;
B. One update to the C FE routine "add_flexible_array_elts_to_size"
   to handle the cases when the declaration is union.
C. One update the the C++ FE routine "layout_var_decl" to handle
   the cases when the declaratin is a union with a flexible array
   member initializer.

All the above new change is included in the new 4th patch.

Review needed:

   C++ FE changes (in Patch 2 and new Patch 4);
   Middle-end changes (in Patch 2);
   New C FE change (in new Patch 4);
   New testing cases for _bos (in new Patch 4);

Approval status:

   All other changes (C FE and documentation and related testing cases)
   have been approved with minor updates.

The patch set includes:
 1. Documentation change.
    Allow flexible array members in unions and alone in structures
    [PR53548]
 2. C and C++ FE changes to support flexible array members in unions and
   alone in structures.
    Adjust testcases for flexible array member in union and alone in
   structure extension.
 3. Add testing cases for flexible array members in unions and alone in
   structures.
 4. Update the C FE routine "add_flexible_array_elts_to_size" C++ FE
   routine "layout_var_decl"  to handle the cases when the DECL is
   union.
    Add testing cvases to test the _bos for FAM in union and alone in
   structures.

bootstrapped and regression tested on both x86 and aarch64, no issue.

Okay for GCC15?

thanks.

Qing