From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16010 invoked by alias); 15 Oct 2013 18:47:59 -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 15950 invoked by uid 48); 15 Oct 2013 18:47:56 -0000 From: "amacleod at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/58697] [4.8/4.9 Regression] wrong code (segfaults) at -O3 Date: Tue, 15 Oct 2013 18:47: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: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: amacleod at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.2 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created 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: 2013-10/txt/msg00929.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58697 --- Comment #4 from Andrew Macleod --- Created attachment 31013 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31013&action=edit patch to re-introduce the error OK, I found my error :-P sigh. estimated_loop_iterations and max_loop_iterations were split into get_ version for the cfgloop routines. there are also _int versions of those routines, and estimated_loop_iterations_int got moved to cfgloop.c. max_loop_iterations_int did not. when estimated_loop_iterations_int got moved, it also was changed to call get_estimated_loop_iterations like a good cfgroutine. so when tree-ssa-unswitch calls it, it doesn't calculate like it should. In any case, I think I have the mess sorted out now. I've added get_ version for both _int routines as well. All cfg* routines use 'get_' versions, and all tree- versions use the non-'get_' version, with the exception of the 2 routines which actually calculate the values.. they use the get_ version as a fallback (which is where the factoring came from). too hard on the head :-) If I apply this patch, the run time error comes back :-) seems so backwards somehow :-) Anyway, I'm running it through regressions and bootstrapping.