Bug 35783 - non address exposed static variable can not be changed by external function to a different value
non address exposed static variable can not be changed by external function t...
Status: RESOLVED INVALID
Product: gcc
Classification: Unclassified
Component: middle-end
4.4.0
: P3 enhancement
: ---
Assigned To: Not yet assigned to anyone
: alias, missed-optimization
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-01 01:20 UTC by davidxl
Modified: 2008-04-01 04:55 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-04-01 01:24:30


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description davidxl 2008-04-01 01:20:07 UTC
In the following example, ss should be constant propagated, but gcc does not do it.


static int ss = 0;

extern bar();

int foo()
{
  ss = 10;
  bar();
  return ss;
}
Comment 1 Andrew Pinski 2008-04-01 01:24:29 UTC
This need super powerful IPA based call clobberness.  Basically we need to detect there is only one value that ss can hold inside foo even with the call to bar, that is a hard problem really.
Comment 2 Andrew Pinski 2008-04-01 01:26:25 UTC
and it can be modified by an extern function, just it will be the same value as it was at the point bar was called.
Comment 3 davidxl 2008-04-01 04:55:38 UTC
Silly bug. bar can call back any function in ss's module.