From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27746 invoked by alias); 21 Nov 2014 15:11:30 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 27492 invoked by uid 48); 21 Nov 2014 15:11:22 -0000 From: "jamborm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/63551] [4.9/5 Regression] wrong code (segfaults) at -Os on x86_64-linux-gnu Date: Fri, 21 Nov 2014 15:11:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jamborm at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-11/txt/msg02441.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63551 --- Comment #5 from Martin Jambor --- (In reply to Jan Hubicka from comment #3) > indeed, somewhere we need to view convert the aggregate value... Predicates > works on conditions on arguments, so I suppose this ought to happen at > ipa-prop side. Martin? I disagree, ipa-prop jump functions describe what values callers pass to callees, it is the conditions of the predicates that need do describe what then happens to these values, including any conversions. Anyway, I am bootstrapping the following fix: Index: src/gcc/ipa-inline-analysis.c =================================================================== --- src.orig/gcc/ipa-inline-analysis.c +++ src/gcc/ipa-inline-analysis.c @@ -880,6 +880,7 @@ evaluate_conditions_for_known_args (stru } if (c->code == IS_NOT_CONSTANT || c->code == CHANGED) continue; + val = fold_convert (TREE_TYPE (c->val), val); res = fold_binary_to_constant (c->code, boolean_type_node, val, c->val); if (res && integer_zerop (res)) continue;