From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11198 invoked by alias); 12 Nov 2002 09:16:05 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 11157 invoked by uid 71); 12 Nov 2002 09:16:04 -0000 Resent-Date: 12 Nov 2002 09:16:04 -0000 Resent-Message-ID: <20021112091604.11156.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, johnb@stl.sarov.ru Received: (qmail 8539 invoked by uid 61); 12 Nov 2002 09:13:58 -0000 Message-Id: <20021112091358.8538.qmail@sources.redhat.com> Date: Tue, 19 Nov 2002 13:26:00 -0000 From: johnb@stl.sarov.ru Reply-To: johnb@stl.sarov.ru To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: other/8540: libgcc: execute_cfa_program() doesn`t handle 2 DWARF instructions properly X-SW-Source: 2002-11/txt/msg00571.txt.bz2 List-Id: >Number: 8540 >Category: other >Synopsis: libgcc: execute_cfa_program() doesn`t handle 2 DWARF instructions properly >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Tue Nov 12 01:16:04 PST 2002 >Closed-Date: >Last-Modified: >Originator: Eugeny Belov >Release: gcc 3.2 >Organization: >Environment: Red Hat Linux 8.0, default gcc 3.2 and its sources. >Description: Source file gcc/unwind-dw2.c have the function execute_cfa_program(), part of its code is below: ... case DW_CFA_restore_extended: insn_ptr = read_uleb128 (insn_ptr, ®); fs->regs.reg[reg].how = REG_UNSAVED; break; case DW_CFA_undefined: case DW_CFA_same_value: case DW_CFA_nop: break; ... In case of DW_CFA_undefined and DW_CFA_same_value this function does nothing, but according to DWARF Debugging Information Format document (I have rev.2.1 Draft 5DW (Nov 30,2000)) section 6.4.2 (Call Frame Instructions).10,11 "the DW_CFA_undefined and DW_CFA_same_value instructions take a single unsigned LEB128 argument that represents a register number. The required action is to set the rule for the specified register to "undefined" or "same_value" in corresponding cases". Also I noted that emitting of these instructions is correct (source file gcc/dwarf2out.c:output_cfi()) but these instructions never go to the output CFI, so this is not a problem for gcc compiled programs, but may cause problems with modules built by other compilers. >How-To-Repeat: >Fix: Small changes to the gcc/unwind-dw2.c (execute_cfa_program()): ... case DW_CFA_undefined: insn_ptr = read_uleb128 (insn_ptr, ®); // if it will be used also something like this // fs->regs.reg[reg].how = REG_UNDEFINED; break; case DW_CFA_same_value: insn_ptr = read_uleb128 (insn_ptr, ®); // if it will be used also something like this // fs->regs.reg[reg].how = REG_SAMEVALUE; break; case DW_CFA_nop: break; ... >Release-Note: >Audit-Trail: >Unformatted: