From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25880 invoked by alias); 24 Nov 2014 10:32:47 -0000 Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org Received: (qmail 25847 invoked by uid 48); 24 Nov 2014 10:32:47 -0000 From: "rguenth at gcc dot gnu.org" To: java-prs@gcc.gnu.org Subject: [Bug java/64044] New: Java emits bogus .class$ decls Date: Mon, 24 Nov 2014 10:32:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: java X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter cc Message-ID: 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-q4/txt/msg00008.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64044 Bug ID: 64044 Summary: Java emits bogus .class$ decls Product: gcc Version: 5.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: java Assignee: unassigned at gcc dot gnu.org Reporter: rguenth at gcc dot gnu.org CC: aph at gcc dot gnu.org Currently the Java FE is lucky that not all -findirect-dispatch testcases are miscompiled as gimple-fold.c:get_symbol_constant_value has /* Variables declared 'const' without an initializer have zero as the initializer if they may not be overridden at link or run time. */ if (!val && (INTEGRAL_TYPE_P (TREE_TYPE (sym)) || SCALAR_FLOAT_TYPE_P (TREE_TYPE (sym)))) return build_zero_cst (TREE_TYPE (sym)); which for unkown reason avoids to fold the reads from .class$ at the beginning of all functions to NULL (because the above doesn't allow pointer types). I ran into this when doing the same during value-numbering but "forgetting" to paper over the Java FE bug. The Java FE emits (for example) unit size align 64 symtab 0 alias set -1 canonical type 0x7ffff6c69930 fields pointer_to_this > readonly public unsigned DI size unit size align 64 symtab 0 alias set -1 canonical type 0x7ffff6c69a80 pointer_to_this > readonly constant addressable public static unsigned ignored DI file Array_2.java line 4 col 0 size unit size align 64 context (mem/u/f/c:DI (symbol_ref:DI ("_ZN7Array_27class$$E") [flags 0x2] ) [2 Array_2.class$+0 S8 A64])> which misses an initializer (it seems to be not initialized in .s either, thus the flags on it are wrong? Probably they get initialized by the runtime?).