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]

c/5105: compound literal patch broken with inlining



>Number:         5105
>Category:       c
>Synopsis:       compound literal patch broken with inlining
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 13 11:56:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     aj@suse.de
>Release:        gcc 3.1 CVS - any version later than 4th of December
>Organization:
>Environment:
i686-linux-gnu, or crosscompiler to x86_64-linux-gnu,
or ia64-linux, or ppc-linux
>Description:
typedef struct { long p; } pt;

inline pt f(pt _p)
{
  long p = _p.p;

  return (pt) { (p) };
}

The following test case fails with -O2, it works with
-fno-inline added:

static int mmap_mem(void)
{
  pt p;
  p = f(p);

  return 0;
}

for more details check:
http://gcc.gnu.org/ml/gcc/2001-12/msg00576.html
http://gcc.gnu.org/ml/gcc/2001-12/msg00697.html
http://gcc.gnu.org/ml/gcc-bugs/2001-12/msg00269.html
>How-To-Repeat:
Just compile the file.
>Fix:
Revert Joseph's compound literals patch.;-)

Andreas
>Release-Note:
>Audit-Trail:
>Unformatted:


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