Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Uninitialized variable in CRIS port
@ 2001-09-19 14:55 Andrew Cagney
  2001-09-21 11:12 ` Orjan Friberg
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cagney @ 2001-09-19 14:55 UTC (permalink / raw)
  To: gdb

Trying to compile the cris-elf target (configure ... 
--enable-gdb-build-warnings=,-Werror) showed up a number of warnings. 
The most serious is probably:

  /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.

just fyi,
	Andrew


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Uninitialized variable in CRIS port
  2001-09-19 14:55 Uninitialized variable in CRIS port Andrew Cagney
@ 2001-09-21 11:12 ` Orjan Friberg
  2001-09-21 11:58   ` Andrew Cagney
  0 siblings, 1 reply; 4+ messages in thread
From: Orjan Friberg @ 2001-09-21 11:12 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Uninitialized variable in CRIS port
  2001-09-21 11:12 ` Orjan Friberg
@ 2001-09-21 11:58   ` Andrew Cagney
  2001-09-24  1:18     ` Orjan Friberg
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cagney @ 2001-09-21 11:58 UTC (permalink / raw)
  To: Orjan Friberg; +Cc: Andrew Cagney, gdb

> 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?

That is entirely your decision.  I suspect you'll want to commit this
to both though.

Andrew


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Uninitialized variable in CRIS port
  2001-09-21 11:58   ` Andrew Cagney
@ 2001-09-24  1:18     ` Orjan Friberg
  0 siblings, 0 replies; 4+ messages in thread
From: Orjan Friberg @ 2001-09-24  1:18 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb

Andrew Cagney wrote:
> 
> > 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?
> 
> That is entirely your decision.  I suspect you'll want to commit this
> to both though.

Thanks; committed to both.

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-09-24  1:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-19 14:55 Uninitialized variable in CRIS port Andrew Cagney
2001-09-21 11:12 ` Orjan Friberg
2001-09-21 11:58   ` Andrew Cagney
2001-09-24  1:18     ` Orjan Friberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox