This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/23488] [4.1 Regression] extra reads from static variable


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-19 22:35 -------
Further reduced testcase:
int
xtermEnvEncoding(void)
{
  static int result;
  if (result == 0)
    result = 2;
  return result;
}

Basicially the issue is that the if is emitted as cmp 0, result instead of what it was before as
set regtmp, result
cmp regtmp, 0
so GCSE/PRE does not see the load.
And yes this is load PRE which means this is most likely be fixed for 4.2 on the tree level.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23488


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]