From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116749 invoked by alias); 11 Jun 2015 14:34:55 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 116736 invoked by uid 89); 11 Jun 2015 14:34:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-HELO: DUB004-OMC4S24.hotmail.com Received: from dub004-omc4s24.hotmail.com (HELO DUB004-OMC4S24.hotmail.com) (157.55.2.99) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA256 encrypted) ESMTPS; Thu, 11 Jun 2015 14:34:53 +0000 Received: from DUB118-W46 ([157.55.2.72]) by DUB004-OMC4S24.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Thu, 11 Jun 2015 07:34:50 -0700 X-TMN: [NKOjhiPaUlTLw21ovLV76Oz5d2IrBUNp] Message-ID: From: Bernd Edlinger To: Jakub Jelinek CC: "gcc-patches@gcc.gnu.org" , Richard Biener , Jeff Law , Eric Botcazou Subject: RE: [RFC] Sanitize rtx_addr_can_trap_p_1 Date: Thu, 11 Jun 2015 14:38:00 -0000 In-Reply-To: <20150611105734.GV10247@tucnak.redhat.com> References: ,<20150611080203.GT10247@tucnak.redhat.com>,,<20150611105734.GV10247@tucnak.redhat.com> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2015-06/txt/msg00848.txt.bz2 Hi, On Thu, 11 Jun 2015 12:57:34 +0200, Jakub Jelinek wrote: > > On Thu, Jun 11, 2015 at 12:38:40PM +0200, Bernd Edlinger wrote: >> On Thu, 11 Jun 2015 10:02:03, Jakub Jelinek wrote: >>> >>> IMHO the >>> #if 0 >>> #endif >>> stuff doesn't belong to the patch. >>> >> >> I just wanted to leave a hint, how I debugged this function, and how >> to assess the performance of the decision that is taken here. > > What I usually do in these cases is something like: > FILE *f =3D fopen ("/tmp/mylogfile", "a"); > fprintf (f, "%s %d ...\n", main_input_filename ? main_input_filename : "-= ", (int) BITS_PER_WORD, ...); > fclose (f); > and do full bootstrap/regtest (usually both x86_64-linux and i686-linux) > with it, then look at the log file. > But I keep those for myself, don't keep them even as comments. > In this case, you could post the hack as incremental patch for interested > folks to test on their architecture, but I'm not convinced we want to keep > it in the source, whether #if 0 or in a comment. > I am not too sure about it either. But I think, it is quite helpful data, however I am even tempted to add the name of the current function, and the pass we are in at the mome= nt, but I have no idea how to grab that information... > So, for a full bootstrap/regtest, how many log messages do you get, and a= re > they always resolved conservatively (i.e. if unsure the offset is ok, ret= urn > 1)? > In stage 2 of the build (with all languages) I get: 2930 messages of the form *** frame can trap: offset=3D16, size=3D8, low_bound=3D-3152, high_bound=3D0 74 messages of the form *** sp can trap: offset=3D112, size=3D4, low_bound=3D-144, high_bound=3D112 202 messages of the from *** argp can trap: offset=3D16, size=3D8, low_bound=3D-56, high_bound=3D16 10 messages of the form *** fp can trap: offset=3D40, size=3D4, low_bound=3D-264, high_bound=3D24 My patch does not change the handling of frame_pointer_rtx, except that it avoids a possible integer overflow in "adj_offset + size - 1= >=3D 0" so these 2930 suppressed optimizations were already introduced by Eric's pa= tch. I think that is probably a new effect, that [FP+x] is now used more often than before to access values at [ARGP+x]. I have not tried, but maybe it would be possible to use the crtl->args.size, here too, to get more optimistic upper bounds on the argument sizes. So all in all my patch changed 286 times the return value of rtx_addr_can_t= rap_p_1 in the whole pass 2. But OTOH there are millions of times, where the rtx_addr_can_trap_p_1 returns 0, which is rtx can not trap. Bernd. =20=09=09=20=09=20=20=20=09=09=20=20