Bug 24888 - duplication of local variables after versioning/inlining
Summary: duplication of local variables after versioning/inlining
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.1.0
: P3 normal
Target Milestone: ---
Assignee: Jan Hubicka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-16 10:11 UTC by razya
Modified: 2006-08-05 08:01 UTC (History)
3 users (show)

See Also:
Host: powerpc-suse-linux
Target: powerpc-suse-linux
Build: powerpc-suse-linux
Known to work:
Known to fail:
Last reconfirmed: 2006-07-22 13:28:08


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description razya 2005-11-16 10:11:16 UTC
For the testcase: /home/razya/mainline_new_3/gcc/gcc/testsuite/gcc.c-torture/execute/20021111-1.c, when using fipa-cp, a new vfersion is created
for aim_callhandler(). the static variable is copied twice into the unexpanded_var_list of the versioned function. 
Looking at this test, even without enabling ipa-cp, the local variables
multiplies after inlining.(as shown in the dump below)
For example :
in 20021111-1.c.t23.alias1:

aim_callhandler (sess, conn, family, type)
{
  int D.1449;
  int sess;
  int conn;
  short unsigned int family;
  short unsigned int type;
  static int i = 0;
  int D.1457;
  int D.1456;
  int i.0;
  int D.1458;
  int D.1449;
  int D.1435;
  int sess;
  int conn;
  short unsigned int family;
  short unsigned int type;
  static int i = 0;
  int D.1443;
  int D.1442;
  int i.0;
  int D.1444;
  int D.1435;
  int D.1421;
  int sess;
  int conn;
  short unsigned int family;
  short unsigned int type;
  static int i = 0;
  int D.1429;
  int D.1428;
  int i.0;
  int D.1430;
  int D.1421;
  int D.1407;
  int sess;
  int conn;
  short unsigned int family;
  short unsigned int type;
  static int i = 0;
  int D.1415;
  int D.1414;
  int i.0;
Comment 1 Richard Biener 2005-11-16 11:46:31 UTC
try dumping with -fdump-tree-*-uid, they are probably different copies.  You can
try http://gcc.gnu.org/ml/gcc-patches/2005-08/msg00314.html to avoid having unused versions dumped.
Comment 2 razya 2005-11-16 12:45:54 UTC
(In reply to comment #1)
> try dumping with -fdump-tree-*-uid, they are probably different copies.  You
> can
> try http://gcc.gnu.org/ml/gcc-patches/2005-08/msg00314.html to avoid having
> unused versions dumped.

It doesn't help.
The decls are actually inserted to unexpanded_var_list more than once by the inliner. Thanks.
Comment 3 Jan Hubicka 2006-07-22 13:28:08 UTC
Testing patch
Comment 4 patchapp@dberlin.org 2006-07-22 22:50:12 UTC
Subject: Bug number PR tree-optimization/24888

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-07/msg00981.html
Comment 5 Jan Hubicka 2006-08-04 17:03:41 UTC
Subject: Bug 24888

Author: hubicka
Date: Fri Aug  4 17:03:32 2006
New Revision: 115927

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115927
Log:
	PR tree-optimization/24888
	* tree-inline.c (expand_call_inline): Do not re-record variables.
	(declare_inline_vars): Add variable to unexpanded_var_list.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-inline.c

Comment 6 Paolo Bonzini 2006-08-05 08:00:44 UTC
patch applied, fixed?
Comment 7 Paolo Bonzini 2006-08-05 08:01:21 UTC
fixed.
Comment 8 patchapp@dberlin.org 2006-08-20 07:35:09 UTC
Subject: Bug number PR tree-optimization/24888

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-08/msg00717.html