Created attachment 21714 [details] problematic inputs Readnone/only pointer attribute detection ignores uses in calls if they are themselves marked as readnon/only. Though, even a readnone pointer use allows the pointer to escape. The test case shows how the wrong attributes are derived when optimized with -functionattrs.