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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-11-03

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I've added

cc1: note: destination object is likely at address zero

which indicates that we performed some jump threading that exposes a literal
NULL pointer we diagnose this on.  I see

(gdb) p debug_gimple_stmt (exp)
# .MEM_230 = VDEF <.MEM_252>
__atomic_store_4 (8B, 0, 0);

on the path

...

<bb 13> [local count: 14148527]:
_35 = __atomic_wide_counter_load_relaxed (&_dlfo_loaded_mappings_version); //
dl-find_object.c:260:10
_36 = (int) _35;
active_idx_37 = _36 & 1;
current_seg_38 = _dlfo_loaded_mappings[active_idx_37];
_347 = active_idx_37 ^ 1;
pretmp_348 = _dlfo_loaded_mappings[_347];
if (current_seg_38 != 0B) // dl-find_object.c:137:21
  goto <bb 84>; [94.50%]
else
  goto <bb 72>; [5.50%]

<bb 84> [local count: 13370358]:
goto <bb 23>; [100.00%]

... some loop ...

<bb 24> [local count: 13370358]:
# count_247 = PHI <count_147(93), count_246(95)>
remaining_to_add_43 = count_247 + prephitmp_317; // dl-find_object.c:662:10
if (pretmp_348 != 0B) // dl-find_object.c:150:14
  goto <bb 96>; [89.00%]
else
  goto <bb 27>; [11.00%]

<bb 27> [local count: 1470739]:
if (remaining_to_add_43 != 0) // dl-find_object.c:668:8
  goto <bb 98>; [47.09%]
else
  goto <bb 35>; [52.91%]

<bb 35> [local count: 778169]:
__sync_synchronize ();
__atomic_store_4 (8B, 0, 0); // [dl-find_object.c:644:132
goto <bb 38>; [100.00%]

Reply via email to