This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: DCE eliminating valid statement for ACATS c34007p
- From: Paul Brook <paul at codesourcery dot com>
- To: gcc at gcc dot gnu dot org
- Cc: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>,stevenb at suse dot de
- Date: Tue, 6 Sep 2005 15:06:01 +0100
- Subject: Re: DCE eliminating valid statement for ACATS c34007p
- References: <10509061350.AA06050@vlsi1.ultra.nyu.edu>
> But secondly, why make that restriction at all? Suppose I have a function
> to which a language semantics requires passing by reference. Now suppose
> the operand is "a + b". Why not just make an ADDR_EXPR of the PLUS_EXPR?
>
> Sure, the front end *could* make a temporary, but the gimplifier has all
> the logic already to do that, so why shouldn't it?
>
> The whole point of the gimplifier is to avoid making too many restrictions
> on what are valid trees: it's GIMPLE where we want to make those
> restrictions. It seems very duplicative to me to say that the process of
> creating temporaries for certain expressable trees is the job of the front
> end and for others is the job of the gimplifier? Why not just be
> consistent and say it's the gimplifier's job to do all of them?
But only where the semantics are well defined. I can think of several
different possible semantics for talking the address of arbitrary things.
Consider "foo(&(a+b), &(a+b))"
Is it ok to pass the same address for both arguments?
Should the location pointed to be modifiable or readonly?
IMHO it's best to make things like this explicit. That way there's no
disagreement over which language defined semantics we should be using.
Paul