From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 470 invoked by alias); 5 Dec 2008 12:58:50 -0000 Received: (qmail 32529 invoked by uid 48); 5 Dec 2008 12:57:28 -0000 Date: Fri, 05 Dec 2008 12:58:00 -0000 Message-ID: <20081205125728.32528.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/38271] [4.4 Regression] Spurious / missing "... used uninitialized in this function" warning 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: 2008-12/txt/msg00505.txt.bz2 ------- Comment #6 from rguenth at gcc dot gnu dot org 2008-12-05 12:57 ------- This is sra_build_assignment/sra_build_bf_assignments way of "lowering" a BIT_FIELD_REF to integer arithmetic. We hit the !INTEGRAL_TYPE_P (TREE_TYPE (var)) paths and for BIT_FIELD_REF <*p_1(D), 32, 0> we create VIEW_CONVERT_EXPR (*p) and extract the lower/upper 32 bits by shifting and masking. This obviously "uses" possibly uninitialized parts of *p or s0. The problem here is that we interestingly split the initialization of s0 to the upper part s0.c ={v} s0$c_7; and the lower part SR.3_8 = VIEW_CONVERT_EXPR(s0); SR.4_9 = SR.3_8 & 0xffffffff00000000; SR.5_10 = (long long unsigned int) s0$B0F32_5; SR.6_11 = SR.4_9 | SR.5_10; s0 ={v} VIEW_CONVERT_EXPR(SR.6_11); this is likely because SRA really wants to have two 32bit fields but it cannot deal with the larger struct with a VIEW_CONVERT_EXPR. With just disabling all these code-paths we get : s0$B0F32_4 = 0; s0$c_5 = p_1(D)->c; s0$B0F32_6 = BIT_FIELD_REF <*p_1(D), 32, 0>; s0.c ={v} s0$c_5; BIT_FIELD_REF ={v} s0$B0F32_6; s ={v} s0; s$a_7 = s.a; D.1242_2 = s$a_7; and no warning. But of course we now have bitfield refs that are not optimized (not scalarizing in this case would be better). Of course even with the current scalarization we finally arrive with : # VUSE s0$c_7 = p_1(D)->c; # VUSE D.1249_4 = VIEW_CONVERT_EXPR(*p_1(D)); s0$B0F32_5 = (unsigned int) D.1249_4; # VUSE SR.21_24 = VIEW_CONVERT_EXPR(s0); SR.22_25 = SR.21_24 & 0xffffffff00000000; # s0_28 = VDEF s0 = VIEW_CONVERT_EXPR(SR.22_25); # s0_29 = VDEF s0.c = s0$c_7; # VUSE SR.3_8 = VIEW_CONVERT_EXPR(s0); SR.4_9 = SR.3_8 & 0xffffffff00000000; SR.5_10 = (long long unsigned int) s0$B0F32_5; SR.6_11 = SR.5_10 | SR.4_9; s0$B0F32_21 = (unsigned int) SR.6_11; s0$c_30 = VIEW_CONVERT_EXPR(SR.6_11).c; # VUSE SR.25_31 = VIEW_CONVERT_EXPR(s0); SR.26_32 = SR.25_31 & 0xffffffff00000000; SR.27_33 = (long long unsigned int) s0$B0F32_21; SR.28_34 = SR.27_33 | SR.26_32; # s0_35 = VDEF s0 = VIEW_CONVERT_EXPR(SR.28_34); # s0_36 = VDEF s0.c = s0$c_30; # VUSE # s_18 = VDEF s = s0; # VUSE s$a_37 = s.a; # s_39 = VDEF s.a = s$a_37; # VUSE # SMT.16_20 = VDEF bar (s); return; because we seem to scalarize again. Ugh. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38271