mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-12-21 16:29:31 +00:00
Don't attempt bogus common subexpression elimination when loading structures on the stack.
Previously, the structure load would be treated as a common subexpression eligible for elimination, but the structure would always be treated as if it had a size of 4 bytes. If it did not, this would generally lead to a crash. (I'm also not sure if dependency analysis was being performed properly for these structures.) The following program illustrates the problem: #pragma optimize 17 struct mystruct { char x; } ms; static void foo(struct mystruct pk) {} int main(void) { struct mystruct *p = &ms; foo(*p); foo(*p); }
This commit is contained in:
parent
c46cf79c79
commit
e242f03501
Loading…
Reference in New Issue
Block a user