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]

Re: CCP propagating conditional expression constants


On 1/5/07, Sebastian Pop <sebastian.pop@inria.fr> wrote:
Hi,
here is a patch on which I have worked with Basile Starynkevitch
for propagating constants inferred from conditional expressions.
The basic testcase from which we started was something like

if (x == 0)
  a = b / x;

and we wanted to issue an error for the division by zero.
In the process we just remarked that x was not replaced by zero
in the then_clause, and that we have support for warnings for
division by zero only in the front ends, ie. we'll later propose a patch
for such warnings also after CCP and other code transforms on GIMPLE.

The attached patch still causes a libjava failure that I don't know how
to fix.  The error comes from the fact that some of the new
SSA_NAMEs are not marked correctly as occuring in abnormal phi
nodes.  Is there some function that updates these ssa names that I forgot
to use in the attached patch?

VRP does this transformation already (with -O2) and DOM would do so again (and does with -O1).

I don't think we need to complicate CCP with ASSERT_EXPRs.

Richard.


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