[PATCH][PING^2] Fix for PR59600 (prohibit inlining if no_sanitize_address)

Richard Biener richard.guenther@gmail.com
Tue Feb 4 09:08:00 GMT 2014


On Tue, Feb 4, 2014 at 4:39 AM, Yury Gribov <y.gribov@samsung.com> wrote:
> -------- Original Message --------
> Subject: [PATCH][PING] Fix for PR59600 (prohibit inlining if
> no_sanitize_address)
> Date: Tue, 28 Jan 2014 09:13:10 +0400
> From: Yury Gribov <y.gribov@samsung.com>
> To: GCC Patches <gcc-patches@gcc.gnu.org>
>
> -------- Original Message --------
> Subject: [PATCH] Fix for PR59600
> Date: Tue, 21 Jan 2014 14:42:31 +0400
> From: Yury Gribov <y.gribov@samsung.com>
> To: GCC Patches <gcc-patches@gcc.gnu.org>
>
> Hi,
>
> This patch fixes the problem reported in
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59600 : functions with
> mismatching no_sanitize_address attributes should not be considered for
> inlining, otherwise the meaning of no_sanitize_address will not be
> preserved.
>
> I didn't get feedback in Bugzilla so I'm sending the patch here.
>
> Bootstrapped/regtested on x64.

I think you can't rely on pointer equivalence of the lookup_attribute
result so you want instead of

+  return lookup_attribute ("no_sanitize_address",
+      DECL_ATTRIBUTES (caller)) ==
+    lookup_attribute ("no_sanitize_address",
+      DECL_ATTRIBUTES (callee));

return (lookup_attribute ("no_sanitize_address", DECL_ATTRIBUTES
(caller)) != NULL_TREE)
  == (lookup_attribute ("no_sanitize_address", DECL_ATTRIBUTES
(callee)) != NULL_TREE);

Please also name CIF_OPTION_MISMATCH as CIF_ATTRIBUTE_MISMATCH
and say "function attribute mismatch" in the description.

Thanks,
Richard.

Richard.

> -Y
>
>
>
>
>
>



More information about the Gcc-patches mailing list