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: [PING][RFC][PATCH] RL78 - Add predicates to reduce code bloat when accessing volatile memory.


On Fri, May 9, 2014 at 12:20 PM, DJ Delorie <dj@redhat.com> wrote:
>
> The key to the msp430 change is that I reviewed every pattern that
> used the predicates, and only changed the ones where the pattern was
> known to be volatile-safe.  For the RL78, the devirtualizer may make a
> pattern non-volatile-safe, and many patterns are macros which are not
> always volatile-safe.
>
> So, just changing the predicates is probably not enough.  Did you
> review every pattern that used the changed predicates, to ensure that
> they're each volatile safe?


More than that,  did you review how combine handles volatile memory to
understand why combine does handle volatile memory?

Here is a testcase which combine miscompiles when I tried to have
combine handle volatile:

typedef unsigned long long uint64_t;
typedef unsigned int uint32_t;
union a
{
  uint64_t b;
  uint32_t c[2];
};
void f(int *r, volatile uint64_t *d)
{
  union a e;
  e.b = *d;
  *r = e.c[1];
}

Thanks,
Andrew Pinski


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