Fix internal error on store to FP component at -O2
This is about a GIMPLE verification failure at -O2 or above because
the GIMPLE store merging pass generates a NOP_EXPR between a FP type
and an integral type. This happens when the bit-field insertion path
is taken for a FP field, which can happen in Ada for bit-packed record
types.
It is fixed by generating an intermediate VIEW_CONVERT_EXPR. The patch
also tames a little the bit-field insertion path because, for bit-packed
record types in Ada, you can end up with large bit-field regions, which
results in a lot of mask-and-shifts instructions.
gcc/ChangeLog
* gimple-ssa-store-merging.c (merged_store_group::can_be_merged_into):
Only turn MEM_REFs into bit-field stores for small bit-field regions
(imm_store_chain_info::output_merged_store): Be prepared for sources
with non-integral type in the bit-field insertion case.
(pass_store_merging::process_store): Use MAX_BITSIZE_MODE_ANY_INT as
the largest size for the bit-field case.
gcc/testsuite/ChangeLog
* gnat.dg/opt84.adb: New test.