This is the mail archive of the
mailing list for the GCC project.
Question on Disable no throw for -flive-patching master option.
- From: Qing Zhao <qing dot zhao at oracle dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: Martin Liška <mliska at suse dot cz>, gcc Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 5 Dec 2018 17:16:35 -0600
- Subject: Question on Disable no throw for -flive-patching master option.
- References: <8F7AEFF2-5DCE-49B6-BC9E-34FC0DEF2A55@oracle.com> <email@example.com> <49B97110-C7FD-4569-AE26-1B37951D802B@oracle.com> <ED839E0B-A332-491E-ADC9-D6EC06BECD27@oracle.com> <firstname.lastname@example.org> <5A3304F6-2084-44BA-86CB-88A657AAF741@oracle.com> <email@example.com> <F78B52B9-9F9A-4FA0-91BF-A33307D87AA8@oracle.com> <firstname.lastname@example.org> <06EEEEBB-40EC-47DE-BB30-22784E3E28AF@oracle.com> <email@example.com> <F854D5DD-0754-4019-A7EA-41F087C8DFB7@oracle.com>
I have one question relate to whether to disable nothrow for -flive-patching as following:
actually, there are two passes here:
1. local nothrow pass: in this pass, nothrow attribute is set locally after analyzing every stmt of the function
pass_nothrow::execute (function *)
struct cgraph_node *node;
2. nothrow propagation pass: (it’s included in the ipa_pure_const pass as following, propagate the nothrow
attribute along callcgraph)
execute (function *)
/* Nothrow makes more function to not lead to return and improve
later analysis. */
remove_p = propagate_pure_const ();
return remove_p ? TODO_remove_functions : 0;
the nothrow propagation pass is included in ipa_pure_const pass, and is guarded by flag_ipa_pure_const,
this flag_ipa_pure_const is disabled when -flive-patching is ON.
So, my question is:
shall we disable local nothrow pass as well when -flive-patching is ON?
my understanding is: we should.
the reason is: the local nothrow pass is setting the nothrow attribute for the current routine based on its
body, and this “nothrow” attribute will be used when generating EH code around callsite from the caller
of the routine. so the nothrow attribute might impact other routines than the current routine. as a result,
we should disable this pass?
what’s your opinion on this?
> On Nov 28, 2018, at 2:24 PM, Qing Zhao <firstname.lastname@example.org> wrote:
>> Shall we also disable nothrow or we will worry about C++ only ter?
> This is also mainly for C++ applications, so currently should not be a problem.
> But I can add a separate simple patch to add another flag to control nothrow propagation and disable it when -flive-patching is ON.
>> Patch is OK,
> thanks for the review.
> I will commit the patch very soon.