Message ID | 20200109235205.GA30103@ibm-toto.the-meissners.org |
---|---|
State | New |
Headers | show |
Series | V12 patch #1 of 14, add gcc_asserts for rs6000_adjust_vec_address | expand |
Hi! On Thu, Jan 09, 2020 at 06:52:05PM -0500, Michael Meissner wrote: > 2020-01-09 Michael Meissner <meissner@linux.ibm.com> > > * config/rs6000/rs6000.c (rs6000_adjust_vec_address): Add some > gcc_asserts. > + /* All insns should use the 'Q' constraint (address is a single register) > + if the element number is not a constant. */ > + gcc_assert (REG_P (addr) || SUBREG_P (addr)); So maybe you should just more directly say gcc_assert (satisfies_constraint_Q (addr)); ? The Q constraint does not allow subregs, btw, is that an oversight? Okay for trunk either way. Thanks! Segher
--- /tmp/kXfaUP_rs6000.c 2020-01-08 13:59:48.664454496 -0500 +++ gcc/config/rs6000/rs6000.c 2020-01-08 13:59:45.593410764 -0500 @@ -6772,6 +6772,9 @@ rs6000_adjust_vec_address (rtx scalar_re rtx new_addr; bool valid_addr_p; + gcc_assert (!reg_mentioned_p (base_tmp, addr)); + gcc_assert (!reg_mentioned_p (base_tmp, element)); + /* Vector addresses should not have PRE_INC, PRE_DEC, or PRE_MODIFY. */ gcc_assert (GET_RTX_CLASS (GET_CODE (addr)) != RTX_AUTOINC); @@ -6781,6 +6784,10 @@ rs6000_adjust_vec_address (rtx scalar_re element_offset = GEN_INT (INTVAL (element) * scalar_size); else { + /* All insns should use the 'Q' constraint (address is a single register) + if the element number is not a constant. */ + gcc_assert (REG_P (addr) || SUBREG_P (addr)); + int byte_shift = exact_log2 (scalar_size); gcc_assert (byte_shift >= 0);