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]

[PATCH] Fix a couple mismatch types in build_range_check


This patch fixes both PR 21076 and PR 22398. Both issues were in build_range_check
which is why I took Kenner's patch and fixed it up (there was one bug in his original
patch which I fixed).


There are two problems here, the first is that build_range_check was not converting
one of the operands to the correct type which caused an ICE in VRP.
The second issue is that if we have a subtype we use the the subtype's type
instead of more correct type which cannot be the subtype as we end up with
values out of range. This was Kenner's patch. We should be able to remove
the hack in VRP after this fix.


OK? Bootstrapped and tested on powerpc-darwin with no regressions.

Thanks,
Andrew Pinski

ChangeLog:

2005-07-11  Andrew Pinski  <pinskia@physics.uc.edu>
            Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* fold-const.c (build_range_check): Convert high/low to etype
	if we are only comparing against exp.
	Use the supper type if we have one for integral type for the
	subtraction.

Attachment: t5.diff.txt
Description: Text document


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