This is the mail archive of the gcc-patches@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: [PATCH] Set has_volatile_ops only where neccessary, independent of alias grouping


On Fri, 31 Aug 2007, Diego Novillo wrote:

> 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.

We still do (through get_indirect_ref_operands):

<bb 4>:
  # iftmp.0_1 = PHI <&x(2), &y(3)>
  p_5 = (volatile int *) iftmp.0_1;
  # x_8 = VDEF <x_6(D)>
  # y_9 = VDEF <y_7(D)>
  *p_5 ={v} 3;
  return;

Richard.


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