bug in expr.c?

Jeffrey A Law law@cygnus.com
Tue Feb 10 03:34:00 GMT 1998


  In message < 19980209233414.16572@dgii.com >you write:
  > I was cleaning up warnings expr.c and believe this to be a bug.   Can
  > anyone that actually understands this confirm or deny this?
  > 
  > expand_assignment()
  > 
  >       if (TREE_CODE (to) == COMPONENT_REF
  >           && TREE_READONLY (TREE_OPERAND (to, 1)))
  >         {
  >           if (offset = 0)
  >             to_rtx = copy_rtx (to_rtx);
  > 
  >           RTX_UNCHANGING_P (to_rtx) = 1;
  >         }
  > 
  > That copy_rtx will never ever be called, right?
  > 
  > Is the "obvious" fix of "offset == 0" correct?
Correct.  If you look a little above that line you'll see something like
this:

              /* When the offset is zero, to_rtx is the address of the
                 structure we are storing into, and hence may be shared.
                 We must make a new MEM before setting the volatile bit.  */
              if (offset == 0)
                to_rtx = copy_rtx (to_rtx);

              MEM_VOLATILE_P (to_rtx) = 1;

It's basically the same issue, except that we're setting the readonly bit.


jeff



More information about the Gcc mailing list