* [Bug middle-end/17526] [4.0 Regression] libcpp is miscompiled with -fno-pcc-struct-return -O2
2004-09-16 20:54 [Bug bootstrap/17526] New: locale_facets.cc:47: internal compiler error wanderer at rsu dot ru
@ 2004-10-26 9:19 ` reichelt at gcc dot gnu dot org
2004-10-26 9:45 ` reichelt at gcc dot gnu dot org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-10-26 9:19 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-10-26 09:18 -------
Andrew's example in comment #26 is broken.
ret.cd is set to 2 and therefore we have a.b.cd!=1 which triggers the abort.
Nevertheless, here's a reduced testcase derived from comment #25:
================================
void abort(void);
typedef struct { int i; } A;
A foo(void)
{
A a = { 1 };
int j;
for (j=0; j<2; j++) ;
return a;
}
void bar(A *p)
{
*p = foo();
}
int main(void)
{
A a;
bar(&a);
if (a.i != 1)
abort();
return 0;
}
================================
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |reichelt at gcc dot gnu dot
| |org
Keywords| |monitored
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17526
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug middle-end/17526] [4.0 Regression] libcpp is miscompiled with -fno-pcc-struct-return -O2
2004-09-16 20:54 [Bug bootstrap/17526] New: locale_facets.cc:47: internal compiler error wanderer at rsu dot ru
2004-10-26 9:19 ` [Bug middle-end/17526] [4.0 Regression] libcpp is miscompiled with -fno-pcc-struct-return -O2 reichelt at gcc dot gnu dot org
@ 2004-10-26 9:45 ` reichelt at gcc dot gnu dot org
2004-10-26 19:08 ` jason at gcc dot gnu dot org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-10-26 9:45 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-10-26 09:45 -------
I can confirm that the bug was introduced with Jason's patch
http://gcc.gnu.org/ml/gcc-cvs/2004-07/msg00788.html
as pointed out in comment #16.
Jason, could you please have a look?
Btw, here's an even shorter testcase:
===============================
void abort(void);
typedef struct { int i; } A;
A foo(void)
{
A a = { 0 };
return a;
}
void bar(A *p)
{
*p = foo();
}
int main(void)
{
A a;
bar(&a);
if (a.i) abort();
return 0;
}
===============================
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17526
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug middle-end/17526] [4.0 Regression] libcpp is miscompiled with -fno-pcc-struct-return -O2
2004-09-16 20:54 [Bug bootstrap/17526] New: locale_facets.cc:47: internal compiler error wanderer at rsu dot ru
2004-10-26 9:19 ` [Bug middle-end/17526] [4.0 Regression] libcpp is miscompiled with -fno-pcc-struct-return -O2 reichelt at gcc dot gnu dot org
2004-10-26 9:45 ` reichelt at gcc dot gnu dot org
@ 2004-10-26 19:08 ` jason at gcc dot gnu dot org
2004-10-29 21:46 ` jason at gcc dot gnu dot org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu dot org @ 2004-10-26 19:08 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jason at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17526
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug middle-end/17526] [4.0 Regression] libcpp is miscompiled with -fno-pcc-struct-return -O2
2004-09-16 20:54 [Bug bootstrap/17526] New: locale_facets.cc:47: internal compiler error wanderer at rsu dot ru
` (2 preceding siblings ...)
2004-10-26 19:08 ` jason at gcc dot gnu dot org
@ 2004-10-29 21:46 ` jason at gcc dot gnu dot org
2004-10-31 9:17 ` cvs-commit at gcc dot gnu dot org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu dot org @ 2004-10-29 21:46 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From jason at gcc dot gnu dot org 2004-10-29 21:46 -------
The problem seems to be an incorrect tailcall. Before my patch, "*p = foo()"
was turned into "T.1 = foo(); *p = T.1;". After my patch, the gimplifier no
longer introduced a temporary. If A is returned in memory the tailcall pass
then marks the line "*p = foo()" as a tailcall, losing the assignment in the
process.
I think I'll fix this by using a temporary for all non-BLKmode types, but this
also seems like a bug in the tailcall pass.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17526
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug middle-end/17526] [4.0 Regression] libcpp is miscompiled with -fno-pcc-struct-return -O2
2004-09-16 20:54 [Bug bootstrap/17526] New: locale_facets.cc:47: internal compiler error wanderer at rsu dot ru
` (3 preceding siblings ...)
2004-10-29 21:46 ` jason at gcc dot gnu dot org
@ 2004-10-31 9:17 ` cvs-commit at gcc dot gnu dot org
2004-10-31 15:09 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-10-31 9:17 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-10-31 09:17 -------
Subject: Bug 17526
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: jason@gcc.gnu.org 2004-10-31 09:17:42
Modified files:
gcc : ChangeLog tree-gimple.c
Log message:
PR middle-end/17526
* tree-gimple.c (is_gimple_mem_rhs): Also require a val for
aggregate types that are not BLKmode.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.6111&r2=2.6112
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-gimple.c.diff?cvsroot=gcc&r1=2.29&r2=2.30
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17526
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug middle-end/17526] [4.0 Regression] libcpp is miscompiled with -fno-pcc-struct-return -O2
2004-09-16 20:54 [Bug bootstrap/17526] New: locale_facets.cc:47: internal compiler error wanderer at rsu dot ru
` (4 preceding siblings ...)
2004-10-31 9:17 ` cvs-commit at gcc dot gnu dot org
@ 2004-10-31 15:09 ` pinskia at gcc dot gnu dot org
2005-03-03 23:52 ` olh at suse dot de
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-31 15:09 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-31 15:09 -------
Fixed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17526
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug middle-end/17526] [4.0 Regression] libcpp is miscompiled with -fno-pcc-struct-return -O2
2004-09-16 20:54 [Bug bootstrap/17526] New: locale_facets.cc:47: internal compiler error wanderer at rsu dot ru
` (5 preceding siblings ...)
2004-10-31 15:09 ` pinskia at gcc dot gnu dot org
@ 2005-03-03 23:52 ` olh at suse dot de
2005-03-04 10:43 ` wanderer at rsu dot ru
2005-03-04 11:27 ` wanderer at rsu dot ru
8 siblings, 0 replies; 10+ messages in thread
From: olh at suse dot de @ 2005-03-03 23:52 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From olh at suse dot de 2005-03-03 23:52 -------
can these errors still be reproduced with current gcc 4.0 branch?
the applied patch causes regressions:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20282
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20305
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17526
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug middle-end/17526] [4.0 Regression] libcpp is miscompiled with -fno-pcc-struct-return -O2
2004-09-16 20:54 [Bug bootstrap/17526] New: locale_facets.cc:47: internal compiler error wanderer at rsu dot ru
` (6 preceding siblings ...)
2005-03-03 23:52 ` olh at suse dot de
@ 2005-03-04 10:43 ` wanderer at rsu dot ru
2005-03-04 11:27 ` wanderer at rsu dot ru
8 siblings, 0 replies; 10+ messages in thread
From: wanderer at rsu dot ru @ 2005-03-04 10:43 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From wanderer at rsu dot ru 2005-03-04 10:43 -------
Current CVS mainline bootstrap fine at self with and without reverting patch
in #30.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17526
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug middle-end/17526] [4.0 Regression] libcpp is miscompiled with -fno-pcc-struct-return -O2
2004-09-16 20:54 [Bug bootstrap/17526] New: locale_facets.cc:47: internal compiler error wanderer at rsu dot ru
` (7 preceding siblings ...)
2005-03-04 10:43 ` wanderer at rsu dot ru
@ 2005-03-04 11:27 ` wanderer at rsu dot ru
8 siblings, 0 replies; 10+ messages in thread
From: wanderer at rsu dot ru @ 2005-03-04 11:27 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From wanderer at rsu dot ru 2005-03-04 11:27 -------
Ops... sorry.
I withdraw my prev. note.
Current mainline CVS GCC fail bootstrap with reverted patch in #30
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |olh at suse dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17526
^ permalink raw reply [flat|nested] 10+ messages in thread