This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c/5105: compound literal patch broken with inlining
- From: aj at suse dot de
- To: gcc-gnats at gcc dot gnu dot org
- Cc: bo at suse dot de
- Date: 13 Dec 2001 19:51:51 -0000
- Subject: c/5105: compound literal patch broken with inlining
- Reply-to: aj at suse dot de
>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: