Before the fix for PR 20100 and PR 20115, const and pure calls were both treated
as "const".  After the fix, both are treated as "pure" by that fix, but
a .GLOBAL_VAR is unnecessarily created because of the bambam call in:

extern int constfun (void) __attribute__ ((__const__));
extern void bambam (void);

int x (void)
{
  int a = constfun ();
  bambam ();
  return a + constfun ();
}

-- 
           Summary: [4.0 regression] const function calls treated as pure by
                    LIM 20100 fix
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hp at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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

Reply via email to