[Bug middle-end/93644] [10 Regression] spurious -Wreturn-local-addr with PHI of PHI
law at redhat dot com
gcc-bugzilla@gcc.gnu.org
Mon Feb 10 22:22:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644
Jeffrey A. Law <law at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |law at redhat dot com
--- Comment #5 from Jeffrey A. Law <law at redhat dot com> ---
WRT c#2, yes it's a reasonable deduction, but the warning and the point where
we have the asserts are in two different passes. ie, the info isn't really
available when we need it.
What we might be able to do is see the assert:
buffer_16 = ASSERT_EXPR <buffer_3, buffer_3 != &stack_buf>;
Then look at the DEF point for buffer_3:
# buffer_3 = PHI <&stack_buf(3), buffer_8(D)(9)>
Which means at the point of the assertion that buffer_16 can only have the
value buffer_8 and replace the assert with
buffer_16 = buffer_8
That would in turn allow the use of buffer_16 in the problematic PHI to be
replaced with buffer_8 and avoid the problem
We have to be careful and ensure that doesn't break the SSA form (it's safe in
this example because buffer_8 is the default def).
More information about the Gcc-bugs
mailing list