[Bug tree-optimization/106446] -Warray-bounds false positive on downcast under condition

2022-08-19 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106446

Martin Sebor  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID

--- Comment #2 from Martin Sebor  ---
The compiler doesn't know what D2::is_me() might return so it must emit code
for both branches in bar().  In the true branch, because struct D1 has no
member val, the warning triggers.  This is by design.

[Bug tree-optimization/106446] -Warray-bounds false positive on downcast under condition

2022-07-27 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106446

Martin Liška  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2022-07-27
 CC||marxin at gcc dot gnu.org,
   ||msebor at gcc dot gnu.org
 Status|UNCONFIRMED |NEW

--- Comment #1 from Martin Liška  ---
Started with r10-4300-g49fb45c81f4ac068.