From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127112 invoked by alias); 17 Apr 2015 01:51:32 -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 125311 invoked by uid 48); 17 Apr 2015 01:51:28 -0000 From: "amodra at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/65779] [5/6 Regression] undefined local symbol on powerpc [regression] Date: Fri, 17 Apr 2015 01:51:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: amodra at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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: 2015-04/txt/msg01393.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65779 Alan Modra changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amodra at gmail dot com --- Comment #2 from Alan Modra --- The underlying problem here is that this sequence setting up the GOT/TOC pointer in adler32(): (insn 358 357 359 2 (parallel [ (set (reg:SI 65 lr) (symbol_ref:SI ("*.LCF2"))) (use (unspec [ (symbol_ref:SI ("*.LCF2")) ] UNSPEC_TOC)) ]) ../../../../../../../../../rtems/c/src/lib/libbsp/powerpc/motorola_p\ owerpc/bootloader/../../../powerpc/shared/bootloader/zlib.c:2081 -1 (nil)) (insn 359 358 360 2 (set (reg:SI 30 30) (reg:SI 65 lr)) ../../../../../../../../../rtems/c/src/lib/libbsp/power\ pc/motorola_powerpc/bootloader/../../../powerpc/shared/bootloader/zlib.c:2081 -\ 1 (expr_list:REG_DEAD (reg:SI 65 lr) (nil))) (insn 360 359 376 2 (set (reg:SI 0 0) (mem:SI (plus:SI (reg:SI 30 30) (minus:SI (symbol_ref:SI ("*.LCL2")) (symbol_ref:SI ("*.LCF2")))) [0 S4 A8])) ../../../../../..\ /../../../rtems/c/src/lib/libbsp/powerpc/motorola_powerpc/bootloader/../../../p\ owerpc/shared/bootloader/zlib.c:2081 -1 (nil)) (debug_insn 376 360 361 2 (var_location:SI D#37 (reg/v:SI 0 0 [orig:239 s2 ] [2\ 39])) -1 (nil)) (insn 361 376 362 2 (set (reg:SI 30 30) (plus:SI (reg:SI 0 0) (reg:SI 30 30))) ../../../../../../../../../rtems/c/src/lib/libbsp/\ powerpc/motorola_powerpc/bootloader/../../../powerpc/shared/bootloader/zlib.c:2\ 081 -1 (expr_list:REG_DEAD (reg:SI 0 0) (expr_list:REG_UNUSED (reg:SI 30 30) (nil)))) is deleted by peephole2 DCE: Deleting insn 361 deleting insn with uid = 361. DCE: Deleting insn 360 deleting insn with uid = 360. DCE: Deleting insn 359 deleting insn with uid = 359. DCE: Deleting insn 358 deleting insn with uid = 358. resulting in uses_TOC() returning false due to not finding UNSPEC_TOC, and thus not emitting the labels. Deleting the insns is correct; we don't need the GOI pointer set up in adler32(). gcc-4.9 also does the same thing, but doesn't leak the labels into debug insns.