Comment 6 for bug 936863

Revision history for this message
Ulrich Weigand (uweigand) wrote :

The memory size is not always known. In 4.6, MEM_SIZE returned an rtx, which was either a CONST_INT rtx, or NULL to indicate unknown memory size. In 4.7, the accessor macros were rewritten, and MEM_SIZE now always returns a HOST_WIDE_INT directly; to indicate the case of unknown memory size, there is now an extra macro MEM_SIZE_KNOWN_P (if this returns true, MEM_SIZE will always return 0).

The code in config/arm/arm.c:arm_print_operand for the 'A' output modifier neglects to check for the case of unknown memory size. In 4.7, this happens to be harmless, since unknown memory size will cause MEM_SIZE to return 0, which cases arm_print_operand to simply fall through to its default case and not output any alignment hint. However, in 4.6, this scenario causes a crash due to dereferencing the NULL MEM_SIZE rtx.

This code ought to be fixed to explicity check for unknown memory size (via MEM_SIZE_KNOWN_P in 4.7 / MEM_SIZE == NULL in 4.6), and omit alignment hints in that case.

A separate question might be why memory size is unknown here. The weird "void[16]" type might have something to do with that ...