gnu/gcc/bfedd20faaab8ee827db47c1b2e3f879fd8ba808 Downgrade IFN_ASSUME from const to pure
This patch changes IFN_ASSUME to be pure instead of const. The const
attribute means (not only) that the function cannot read global memory.
While this is true for the internal call itself, it is only a dispatcher
for the outlined assume body, which may read any memory, e.g. below:
```
struct S
{
int x, y;
};
bool bar (int, int);
bool
foo (struct S *s)
{
[[assume (bar (s->x, s->y))]];
return s->x;
}
```
Now, the read does not actually happen in reality, as the assume's body
does not make into the final binary, but the call being marked
incorrectly as const makes our analysis less accurate.
PR ipa/127104
gcc/ChangeLog:
* internal-fn.def (ASSUME): Downgrade from const to pure.
Signed-off-by: Josef Melcr <josef.melcr@suse.com>
1 file changed