This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc4.7.2: try/finally, CLOBBER
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: vini at cse dot iitb dot ac dot in, GCC Mailing List <gcc at gcc dot gnu dot org>, rohanpadhye at cse dot iitb dot ac dot in
- Date: Thu, 30 May 2013 15:37:29 -0700
- Subject: Re: gcc4.7.2: try/finally, CLOBBER
- References: <CA+sMaqaLXBop0E=1fXMYbyw2Dqf4aaSjrGLPKe5oYr0oth054A at mail dot gmail dot com> <CAKOQZ8wosr5UyULFDCEBTob+jeMLmwPCn8cx4PKowTs3Hu7XXQ at mail dot gmail dot com>
On Thu, May 30, 2013 at 3:31 PM, Ian Lance Taylor <iant@google.com> wrote:
> On Thu, May 30, 2013 at 2:07 AM, Vini Kanvar <vini@cse.iitb.ac.in> wrote:
>>
>> gcc-4.7.2 adds exception handling constructs (try/finally block) for
>> pointer and array variables. These variables are CLOBBERed in the
>> finally block.
>
> I'm not sure what you mean by this. An example might help.
I think he means assignments like:
a = CLOBBER;
>
>> What is the meaning and use of CLOBBER? In which cases is it required?
>> What will happen if gcc does not CLOBBER these variables (e.g.
>> gcc-4.6.2 does not add try/finally and CLOBBER in the gimple code. How
>> does gcc-4.6.2 deal with such variables?).
>
> In RTL CLOBBER simply means that the value is unimportant and
> meaningless. If a CLOBBER is omitted it means that GCC will 1)
> preserve the value in the register; 2) assume that the value in the
> register has been preserved.
In GCC 4.7.2 CLOBBER on the tree level means the variable has gone out
of scope. This is for expanding to RTL so some variables can share
the same stack location.
It is also used by the tree level optimizations to know that after the
CLOBBER statement the variable is no longer a live. This is just like
the idea of RTL clobber but for tree decls instead.
Thanks,
Andrew