public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/63569] New: [5.0 Regression] Wrong code with volatile and ICF
@ 2014-10-17  6:49 pinskia at gcc dot gnu.org
  2014-10-17  6:51 ` [Bug tree-optimization/63569] " pinskia at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-10-17  6:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63569

            Bug ID: 63569
           Summary: [5.0 Regression] Wrong code with volatile and ICF
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org

Take:
static int f(int t, int *a) __attribute__((noinline));

static int g(int t, volatile int *a) __attribute__((noinline));
static int g(int t, volatile int *a)
{
  int i;
  int tt = 0;
  for(i=0;i<t;i++)
    tt += *a;
  return tt;
}
static int f(int t, int *a)
{
  int i;
  int tt = 0;
  for(i=0;i<t;i++)
    tt += *a;
  return tt;
}


int h(int t, int *a)
{
  return f(t, a) + g(t, a);
}
--- CUT ---
The order of f and g are important.

The .icf dump has:
Semantic equality hit:f->g
Assembler symbol names:f->g

Which is incorrect as they are not semantic equivalent as one you can load from
a only once while the other you need to load a each time through the loop.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-12-19 12:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-17  6:49 [Bug tree-optimization/63569] New: [5.0 Regression] Wrong code with volatile and ICF pinskia at gcc dot gnu.org
2014-10-17  6:51 ` [Bug tree-optimization/63569] " pinskia at gcc dot gnu.org
2014-10-17 22:28 ` pinskia at gcc dot gnu.org
2014-11-11  6:42 ` trippels at gcc dot gnu.org
2014-11-21  8:01 ` trippels at gcc dot gnu.org
2014-11-21 11:26 ` [Bug ipa/63569] " marxin at gcc dot gnu.org
2014-11-21 12:48 ` marxin at gcc dot gnu.org
2014-11-26 23:50 ` pinskia at gcc dot gnu.org
2014-12-02 13:26 ` pinskia at gcc dot gnu.org
2014-12-12 10:30 ` trippels at gcc dot gnu.org
2014-12-19 12:41 ` marxin at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).