[Bug c++/86922] Invoking templated PTMF on subclass gives false strict-aliasing warning

2021-07-23 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86922

Andrew Pinski  changed:

   What|Removed |Added

 CC||cassio.neri at gmail dot com

--- Comment #2 from Andrew Pinski  ---
*** Bug 89960 has been marked as a duplicate of this bug. ***

[Bug c++/86922] Invoking templated PTMF on subclass gives false strict-aliasing warning

2018-08-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86922

Richard Biener  changed:

   What|Removed |Added

   Keywords||diagnostic, wrong-code

--- Comment #1 from Richard Biener  ---
It warns about dereferencing

  (int (*) () * *) &((const struct B *) obj)->D.2305

which is built via

#2  0x00b585af in cp_build_indirect_ref_1 (
ptr=, errorstring=RO_NULL, complain=3, 
do_fold=true) at /tmp/trunk/gcc/cp/typeck.c:3155
#3  0x00b58938 in cp_build_fold_indirect_ref (
pointer=) at /tmp/trunk/gcc/cp/typeck.c:3232
#4  0x00b59a5e in get_member_function_from_ptrfunc (
instance_ptrptr=0x7fffc868, function=, 
complain=3) at /tmp/trunk/gcc/cp/typeck.c:3565
#5  0x0097aabd in build_offset_ref_call_from_tree (
fn=, args=0x7fffc958, complain=3)
at /tmp/trunk/gcc/cp/decl2.c:5095
#6  0x00ab9d26 in tsubst_copy_and_build (t=, 
args=, complain=3, 
in_decl=, function_p=false, 
integral_constant_expression_p=false) at /tmp/trunk/gcc/cp/pt.c:18485

the fnptr type has an alias-set that isn't compatible with that of struct B.
Not sure where that int return type comes from ...

Fishy.  And possibly wrong-code afterwards because of that alias set.

[Bug c++/86922] Invoking templated PTMF on subclass gives false strict-aliasing warning

2018-08-13 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86922

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-08-13
 Ever confirmed|0   |1