public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/19108] New: [4.0 regression] ICE initializing arrays
@ 2004-12-21 14:37 reichelt at gcc dot gnu dot org
2004-12-21 15:30 ` [Bug tree-optimization/19108] " pinskia at gcc dot gnu dot org
` (15 more replies)
0 siblings, 16 replies; 17+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-12-21 14:37 UTC (permalink / raw)
To: gcc-bugs
The following valid code snippet causes an ICE on mainline when
compiled with "-O":
==================================
struct A
{
int i[6];
A () : i() {}
};
struct B
{
A a;
B(const A& x) : a(x) {}
};
B b=A();
==================================
bug.cc: In function 'void __static_initialization_and_destruction_0(int,
int)':
bug.cc:13: internal compiler error: in sra_hash_tree, at tree-sra.c:383
Please submit a full bug report, [etc.]
This seems to be a recent regression (within the last week).
The problem might be related to PR 18793.
--
Summary: [4.0 regression] ICE initializing arrays
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code, monitored
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org,mark at codesourcery dot
com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19108
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/19108] [4.0 regression] ICE initializing arrays
2004-12-21 14:37 [Bug c++/19108] New: [4.0 regression] ICE initializing arrays reichelt at gcc dot gnu dot org
@ 2004-12-21 15:30 ` pinskia at gcc dot gnu dot org
2004-12-21 16:10 ` pinskia at gcc dot gnu dot org
` (14 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-21 15:30 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-12-21 15:30 -------
This is more likely related to a bug which I filed.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Component|c++ |tree-optimization
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-12-21 15:30:54
date| |
Target Milestone|--- |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19108
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/19108] [4.0 regression] ICE initializing arrays
2004-12-21 14:37 [Bug c++/19108] New: [4.0 regression] ICE initializing arrays reichelt at gcc dot gnu dot org
2004-12-21 15:30 ` [Bug tree-optimization/19108] " pinskia at gcc dot gnu dot org
@ 2004-12-21 16:10 ` pinskia at gcc dot gnu dot org
2004-12-22 12:44 ` steven at gcc dot gnu dot org
` (13 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-21 16:10 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-12-21 16:10 -------
sra_hash_tree does not handle RANGE_EXPRs.
This implements them but it might not be the correct approach though:
Index: tree-sra.c
===============================================================
====
RCS file: /cvs/gcc/gcc/gcc/tree-sra.c,v
retrieving revision 2.47
diff -u -p -r2.47 tree-sra.c
--- tree-sra.c 10 Dec 2004 21:54:42 -0000 2.47
+++ tree-sra.c 21 Dec 2004 16:09:09 -0000
@@ -378,6 +378,11 @@ sra_hash_tree (tree t)
h = iterative_hash_expr (DECL_FIELD_OFFSET (t), 0);
h = iterative_hash_expr (DECL_FIELD_BIT_OFFSET (t), h);
break;
+
+ case RANGE_EXPR:
+ h = sra_hash_tree (TREE_OPERAND (t, 0));
+ h ^= sra_hash_tree (TREE_OPERAND (t, 1));
+ break;
default:
gcc_unreachable ();
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |rth at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19108
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/19108] [4.0 regression] ICE initializing arrays
2004-12-21 14:37 [Bug c++/19108] New: [4.0 regression] ICE initializing arrays reichelt at gcc dot gnu dot org
2004-12-21 15:30 ` [Bug tree-optimization/19108] " pinskia at gcc dot gnu dot org
2004-12-21 16:10 ` pinskia at gcc dot gnu dot org
@ 2004-12-22 12:44 ` steven at gcc dot gnu dot org
2004-12-31 12:13 ` steven at gcc dot gnu dot org
` (12 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: steven at gcc dot gnu dot org @ 2004-12-22 12:44 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2004-12-22 12:43 -------
Looks like fall-out from PR18191. I'll try to take care of this.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |steven at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2004-12-21 15:30:54 |2004-12-22 12:43:56
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19108
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/19108] [4.0 regression] ICE initializing arrays
2004-12-21 14:37 [Bug c++/19108] New: [4.0 regression] ICE initializing arrays reichelt at gcc dot gnu dot org
` (2 preceding siblings ...)
2004-12-22 12:44 ` steven at gcc dot gnu dot org
@ 2004-12-31 12:13 ` steven at gcc dot gnu dot org
2004-12-31 16:08 ` reichelt at gcc dot gnu dot org
` (11 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: steven at gcc dot gnu dot org @ 2004-12-31 12:13 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2004-12-31 12:13 -------
I cannot reproduce this (it is monitored??).
I still think something like Andrew's patch is necessary,
but without a test case, well, how can we be sure??
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |WAITING
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19108
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/19108] [4.0 regression] ICE initializing arrays
2004-12-21 14:37 [Bug c++/19108] New: [4.0 regression] ICE initializing arrays reichelt at gcc dot gnu dot org
` (3 preceding siblings ...)
2004-12-31 12:13 ` steven at gcc dot gnu dot org
@ 2004-12-31 16:08 ` reichelt at gcc dot gnu dot org
2004-12-31 16:10 ` pinskia at gcc dot gnu dot org
` (10 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-12-31 16:08 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-12-31 16:08 -------
I can still reproduce it with the above testcase:
gcc version 4.0.0 20041230 (experimental) on i686-pc-linux-gnu.
Maybe it is target dependant?
Did you try larger array sizes than 6?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19108
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/19108] [4.0 regression] ICE initializing arrays
2004-12-21 14:37 [Bug c++/19108] New: [4.0 regression] ICE initializing arrays reichelt at gcc dot gnu dot org
` (4 preceding siblings ...)
2004-12-31 16:08 ` reichelt at gcc dot gnu dot org
@ 2004-12-31 16:10 ` pinskia at gcc dot gnu dot org
2005-01-01 16:28 ` steven at gcc dot gnu dot org
` (9 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-31 16:10 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-12-31 16:10 -------
(In reply to comment #5)
> I can still reproduce it with the above testcase:
> gcc version 4.0.0 20041230 (experimental) on i686-pc-linux-gnu.
>
> Maybe it is target dependant?
It is. You might have to use -march=i686.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19108
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/19108] [4.0 regression] ICE initializing arrays
2004-12-21 14:37 [Bug c++/19108] New: [4.0 regression] ICE initializing arrays reichelt at gcc dot gnu dot org
` (5 preceding siblings ...)
2004-12-31 16:10 ` pinskia at gcc dot gnu dot org
@ 2005-01-01 16:28 ` steven at gcc dot gnu dot org
2005-03-16 20:52 ` [Bug tree-optimization/19108] [4.0/4.1 " reichelt at gcc dot gnu dot org
` (8 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-01-01 16:28 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2005-01-01 16:28 -------
Yup, -march=i686 does the trick for me:
$ ./cc1plus t.C -O -m32 -march=i686
A::A()
A::A()
A::A()
B::B(const A&)
B::B(const A&)
B::B(const A&)
void __static_initialization_and_destruction_0(int, int)
void _GLOBAL__I_b()
Analyzing compilation unit
Performing intraprocedural optimizations
Assembling functions:
void __static_initialization_and_destruction_0(int, int)
t.C: In function 'void __static_initialization_and_destruction_0(int, int)':
t.C:13: internal compiler error: in sra_hash_tree, at tree-sra.c:384
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19108
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/19108] [4.0/4.1 regression] ICE initializing arrays
2004-12-21 14:37 [Bug c++/19108] New: [4.0 regression] ICE initializing arrays reichelt at gcc dot gnu dot org
` (6 preceding siblings ...)
2005-01-01 16:28 ` steven at gcc dot gnu dot org
@ 2005-03-16 20:52 ` reichelt at gcc dot gnu dot org
2005-03-18 15:49 ` sayler at thewalrus dot org
` (7 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-03-16 20:52 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2005-03-16 20:52 -------
Are there any news, Steven?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19108
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/19108] [4.0/4.1 regression] ICE initializing arrays
2004-12-21 14:37 [Bug c++/19108] New: [4.0 regression] ICE initializing arrays reichelt at gcc dot gnu dot org
` (7 preceding siblings ...)
2005-03-16 20:52 ` [Bug tree-optimization/19108] [4.0/4.1 " reichelt at gcc dot gnu dot org
@ 2005-03-18 15:49 ` sayler at thewalrus dot org
2005-03-18 23:00 ` sayler at thewalrus dot org
` (6 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: sayler at thewalrus dot org @ 2005-03-18 15:49 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From sayler at thewalrus dot org 2005-03-18 15:49 -------
working to replicate this in current CVS.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |sayler at thewalrus dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19108
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/19108] [4.0/4.1 regression] ICE initializing arrays
2004-12-21 14:37 [Bug c++/19108] New: [4.0 regression] ICE initializing arrays reichelt at gcc dot gnu dot org
` (8 preceding siblings ...)
2005-03-18 15:49 ` sayler at thewalrus dot org
@ 2005-03-18 23:00 ` sayler at thewalrus dot org
2005-03-24 17:58 ` mmitchel at gcc dot gnu dot org
` (5 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: sayler at thewalrus dot org @ 2005-03-18 23:00 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From sayler at thewalrus dot org 2005-03-18 23:00 -------
Bug still present. The patch in #2 seems to fix the issue, though.
I can't say that the hash function chosen is the most efficient, but it's surely
better than an ICE.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19108
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/19108] [4.0/4.1 regression] ICE initializing arrays
2004-12-21 14:37 [Bug c++/19108] New: [4.0 regression] ICE initializing arrays reichelt at gcc dot gnu dot org
` (9 preceding siblings ...)
2005-03-18 23:00 ` sayler at thewalrus dot org
@ 2005-03-24 17:58 ` mmitchel at gcc dot gnu dot org
2005-03-28 19:13 ` rth at gcc dot gnu dot org
` (4 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-03-24 17:58 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2005-03-24 17:57 -------
My concern with this patch is that SRA may need other updates to full take into
account RANGE_EXPR. RTH, comments?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19108
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/19108] [4.0/4.1 regression] ICE initializing arrays
2004-12-21 14:37 [Bug c++/19108] New: [4.0 regression] ICE initializing arrays reichelt at gcc dot gnu dot org
` (10 preceding siblings ...)
2005-03-24 17:58 ` mmitchel at gcc dot gnu dot org
@ 2005-03-28 19:13 ` rth at gcc dot gnu dot org
2005-03-28 21:05 ` steven at gcc dot gnu dot org
` (3 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: rth at gcc dot gnu dot org @ 2005-03-28 19:13 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rth at gcc dot gnu dot org 2005-03-28 19:13 -------
Indeed, SRA *does* need to be updated to handle the RANGE_EXPR. And not in the
hash routine at all -- it needs to happen before that. Consider the following
modified test case:
struct A
{
int i[6];
A () : i(1) {}
};
struct B
{
A a;
B(const A& x) : a(x) {}
};
B b=A();
int main()
{
return b.a.i[0] == 1 ? 0 : 1;
}
Steven, if you don't have time to work on this, reassign the bug to me.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19108
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/19108] [4.0/4.1 regression] ICE initializing arrays
2004-12-21 14:37 [Bug c++/19108] New: [4.0 regression] ICE initializing arrays reichelt at gcc dot gnu dot org
` (11 preceding siblings ...)
2005-03-28 19:13 ` rth at gcc dot gnu dot org
@ 2005-03-28 21:05 ` steven at gcc dot gnu dot org
2005-03-29 22:44 ` cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-03-28 21:05 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2005-03-28 21:04 -------
Indeed I do not have time to work on this. I should have unassigned
this bug long ago, sorry about that.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|steven at gcc dot gnu dot |rth at gcc dot gnu dot org
|org |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19108
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/19108] [4.0/4.1 regression] ICE initializing arrays
2004-12-21 14:37 [Bug c++/19108] New: [4.0 regression] ICE initializing arrays reichelt at gcc dot gnu dot org
` (12 preceding siblings ...)
2005-03-28 21:05 ` steven at gcc dot gnu dot org
@ 2005-03-29 22:44 ` cvs-commit at gcc dot gnu dot org
2005-03-29 22:56 ` cvs-commit at gcc dot gnu dot org
2005-03-29 22:58 ` rth at gcc dot gnu dot org
15 siblings, 0 replies; 17+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-03-29 22:44 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-03-29 22:44 -------
Subject: Bug 19108
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: rth@gcc.gnu.org 2005-03-29 22:43:48
Modified files:
gcc : ChangeLog tree-sra.c
Added files:
gcc/testsuite/g++.dg/opt: pr19108.C
Log message:
PR tree-opt/19108
* tree-sra.c (generate_element_init_1): Handle RANGE_EXPR.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.8019&r2=2.8020
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-sra.c.diff?cvsroot=gcc&r1=2.54&r2=2.55
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/pr19108.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19108
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/19108] [4.0/4.1 regression] ICE initializing arrays
2004-12-21 14:37 [Bug c++/19108] New: [4.0 regression] ICE initializing arrays reichelt at gcc dot gnu dot org
` (13 preceding siblings ...)
2005-03-29 22:44 ` cvs-commit at gcc dot gnu dot org
@ 2005-03-29 22:56 ` cvs-commit at gcc dot gnu dot org
2005-03-29 22:58 ` rth at gcc dot gnu dot org
15 siblings, 0 replies; 17+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-03-29 22:56 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-03-29 22:56 -------
Subject: Bug 19108
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-4_0-branch
Changes by: rth@gcc.gnu.org 2005-03-29 22:56:05
Modified files:
gcc : ChangeLog tree-sra.c
Added files:
gcc/testsuite/g++.dg/opt: pr19108.C
Log message:
PR tree-opt/19108
* tree-sra.c (generate_element_init_1): Handle RANGE_EXPR.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.89&r2=2.7592.2.90
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-sra.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.53&r2=2.53.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/pr19108.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19108
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/19108] [4.0/4.1 regression] ICE initializing arrays
2004-12-21 14:37 [Bug c++/19108] New: [4.0 regression] ICE initializing arrays reichelt at gcc dot gnu dot org
` (14 preceding siblings ...)
2005-03-29 22:56 ` cvs-commit at gcc dot gnu dot org
@ 2005-03-29 22:58 ` rth at gcc dot gnu dot org
15 siblings, 0 replies; 17+ messages in thread
From: rth at gcc dot gnu dot org @ 2005-03-29 22:58 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rth at gcc dot gnu dot org 2005-03-29 22:58 -------
Fixed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19108
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2005-03-29 22:58 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-21 14:37 [Bug c++/19108] New: [4.0 regression] ICE initializing arrays reichelt at gcc dot gnu dot org
2004-12-21 15:30 ` [Bug tree-optimization/19108] " pinskia at gcc dot gnu dot org
2004-12-21 16:10 ` pinskia at gcc dot gnu dot org
2004-12-22 12:44 ` steven at gcc dot gnu dot org
2004-12-31 12:13 ` steven at gcc dot gnu dot org
2004-12-31 16:08 ` reichelt at gcc dot gnu dot org
2004-12-31 16:10 ` pinskia at gcc dot gnu dot org
2005-01-01 16:28 ` steven at gcc dot gnu dot org
2005-03-16 20:52 ` [Bug tree-optimization/19108] [4.0/4.1 " reichelt at gcc dot gnu dot org
2005-03-18 15:49 ` sayler at thewalrus dot org
2005-03-18 23:00 ` sayler at thewalrus dot org
2005-03-24 17:58 ` mmitchel at gcc dot gnu dot org
2005-03-28 19:13 ` rth at gcc dot gnu dot org
2005-03-28 21:05 ` steven at gcc dot gnu dot org
2005-03-29 22:44 ` cvs-commit at gcc dot gnu dot org
2005-03-29 22:56 ` cvs-commit at gcc dot gnu dot org
2005-03-29 22:58 ` rth at gcc dot gnu dot 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).