This is the mail archive of the gcc@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: How to debug ssa optimizer


    > I was just about to add a test to check_pointer_types_r to disallow it.

    :-) All you'd have to do is remove the one that's already there.

OK, more is clear now, but there's still a hole.

version_string in c-cppbuiltin.c has an incomplete type.

We're trying to cprop and we make *&version_string.

maybe_fold_stmt_indirect calls maybe_fold_offset_to_array_ref.  I had
modified that to fail if the lower bound is unknown.  But then
maybe_fold_stmt_indirect just folded out the *&B to B.  But that's only safe
if the types were compatible.

If I now changed it to only do the folding if the types are compatible.  But
then it leaves it as *& and get_stmt_operands blows up.

Of course, the proper fix here is to allow maybe_fold_offset_to_array_ref to
operate if TYPE_DOMAIN isn't there because the lower bound should be treated
as zero.  I did that.

But I have two questions:

(1) If maybe_fold_stmt_indirect fails all cases (which I think is at least
theoretically possible), it'll make invalid GIMPLE.  That seems wrong.

(2) Why are there separate fold routines in tree-ssa-ccp.c?  Wouldn't it 
be better to add all these cases into fold and then call it?  Or is the
issue that the cases in fold don't ensure things stay GIMPLE?


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