From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9785 invoked by alias); 2 Apr 2010 11:47:44 -0000 Received: (qmail 9606 invoked by uid 48); 2 Apr 2010 11:47:24 -0000 Date: Fri, 02 Apr 2010 11:47:00 -0000 Message-ID: <20100402114724.9605.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/43629] [4.3/4.4 Regression] Struct to register optimization fails In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" 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 X-SW-Source: 2010-04/txt/msg00194.txt.bz2 ------- Comment #2 from rguenth at gcc dot gnu dot org 2010-04-02 11:47 ------- SRA introduces a use of the uninitialized value when re-constructing the unsigned long representation. That boils down to later CCP recognizing the result as undefined and thus: Visiting statement: SR.16_25 = (unsigned int) result$A3_24(D); which is likely UNDEFINED Visiting statement: SR.17_26 = (long unsigned int) SR.16_25; which is likely UNDEFINED Visiting statement: SR.18_27 = SR.17_26 << 32; which is likely UNDEFINED Visiting statement: SR.3_34 = SR.18_27 & 0x0ffffffff00000000; which is likely UNDEFINED Visiting PHI node: SR.3_2 = PHI <12885032961(2), SR.3_34(3)> Argument #0 (2 -> 4 executable) 12885032961 Value: CONSTANT 12885032961 Argument #1 (3 -> 4 executable) SR.3_34 Value: UNDEFINED PHI node value: CONSTANT 12885032961 Lattice value changed to CONSTANT 12885032961. and we completely ignore the taken path. One issue is that Visiting statement: SR.3_34 = SR.18_27 & 0x0ffffffff00000000; which is likely UNDEFINED is not 100% true - the value is only partially undefined (only the defined pieces will be used later). But of course that's splitting hairs somewhat (but it might be the easiest fix for this bug). tree-ssa-ccp.c:likely_value needs to look at regular rhs operands for literal constants (see trunk version) but also make sure to re-set all_undefined_operands if it encounters such. -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at gcc dot gnu |rguenth at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED Last reconfirmed|2010-04-02 11:31:52 |2010-04-02 11:47:23 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43629