https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66206
Bug ID: 66206 Summary: Address of stack memory associated with local variable returned to caller Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: hiraditya at msn dot com Target Milestone: --- Clang static analyzer reported this potential bug. File: gcc/bt-load.c Location: line 234, column 6 Description: Address of stack memory associated with local variable 'x' returned to caller 220 static rtx * 221 find_btr_use (rtx x, rtx *excludep = 0) 222 { 223 subrtx_ptr_iterator::array_type array; 224 FOR_EACH_SUBRTX_PTR (iter, array, &x, NONCONST) 225 { 226 rtx *loc = *iter; 227 if (loc == excludep) 228 iter.skip_subrtxes (); 229 else 230 { 231 const_rtx x = *loc; 232 if (REG_P (x) 233 && overlaps_hard_reg_set_p (all_btrs, GET_MODE (x), REGNO (x))) 234 return loc; // <----- Address of stack memory associated with local variable 'x' returned to caller 235 } 236 } 237 return 0; 238 }