This is the mail archive of the gcc-bugs@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]

Re: Your June 7 change to expand_expr


    In particular, to the bit about a dereference of a REFERENCE_TYPE be
    always considered to be in a structure.  I don't know exactly *why*
    this was causing the problem, although I'm guessing it's because EGCS
    does some alias analysis that looks at MEM_IN_STRUCT_P.

The fundamental problem is that there needs to be a "conservative"
setting, one for which we can safely make things without risking
bugs.  This used to be the case when that bit is true.

    Why should all references be considered as possibly pointing into
    structures?  If they should be, why shouldn't pointers?

The case that prompted this is in Ada and I don't know enough C++
to translate it.

    The next hunk:

	    /* This may have been an array reference to the first element
	       that was optimized away from being an addition.  */
	    || (TREE_CODE (exp1) == NOP_EXPR
		&& ((TREE_CODE (TREE_TYPE (TREE_OPERAND (exp1, 0)))
		     == REFERENCE_TYPE)
		    || ((TREE_CODE (TREE_TYPE (TREE_OPERAND (exp1, 0)))
			 == POINTER_TYPE)
			&& (AGGREGATE_TYPE_P
			    (TREE_TYPE (TREE_TYPE
					(TREE_OPERAND (exp1, 0))))))))

    also seems suspicious to me.  Besides the reference issue, how do we
    know whether the NOP_EXPR was the degenerate addition case mentioned?

We can't.  That's the whole problem with the flag.

    Jeff, for now I recommend the following patch to EGCS.

My recommendation, since EGCS is getting much better alias analysis,
is simply to *delete* the flag since it's totally impossible to set
it accurately and it becomes much less relevant with better alias
analysis.


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