Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Orjan Friberg <orjan.friberg@axis.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: gdb@sources.redhat.com
Subject: Re: Uninitialized variable in CRIS port
Date: Fri, 21 Sep 2001 11:12:00 -0000	[thread overview]
Message-ID: <3BAB82FA.A043CDCE@axis.com> (raw)
In-Reply-To: <3BA9143D.1000502@cygnus.com>

Andrew Cagney wrote:
> 
>   /home/scratch/GDB/src/gdb/cris-tdep.c: In function
> `reg_mode_add_sub_cmp_and_or_move_op':
> /home/scratch/GDB/src/gdb/cris-tdep.c:3054: warning: `operand1' might be
> used uninitialized in this function
> 
> checking the code, the problem looks real.

Thanks for the reminder.  Patch below, confirmed with the weirdest test
case I've ever written.  Ok to commit on trunk and branch?


2001-09-21  Orjan Friberg  <orjanf@axis.com>

        * cris-tdep.c (reg_mode_add_sub_cmp_and_or_move_op): Fetch
operand1
        from correct register.


Index: cris-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/cris-tdep.c,v
retrieving revision 1.3
diff -c -3 -p -r1.3 cris-tdep.c
*** cris-tdep.c 2001/09/19 21:59:41     1.3
--- cris-tdep.c 2001/09/21 17:54:03
*************** reg_mode_add_sub_cmp_and_or_move_op (uns
*** 3070,3076 ****
            return;
          }
        /* The instruction has the PC as its target register.  */
!       operand1 = inst_env->reg[operand1]; 
        operand2 = inst_env->reg[REG_PC];
  
        /* Check if it's a extend, signed or zero instruction.  */
--- 3070,3076 ----
            return;
          }
        /* The instruction has the PC as its target register.  */
!       operand1 = inst_env->reg[cris_get_operand1 (inst)]; 
        operand2 = inst_env->reg[REG_PC];
  
        /* Check if it's a extend, signed or zero instruction.  */

-- 
Orjan Friberg              E-mail: orjan.friberg@axis.com
Axis Communications AB     Phone:  +46 46 272 17 68


  reply	other threads:[~2001-09-21 11:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-19 14:55 Andrew Cagney
2001-09-21 11:12 ` Orjan Friberg [this message]
2001-09-21 11:58   ` Andrew Cagney
2001-09-24  1:18     ` Orjan Friberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3BAB82FA.A043CDCE@axis.com \
    --to=orjan.friberg@axis.com \
    --cc=ac131313@cygnus.com \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox