Hi! On Mon, Nov 26, 2018 at 08:41:24AM +0700, Arseny Solokha wrote: > > On Fri, Nov 23, 2018 at 06:15:47PM +0700, Arseny Solokha wrote: > >> I've found recently that rs6000 and powerpcspe backends can easily trip > >> over > >> various gcc_unreachable()'s and gcc_assert()'s in their respective copies > >> of > >> print_operand() when provided with some invalid assembly (i.e. assembly > >> written > >> for other architectures). > > > > Yup. They should use output_operand_lossage instead. > > Isn't it something that should be mentioned in the Internals manual?
It is a general principle that the compiler should only ICE for an internal error, so never for unexpected use input. Most existing backends use output_operand_lossage, so everyone writing a new backend should see it, anyway. > > Bonus points if you can find some way to test > > this in the testsuite (preferably for all targets), testing many kinds > > of input args (reg, imm, memory) and all output modifiers. > > For now I use a trivial script that simply tries to compile everything it > finds, > each file with a new set of -mcpu value, optimization options and --param > options. Maybe enhancing the testsuite to facilitate some kind of fuzzing out > of > the box could be a proper task for the GSoC? See what Jakub committed in r266515, maybe you can do something like that for all targets and all modifier letters? Any error is correct, just not an ICE? https://gcc.gnu.org/viewcvs/gcc/trunk/gcc/testsuite/gcc.target/powerpc/pr88188.c?view=markup&pathrev=266515 Segher