diff options
Diffstat (limited to 'gcc/rtl.h')
-rw-r--r-- | gcc/rtl.h | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -3106,7 +3106,12 @@ extern poly_uint64 subreg_size_lowpart_offset (poly_uint64, poly_uint64); inline bool partial_subreg_p (machine_mode outermode, machine_mode innermode) { - return GET_MODE_PRECISION (outermode) < GET_MODE_PRECISION (innermode); + /* Modes involved in a subreg must be ordered. In particular, we must + always know at compile time whether the subreg is paradoxical. */ + poly_int64 outer_prec = GET_MODE_PRECISION (outermode); + poly_int64 inner_prec = GET_MODE_PRECISION (innermode); + gcc_checking_assert (ordered_p (outer_prec, inner_prec)); + return maybe_lt (outer_prec, inner_prec); } /* Likewise return true if X is a subreg that is smaller than the inner @@ -3127,7 +3132,12 @@ partial_subreg_p (const_rtx x) inline bool paradoxical_subreg_p (machine_mode outermode, machine_mode innermode) { - return GET_MODE_PRECISION (outermode) > GET_MODE_PRECISION (innermode); + /* Modes involved in a subreg must be ordered. In particular, we must + always know at compile time whether the subreg is paradoxical. */ + poly_int64 outer_prec = GET_MODE_PRECISION (outermode); + poly_int64 inner_prec = GET_MODE_PRECISION (innermode); + gcc_checking_assert (ordered_p (outer_prec, inner_prec)); + return maybe_gt (outer_prec, inner_prec); } /* Return true if X is a paradoxical subreg, false otherwise. */ |