From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6D429385C426; Fri, 17 Apr 2020 13:53:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D429385C426 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587131587; bh=LBXwCtj+JVGDnio3c2Yn/yXb2mqwS7Oredp7dBKE4yU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=MyXXX5UXLTMSXZMauFeLn0uNTWukoew7tY2dGUFVUht5E+NKzauGHIxIK0bCMQPpQ vOMUIN6UslLEwq5IBG7UmpB71XC7Db0COctWWZmgXvcF2yvOTYGYoq5Z2ynDaIA8Ky PiBs7UfC5F6XbYhYqI7iKX5ZPXvltz0Adr3iBuvs= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/93385] [10 Regression] wrong code with u128 modulo at -O2 -fno-dce -fno-ipa-cp -fno-tree-dce Date: Fri, 17 Apr 2020 13:53:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: diagnostic, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: jamborm at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.0 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2020 13:53:07 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D93385 --- Comment #23 from Jakub Jelinek --- Instead of #c11 I meant: - else if ((is_gimple_assign (stmt) && !gimple_has_volatile_ops (stmt= )) - || gimple_code (stmt) =3D=3D GIMPLE_PHI) + else if (flag_tree_dce + && ((is_gimple_assign (stmt) && !gimple_has_volatile_ops (stmt)) + || gimple_code (stmt) =3D=3D GIMPLE_PHI)) because the res =3D -1 handling is in the else after this already. For what Richi is proposing, I guess one needs to run the analysis somewhere (early tree_function_versioning or elsewhere?, note in a hash_set stmts that shouldn't be copied, add pointer to that hash_set to copy_body_data and per= haps in remap_gimple_stmt if the hash_set pointer is non-NULL, check early if st= mt is in it and in that case return NULL (like we already return NULL for debug stmts if we want to drop them). Most likely the lhs of such to be removed statements need to be also added = to id.killed_new_ssa_names (and verify if it works properly).=