Summary: | Too strict alias analysis? | ||
---|---|---|---|
Product: | gcc | Reporter: | Robbert <gcc> |
Component: | c | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | CC: | harald |
Priority: | P3 | ||
Version: | 4.9.2 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: |
Description
Robbert
2015-04-06 18:22:59 UTC
There are two separate issues here: the assignment, and the comparison. Assignment to *q (*(&x + 1)) is not allowed, that's still assignment past the end of an object, even if there happens to be a valid object immediately following it in memory. Two pointers comparing as equal does not make them equivalent. There's no bug there. The comparison p == q (&y == &x + 1) gets optimised to 0, and that part is questionable: it may or may not technically be allowed here, but regardless, this optimisation also causes valid code to get miscompiled. That's bug 61502. |