https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108448

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I do notice some aliasing violations with y_map_index and
y_strucon_handleErrorHelper


 y_vec* stack;
...
      y_map_existsStringKey_v(d->contexts, ("com.yzena.yc.error_handler"),
                              &stack))
...

y_map_existsStringKey_v takes a void* and passes it to:
 ret = (y_map_index(m, &str,
# 896 "yc/src/container/map.c" 3 4
                            ((void *)0)
# 896 "yc/src/container/map.c"
                                , val_ptr) != ((y_usize) -1));


While y_map_index's last argument is y_uchar** and you do the store as y_uchar*
inside y_map_index:
   *val_ptr = ((m)->map[(arrayIdx)] + (itemIdx) * (m->esize));

------ CUT -----

I suspect cmake didn't add -fno-strict-aliasing really.

Can you try:
   *(void**)val_ptr = ((m)->map[(arrayIdx)] + (itemIdx) * (m->esize));


Note GCC extends aliasing here where "void*" is treated similarly as a
character type with respect to aliasing.

Reply via email to