https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93126
Bug ID: 93126 Summary: PPC altivec -Wunused-but-set-variable false positive Product: gcc Version: 8.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: jens.seifert at de dot ibm.com Target Milestone: --- Input: #include <altivec.h> double vmax(double a, double b) { #ifdef _BIG_ENDIAN const long PREF = 0; #else const long PREF = 1; #endif vector double va = vec_promote(a,PREF); vector double vb = vec_promote(b,PREF); return vec_extract(vec_max(va, vb), PREF); } gcc -O2 -maix64 -mcpu=power7 -maltivec -Wall warn.C: In function 'double vmax(double, double)': warn.C:6:15: warning: variable 'PREF' set but not used [-Wunused-but-set-variable] const long PREF = 0; ^~~~