[Bug c/114713] incorrect TBAA for struct with flexible array member or GNU zero size

2025-04-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114713

--- Comment #6 from GCC Commits  ---
The releases/gcc-14 branch has been updated by Eric Botcazou
:

https://gcc.gnu.org/g:5457388f58262bee41ae1d744ff6f3da34119e2d

commit r14-11611-g5457388f58262bee41ae1d744ff6f3da34119e2d
Author: Eric Botcazou 
Date:   Mon Apr 14 23:35:43 2025 +0200

Revert very recent backport of changes to the type system

The backport of the change made for PR c/113688 onto the 14 branch a couple
of weeks ago has seriously broken the LTO compiler for the Ada language on
the 14 branch, because it changes the GCC type system for the sake of C in
a way that is not compatible with simple discriminated types in Ada.  To be
more precise, useless_type_conversion_p now returns true for some (view-)
conversions that are needed by the rest of the compiler.

gcc/
PR lto/119792
Revert

Backported from master:
2024-12-12  Martin Uecker  

PR c/113688
PR c/114014
PR c/114713
PR c/117724
* tree.cc (gimple_canonical_types_compatible_p): Add exception.
(verify_type): Add exception.

gcc/lto/
PR lto/119792
Revert

Backported from master:
2024-12-12  Martin Uecker  
* lto-common.cc (hash_canonical_type): Add exception.

gcc/testsuite/
* gcc.dg/pr113688.c: Delete.
* gcc.dg/pr114014.c: Likewise.
* gcc.dg/pr114713.c: Likewise.
* gcc.dg/pr117724.c: Likewise

[Bug c/114713] incorrect TBAA for struct with flexible array member or GNU zero size

2025-03-30 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114713

--- Comment #5 from GCC Commits  ---
The releases/gcc-14 branch has been updated by Martin Uecker
:

https://gcc.gnu.org/g:73549be0a3c819b2ab78e0e973f5b4d41b9f4a2d

commit r14-11478-g73549be0a3c819b2ab78e0e973f5b4d41b9f4a2d
Author: Martin Uecker 
Date:   Sat Nov 23 08:04:05 2024 +0100

Fix type compatibility for types with flexible array member 2/2
[PR113688,PR114713,PR117724]

For checking or computing TYPE_CANONICAL, ignore the array size when it is
the last element of a structure or union.  To not get errors because of
an inconsistent number of members, zero-sized arrays which are the last
element are not ignored anymore when checking the fields of a struct.

PR c/113688
PR c/114014
PR c/114713
PR c/117724

gcc/ChangeLog:
* tree.cc (gimple_canonical_types_compatible_p): Add exception.

gcc/lto/ChangeLog:
* lto-common.cc (hash_canonical_type): Add exception.

gcc/testsuite/ChangeLog:
* gcc.dg/pr113688.c: New test.
* gcc.dg/pr114014.c: New test.
* gcc.dg/pr114713.c: New test.
* gcc.dg/pr117724.c: New test.

(cherry picked from commit d46c7f313b5a30ee04080f249e31e12987d50aa2)

[Bug c/114713] incorrect TBAA for struct with flexible array member or GNU zero size

2024-12-12 Thread uecker at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114713

uecker at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

--- Comment #4 from uecker at gcc dot gnu.org ---
Fixed on trunk.

[Bug c/114713] incorrect TBAA for struct with flexible array member or GNU zero size

2024-12-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114713

--- Comment #3 from GCC Commits  ---
The master branch has been updated by Martin Uecker :

https://gcc.gnu.org/g:d46c7f313b5a30ee04080f249e31e12987d50aa2

commit r15-6170-gd46c7f313b5a30ee04080f249e31e12987d50aa2
Author: Martin Uecker 
Date:   Sat Nov 23 08:04:05 2024 +0100

Fix type compatibility for types with flexible array member 2/2
[PR113688,PR114713,PR117724]

For checking or computing TYPE_CANONICAL, ignore the array size when it is
the last element of a structure or union.  To not get errors because of
an inconsistent number of members, zero-sized arrays which are the last
element are not ignored anymore when checking the fields of a struct.

PR c/113688
PR c/114014
PR c/114713
PR c/117724

gcc/ChangeLog:
* tree.cc (gimple_canonical_types_compatible_p): Add exception.

gcc/lto/ChangeLog:
* lto-common.cc (hash_canonical_type): Add exception.

gcc/testsuite/ChangeLog:
* gcc.dg/pr113688.c: New test.
* gcc.dg/pr114014.c: New test.
* gcc.dg/pr114713.c: New test.
* gcc.dg/pr117724.c: New test.

[Bug c/114713] incorrect TBAA for struct with flexible array member or GNU zero size

2024-10-27 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114713

Sam James  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2024-10-27
 Ever confirmed|0   |1
  Component|lto |c