Hi Jakub, On Thu, Nov 23, 2017 at 10:02:24PM +0100, Jakub Jelinek wrote: > With -mno-altivec -mno-vsx -mno-fold-gimple we error on __builtin_vec* > builtins used when corresponding ISA is not enabled. > When folding gimple, in some cases we get away with it (e.g. when folding > the builtin to PLUS_EXPR on the generic vectors), because > tree-vect-generic.c lowers those into scalar piecewise operations, > but e.g. in case of FMA_EXPR tree-vect-generic.c isn't doing anything, > expects that FMA_EXPR is actually used only if supported, I think similarly > for various vector widening operations etc. > > One option is not to fold into gimple only those builtins where we know it > will not work on generic vectors; my preference is to not fold any builtin > which would be rejected at expansion time, so user get at least consistent > diagnostics. Usually people are using the altivec.h etc. headers that error > if the ISA is not enabled, so this will only affect people that use the > builtins directly.
Yeah I agree. Okay for trunk, thanks! Segher > 2017-11-23 Jakub Jelinek <ja...@redhat.com> > > PR target/82848 > * config/rs6000/rs6000.c (rs6000_gimple_fold_builtin): Don't fold > builtins not enabled in the currently selected ISA. (You forgot changelog for the added testcase).