On Fri, May 9, 2014 at 12:20 PM, DJ Delorie <[email protected]> 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