int a[2]; int foo (int q) { if (__builtin_constant_p (q)) { if (q == 4) return a[4]; else return a[0]; } else return a[q]; }
-- Summary: [4.5/4.6 Regression] Warns about out-of-bounds array access inside __builtin_constant_p guarded section Product: gcc Version: 4.5.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rguenth at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44061