public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/24780] New: ICE set_mem_attributes_minus_bitpos
@ 2005-11-10 17:47 ericboesch at hotmail dot com
2005-11-10 17:52 ` [Bug c++/24780] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: ericboesch at hotmail dot com @ 2005-11-10 17:47 UTC (permalink / raw)
To: gcc-bugs
In a file that defined several templates, I received the following error
message:
internal compiler error: in set_mem_attributes_minus_bitpos, at emit-rtl.c:1539
Bug 20073 involved the same error message, but that was marked "fixed" last
February. The .ii file compiles in 3.4.4 but fails in 4.0.2. I don't have
enough disk space to check out and test newer versions.
The .ii file is at http://mysite.verizon.net/eric.boesch1/TicTacToe.ii.bz2
(Apologies if this report is redundant or less than helpful.)
--
Summary: ICE set_mem_attributes_minus_bitpos
Product: gcc
Version: 4.0.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ericboesch at hotmail dot com
GCC host triplet: i686-pc-cygwin
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24780
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/24780] [4.0/4.1 Regression] ICE set_mem_attributes_minus_bitpos
2005-11-10 17:47 [Bug c++/24780] New: ICE set_mem_attributes_minus_bitpos ericboesch at hotmail dot com
@ 2005-11-10 17:52 ` pinskia at gcc dot gnu dot org
2005-11-10 21:11 ` pinskia at gcc dot gnu dot org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-10 17:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2005-11-10 17:52 -------
Reducing (this means I can reproduce it).
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|target |c++
Keywords| |ice-on-valid-code
Known to fail| |4.1.0 4.0.3
Known to work| |3.4.0
Summary|ICE |[4.0/4.1 Regression] ICE
|set_mem_attributes_minus_bit|set_mem_attributes_minus_bit
|pos |pos
Target Milestone|--- |4.0.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24780
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/24780] [4.0/4.1 Regression] ICE set_mem_attributes_minus_bitpos
2005-11-10 17:47 [Bug c++/24780] New: ICE set_mem_attributes_minus_bitpos ericboesch at hotmail dot com
2005-11-10 17:52 ` [Bug c++/24780] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
@ 2005-11-10 21:11 ` pinskia at gcc dot gnu dot org
2005-11-10 22:53 ` janis at gcc dot gnu dot org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-10 21:11 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2005-11-10 21:11 -------
Confirmed, reduced testcase:
template<typename S=int>
struct Move {
Move();
static Move<S> const MOVES[2][2];
};
template<typename S>
Move<S> const Move<S>::MOVES[2][2]={};
typedef Move<int> const MoveClass;
void moves(int x, int y) {
&MoveClass::MOVES[x][y];
}
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |critical
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
GCC target triplet|i686-pc-cygwin |
Last reconfirmed|0000-00-00 00:00:00 |2005-11-10 21:11:19
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24780
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/24780] [4.0/4.1 Regression] ICE set_mem_attributes_minus_bitpos
2005-11-10 17:47 [Bug c++/24780] New: ICE set_mem_attributes_minus_bitpos ericboesch at hotmail dot com
2005-11-10 17:52 ` [Bug c++/24780] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-11-10 21:11 ` pinskia at gcc dot gnu dot org
@ 2005-11-10 22:53 ` janis at gcc dot gnu dot org
2005-11-10 23:20 ` pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: janis at gcc dot gnu dot org @ 2005-11-10 22:53 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from janis at gcc dot gnu dot org 2005-11-10 22:53 -------
A regression hunt identified this patch:
r95217 | jakub | 2005-02-18 06:58:40 +0000 (Fri, 18 Feb 2005) | 9 lines
PR c++/19813
* emit-rtl.c (set_mem_attributes_minus_bitpos): Add assertion
that ref to be marked MEM_READONLY_P doesn't have base that needs
constructing.
* decl.c (start_decl_1): Clear TREE_READONLY flag if
its type has TYPE_NEEDS_CONSTRUCTING.
(complete_vars): Likewise.
That's not terribly useful, of course, because it's when the ICE check was
added, not when an existing check started triggering.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24780
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/24780] [4.0/4.1 Regression] ICE set_mem_attributes_minus_bitpos
2005-11-10 17:47 [Bug c++/24780] New: ICE set_mem_attributes_minus_bitpos ericboesch at hotmail dot com
` (2 preceding siblings ...)
2005-11-10 22:53 ` janis at gcc dot gnu dot org
@ 2005-11-10 23:20 ` pinskia at gcc dot gnu dot org
2005-11-11 6:26 ` mark at codesourcery dot com
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-10 23:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pinskia at gcc dot gnu dot org 2005-11-10 23:20 -------
Mark do you know if your patch for PR 20912 would fix this?
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mmitchel at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24780
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/24780] [4.0/4.1 Regression] ICE set_mem_attributes_minus_bitpos
2005-11-10 17:47 [Bug c++/24780] New: ICE set_mem_attributes_minus_bitpos ericboesch at hotmail dot com
` (3 preceding siblings ...)
2005-11-10 23:20 ` pinskia at gcc dot gnu dot org
@ 2005-11-11 6:26 ` mark at codesourcery dot com
2005-11-11 9:31 ` jakub at gcc dot gnu dot org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: mark at codesourcery dot com @ 2005-11-11 6:26 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from mark at codesourcery dot com 2005-11-11 06:26 -------
Subject: Re: [4.0/4.1 Regression] ICE set_mem_attributes_minus_bitpos
pinskia at gcc dot gnu dot org wrote:
> ------- Comment #4 from pinskia at gcc dot gnu dot org 2005-11-10 23:20 -------
> Mark do you know if your patch for PR 20912 would fix this?
I don't know one way or the other.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24780
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/24780] [4.0/4.1 Regression] ICE set_mem_attributes_minus_bitpos
2005-11-10 17:47 [Bug c++/24780] New: ICE set_mem_attributes_minus_bitpos ericboesch at hotmail dot com
` (4 preceding siblings ...)
2005-11-11 6:26 ` mark at codesourcery dot com
@ 2005-11-11 9:31 ` jakub at gcc dot gnu dot org
2005-11-11 9:40 ` jakub at gcc dot gnu dot org
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2005-11-11 9:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from jakub at gcc dot gnu dot org 2005-11-11 09:31 -------
Here complete_vars is called (via
complete_type->instantiate_class_template->finish_struct_1 call chain) before
TYPE_NEEDS_CONSTRUCTING flag is set
(mark_used->instantiate_decl->tsubst->build_cplus_array_type call chain),
so TREE_READONLY is set on the decl and later on its type becomes
TYPE_NEEDS_CONSTRUCTING.
complete_vars calls complete_type before calling cp_apply_type_quals_to_decl,
and complete_type should presumably set TYPE_NEEDS_CONSTRUCTING flag
(typeck.c:112), but in this case TYPE_NEEDS_CONSTRUCTING is still set only
on the inner array (t) and not on TYPE_MAIN_VARIANT (t).
A quick hack could be to dive recursively in cp_apply_type_quals_to_decl
into ARRAY_TYPEs, as in:
...
type_quals &= ~TYPE_QUAL_CONST;
else
for (; TREE_CODE (type) == ARRAY_TYPE; type = TREE_TYPE (type))
if (TYPE_NEEDS_CONSTRUCTNG (type) || TYPE_HAS_MUTABLE_P (type))
{
type_quals &= ~TYPE_QUAL_CONST;
break;
}
c_apply_type_quals_to_decl (type_quals, decl);
or in complete_type looking at both t and its main variant:
TYPE_NEEDS_CONSTRUCTING (type)
= TYPE_NEEDS_CONSTRUCTING (t) || TYPE_NEEDS_CONSTRUCTING
(TYPE_MAIN_VARIANT (t));
TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)
= TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) ||
TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TYPE_MAIN_VARIANT (t));
Note that complete_type doesn't update TYPE_NEEDS_CONSTRUCTING etc. for
main variant, just for the type that has been requested.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24780
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/24780] [4.0/4.1 Regression] ICE set_mem_attributes_minus_bitpos
2005-11-10 17:47 [Bug c++/24780] New: ICE set_mem_attributes_minus_bitpos ericboesch at hotmail dot com
` (5 preceding siblings ...)
2005-11-11 9:31 ` jakub at gcc dot gnu dot org
@ 2005-11-11 9:40 ` jakub at gcc dot gnu dot org
2005-11-12 20:45 ` jakub at gcc dot gnu dot org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2005-11-11 9:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from jakub at gcc dot gnu dot org 2005-11-11 09:39 -------
Or broadcast both flags to all type variants similarly how
layout_type->finalize_type_size broadcasts type size etc.
I.e.
- TYPE_NEEDS_CONSTRUCTING (type)
- = TYPE_NEEDS_CONSTRUCTING (TYPE_MAIN_VARIANT (t));
- TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)
- = TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TYPE_MAIN_VARIANT (t));
+ unsigned need_constructing = TYPE_NEEDS_CONSTRUCTING (TYPE_MAIN_VARIANT
(t));
+ unsigned nontriv_destructor = TYPE_HAS_NONTRIVIAL_DESTRUCTOR
(TYPE_MAIN_VARIANT (t));
+ for (t = TYPE_MAIN_VARIANT (type); t; t = TYPE_NEXT_VARIANT (t))
+ {
+ TYPE_NEEDS_CONSTRUCTING (t) = need_constructing;
+ TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) = nontriv_destructor;
+ }
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24780
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/24780] [4.0/4.1 Regression] ICE set_mem_attributes_minus_bitpos
2005-11-10 17:47 [Bug c++/24780] New: ICE set_mem_attributes_minus_bitpos ericboesch at hotmail dot com
` (7 preceding siblings ...)
2005-11-12 20:45 ` jakub at gcc dot gnu dot org
@ 2005-11-12 20:45 ` jakub at gcc dot gnu dot org
2005-11-12 22:14 ` pinskia at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2005-11-12 20:45 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from jakub at gcc dot gnu dot org 2005-11-12 20:44 -------
Subject: Bug 24780
Author: jakub
Date: Sat Nov 12 20:44:55 2005
New Revision: 106833
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=106833
Log:
PR c++/24780
* typeck.c (complete_type): Set TYPE_NEEDS_CONSTRUCTING
and TYPE_HAS_NONTRIVIAL_DESTRUCTOR flags for all variants
of array type.
* g++.dg/opt/pr24780.C: New test.
Added:
trunk/gcc/testsuite/g++.dg/opt/pr24780.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/typeck.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24780
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/24780] [4.0/4.1 Regression] ICE set_mem_attributes_minus_bitpos
2005-11-10 17:47 [Bug c++/24780] New: ICE set_mem_attributes_minus_bitpos ericboesch at hotmail dot com
` (6 preceding siblings ...)
2005-11-11 9:40 ` jakub at gcc dot gnu dot org
@ 2005-11-12 20:45 ` jakub at gcc dot gnu dot org
2005-11-12 20:45 ` jakub at gcc dot gnu dot org
2005-11-12 22:14 ` pinskia at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2005-11-12 20:45 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from jakub at gcc dot gnu dot org 2005-11-12 20:45 -------
Subject: Bug 24780
Author: jakub
Date: Sat Nov 12 20:45:47 2005
New Revision: 106834
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=106834
Log:
PR c++/24780
* typeck.c (complete_type): Set TYPE_NEEDS_CONSTRUCTING
and TYPE_HAS_NONTRIVIAL_DESTRUCTOR flags for all variants
of array type.
* g++.dg/opt/pr24780.C: New test.
Added:
branches/gcc-4_0-branch/gcc/testsuite/g++.dg/opt/pr24780.C
Modified:
branches/gcc-4_0-branch/gcc/cp/ChangeLog
branches/gcc-4_0-branch/gcc/cp/typeck.c
branches/gcc-4_0-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24780
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/24780] [4.0/4.1 Regression] ICE set_mem_attributes_minus_bitpos
2005-11-10 17:47 [Bug c++/24780] New: ICE set_mem_attributes_minus_bitpos ericboesch at hotmail dot com
` (8 preceding siblings ...)
2005-11-12 20:45 ` jakub at gcc dot gnu dot org
@ 2005-11-12 22:14 ` pinskia at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-12 22:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from pinskia at gcc dot gnu dot org 2005-11-12 22:14 -------
Fixed.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24780
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2005-11-12 22:14 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-10 17:47 [Bug c++/24780] New: ICE set_mem_attributes_minus_bitpos ericboesch at hotmail dot com
2005-11-10 17:52 ` [Bug c++/24780] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-11-10 21:11 ` pinskia at gcc dot gnu dot org
2005-11-10 22:53 ` janis at gcc dot gnu dot org
2005-11-10 23:20 ` pinskia at gcc dot gnu dot org
2005-11-11 6:26 ` mark at codesourcery dot com
2005-11-11 9:31 ` jakub at gcc dot gnu dot org
2005-11-11 9:40 ` jakub at gcc dot gnu dot org
2005-11-12 20:45 ` jakub at gcc dot gnu dot org
2005-11-12 20:45 ` jakub at gcc dot gnu dot org
2005-11-12 22:14 ` pinskia 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).