https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81044
Bug ID: 81044 Summary: fold-const change in svn 248447 breaks PowerPC spec 2006 hmmr Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: meissner at gcc dot gnu.org Target Milestone: --- Created attachment 41527 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41527&action=edit hmmio.i file that was used. I was running spec 2006 benchmarks on a little endian power8 system, and I noticed that the 456.hmmer benchmark doesn't run starting with subversion id 248447. Note, in order to get it to fail, you need to use the -mveclibabi=mass option to vectorize math functions and use the MASS 8.1.3 libraries. I traced this down the hmmio.c module getting miscompiled when -O2 or higher is used. Note, the hmmio.c function does not call any of the vectorized math functions, but it needs other modules to use them. I haven't looked at all of the differences, but the changes for the code generated for line 664 seem to be wrong. It is collapsing two different 32-bit compares into one 64-bit compare and then doing a MCRF (move condition register) instruction to duplicate the test. This is the ChangeLog for the 248446 change: 2017-05-25 Marc Glisse <marc.gli...@inria.fr> * fold-const.c (fold_binary_loc) [(A & C) == D]: Remove transformation. * match.pd (X == C): Rewrite it here. (with_possible_nonzero_bits, with_possible_nonzero_bits2, with_certain_nonzero_bits2): New predicates. * tree-ssanames.c (get_nonzero_bits): Handle INTEGER_CST.