This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Set has_volatile_ops only where neccessary, independent of alias grouping
- From: "Diego Novillo" <dnovillo at google dot com>
- To: "Richard Guenther" <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 31 Aug 2007 08:46:49 -0400
- Subject: Re: [PATCH] Set has_volatile_ops only where neccessary, independent of alias grouping
- References: <Pine.LNX.4.64.0708311419470.4343@s68.fhfr.qr>
On 8/31/07, Richard Guenther <rguenther@suse.de> wrote:
> Index: tree-ssa-operands.c
> ===================================================================
> *** tree-ssa-operands.c (revision 127968)
> --- tree-ssa-operands.c (working copy)
> *************** add_virtual_operand (tree var, stmt_ann_
> *** 1466,1476 ****
> /* Mark the statement as having memory operands. */
> s_ann->references_memory = true;
>
> - /* Mark statements with volatile operands. Optimizers should back
> - off from statements having volatile operands. */
> - if (TREE_THIS_VOLATILE (sym) && s_ann)
> - s_ann->has_volatile_ops = true;
> -
I'm not sure about this one. If we are adding a volatile name tag to
the statement, it should be marked as having volatile operands.
volatile int *p = (i > 10) ? &x : &y;
*p = 3;
The assignment should be marked as having volatile operands. The tag
for 'p' will be volatile but ISTM that we won't mark the statement
now.