Bug 42312 - config/mep/mep.c:2856: (error) Uninitialized variable: frame_size
Summary: config/mep/mep.c:2856: (error) Uninitialized variable: frame_size
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-06 18:58 UTC by David Binderman
Modified: 2009-12-30 16:26 UTC (History)
3 users (show)

See Also:
Host: x86_64-suse-linux
Target: mep-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2009-12-06 18:58:21 UTC
I just ran the most excellent tool cppcheck, from sourceforge,
over the gcc source code. It said

config/mep/mep.c:2856: (error) Uninitialized variable: frame_size

I have checked the source code and I agree with cppcheck.

The source code is

  int frame_size;
  int really_need_stack_frame = frame_size;

which is fine as far as it goes, no problem in copying rubbish
from one place in the stack to another, but the next use of local
variable really_need_stack_frame is

        really_need_stack_frame |= mep_assign_save_slots (reg_save_size);

which could lead to problems. Suggest initialise local variable
really_need_stack_frame to something else, perhaps zero would suffice.
Comment 1 dj@gcc.gnu.org 2009-12-08 00:48:16 UTC
Subject: Bug 42312

Author: dj
Date: Tue Dec  8 00:47:58 2009
New Revision: 155072

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155072
Log:
PR c/42312
* config/mep/mep.c (mep_expand_prologue): Set
really_need_stack_frame after frame_size is set.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/mep/mep.c

Comment 2 Manuel López-Ibáñez 2009-12-30 16:26:05 UTC
This seems FIXED per DJ's commit.