From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0D66C385841E; Mon, 27 Nov 2023 14:39:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0D66C385841E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701095962; bh=Inn4ZbX2MOVoeCiRIzccazq8ICFJf4lhjy0wvFFdYSU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mmIm5paATSTtBVy1/6k1YjKG0fKk7d+ncX+N2gfHjfs67/ieoWxVLBo8c8uVzpbfe Iwsa1qz4d2TS+2sq6Vwtvb7EGtBTtjZIaOGSChkNHJRavcHZ1dOvfh48xs4d/Qz0aF vIqCjrZU6/54EBK6wP1x3KYZxjudDpRgYHKfj6vM= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/112653] PTA should handle correctly escape information of values returned by a function Date: Mon, 27 Nov 2023 14:39:21 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: unknown X-Bugzilla-Keywords: alias, missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112653 --- Comment #13 from GCC Commits --- The master branch has been updated by Richard Biener : https://gcc.gnu.org/g:f7884f7673444b8a2c10ea0981d480f2e82dd16a commit r14-5879-gf7884f7673444b8a2c10ea0981d480f2e82dd16a Author: Richard Biener Date: Mon Nov 27 10:20:02 2023 +0100 tree-optimization/112653 - PTA and return The following separates the escape solution for return stmts not only during points-to solving but also for later querying. This requires adjusting the points-to-global tests to include escapes through returns. Technically the patch replaces the existing post-processing which computes the transitive closure of the returned value solution by a proper artificial variable with transitive closure constraints. Instead of adding the solution to escaped we track it separately. PR tree-optimization/112653 * gimple-ssa.h (gimple_df): Add escaped_return solution. * tree-ssa.cc (init_tree_ssa): Reset it. (delete_tree_ssa): Likewise. * tree-ssa-structalias.cc (escaped_return_id): New. (find_func_aliases): Handle non-IPA return stmts by adding to ESCAPED_RETURN. (set_uids_in_ptset): Adjust HEAP escaping to also cover escapes through return. (init_base_vars): Initialize ESCAPED_RETURN. (compute_points_to_sets): Replace ESCAPED post-processing with recording the ESCAPED_RETURN solution. * tree-ssa-alias.cc (ref_may_alias_global_p_1): Check the ESCAPED_RETUNR solution. (dump_alias_info): Dump it. * cfgexpand.cc (update_alias_info_with_stack_vars): Update it. * ipa-icf.cc (sem_item_optimizer::fixup_points_to_sets): Likewise. * tree-inline.cc (expand_call_inline): Reset it. * tree-parloops.cc (parallelize_loops): Likewise. * tree-sra.cc (maybe_add_sra_candidate): Check it. * gcc.dg/tree-ssa/pta-return-1.c: New testcase.=