This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[0/10] Replace host_integerp and tree_low_cst


After the patch that went in yesterday, all calls to host_integerp and
tree_low_cst pass a constant "pos" argument.  This series replaces each
function with two separate ones:

  host_integerp (x, 0) -> tree_fits_shwi_p (x)
  host_integerp (x, 1) -> tree_fits_uhwi_p (x)
  tree_low_cst (x, 0) -> tree_to_shwi (x)
  tree_low_cst (x, 1) -> tree_to_uhwi (x)

The change is part of the wide-int conversion.  In some ways it's one
of the more bikesheddy parts because, unlike wide_int itself, it just
changes an interface without adding new functionality.  The two main
reasons for doing it IMO are:

1. the new functions are direct analogues of wide-int functions
2. the return type of tree_to_*hwi matches the function name,
   whereas tree_low_cst (x, 1) gets an unsigned value as a signed type

The series is pretty laboured because I wanted to separate out the
large mechanical changes from the small manual changes for ease of review.

Tested by building:

  aarch64-linux-gnueabi alpha-linux-gnu arm-linux-gnueabi c6x-elf
  epiphany-elf ia64-linux-gnu iq2000-elf m32c-elf mep-elf mips-linux-gnu
  picochip-elf powerpc-linux-gnu s390-linux-gnu sparc-linux-gnu
  x86_64-darwin

before and after the patch, checking that there were no new warnings,
and comparing the before and after assembly output at -O2 for gcc.dg,
g++.dg and gcc.c-torture.  Also tested normally on x86_64-linux-gnu
and powerpc64-linux-gnu.

Thanks,
Richard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]