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

            Bug ID: 70929
           Summary: [4.9/5/6/7 regression] Cross-module inlining for
                    functions having argument passed by reference is no
                    longer working.
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hubicka at gcc dot gnu.org
  Target Milestone: ---

$ cat a.C
struct s
{
  int a;
  s() {a=1;}
  ~s() {}
};
int t(struct s s);
int main()
{
  s s;
  int v=t(s);
  if (!__builtin_constant_p (v))
    __builtin_abort ();
  return 0;
}
$ cat b.C
struct s
{
  int a;
  s() {a=1;}
  ~s() {}
};
int t(struct s s)
{
  return s.a;
}
$ gcc-4.6 -O3 -flto a.C b.C
$ ./a.out
$ /aux/hubicka/trunk-install/bin/gcc -O3 -flto a.C b.C
$ ./a.out
Aborted

Reply via email to