public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/49563] New: Expansion forgets to set MEM_VOLATILE_P for TARGET_MEM_REF
@ 2011-06-28  9:06 baldrick at gcc dot gnu.org
  2011-06-28  9:18 ` [Bug middle-end/49563] " rguenth at gcc dot gnu.org
  2021-09-12  8:41 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: baldrick at gcc dot gnu.org @ 2011-06-28  9:06 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49563

           Summary: Expansion forgets to set MEM_VOLATILE_P for
                    TARGET_MEM_REF
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: baldrick@gcc.gnu.org


In expr.c, this code

        if (TREE_THIS_VOLATILE (exp))
          MEM_VOLATILE_P (temp) = 1;

sets MEM_VOLATILE_P for a volatile MEM_REF.  But this is not done for a
volatile
TARGET_MEM_REF.  This doesn't matter right now because tree-ssa-loop-ivopts.c
bails out if it sees a volatile memory reference, so volatile TARGET_MEM_REFs
don't (yet) occur in the wild.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug middle-end/49563] Expansion forgets to set MEM_VOLATILE_P for TARGET_MEM_REF
  2011-06-28  9:06 [Bug middle-end/49563] New: Expansion forgets to set MEM_VOLATILE_P for TARGET_MEM_REF baldrick at gcc dot gnu.org
@ 2011-06-28  9:18 ` rguenth at gcc dot gnu.org
  2021-09-12  8:41 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-06-28  9:18 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49563

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu.org

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-06-28 09:18:30 UTC ---
It looks like set_mem_attributes () will set it via a similar check.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug middle-end/49563] Expansion forgets to set MEM_VOLATILE_P for TARGET_MEM_REF
  2011-06-28  9:06 [Bug middle-end/49563] New: Expansion forgets to set MEM_VOLATILE_P for TARGET_MEM_REF baldrick at gcc dot gnu.org
  2011-06-28  9:18 ` [Bug middle-end/49563] " rguenth at gcc dot gnu.org
@ 2021-09-12  8:41 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-12  8:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49563

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
    case TARGET_MEM_REF:
      {
        addr_space_t as
          = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (TREE_OPERAND (exp, 0))));
        unsigned int align;

        op0 = addr_for_mem_ref (exp, as, true);
        op0 = memory_address_addr_space (mode, op0, as);
        temp = gen_rtx_MEM (mode, op0);
        set_mem_attributes (temp, exp, 0);

.....
void
set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
                                 poly_int64 bitpos)
{
...
  /* If T is not a type, we may be able to deduce some more information about
     the expression.  */
  if (! TYPE_P (t))
    {
      tree base;

      if (TREE_THIS_VOLATILE (t))
        MEM_VOLATILE_P (ref) = 1;
----- CUT ----
The code in set_mem_attributes has been there since Oct 2001 (r0-37666, 3.1.0)


The code to call set_mem_attributes has not changed since Aug 2010, r0-102267
(when TMR_ORIGINAL was removed and instead of calling set_mem_attributes on
TMR_ORIGINAL, it is called on the TMR itself).

So GCC is doing the correct thing for TARGET_MEM_REF as Richard Biener reported
in comment #1.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-12  8:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-28  9:06 [Bug middle-end/49563] New: Expansion forgets to set MEM_VOLATILE_P for TARGET_MEM_REF baldrick at gcc dot gnu.org
2011-06-28  9:18 ` [Bug middle-end/49563] " rguenth at gcc dot gnu.org
2021-09-12  8:41 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).