* [Bug c++/29435] [4.1 Regression] segmentation fault
2006-10-11 23:00 [Bug c++/29435] New: [4.1 Regression] segmentation fault tbm at cyrius dot com
@ 2006-10-11 23:01 ` tbm at cyrius dot com
2006-10-11 23:03 ` tbm at cyrius dot com
` (16 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: tbm at cyrius dot com @ 2006-10-11 23:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from tbm at cyrius dot com 2006-10-11 23:01 -------
Created an attachment (id=12413)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12413&action=view)
testcase
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29435
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/29435] [4.1 Regression] segmentation fault
2006-10-11 23:00 [Bug c++/29435] New: [4.1 Regression] segmentation fault tbm at cyrius dot com
2006-10-11 23:01 ` [Bug c++/29435] " tbm at cyrius dot com
@ 2006-10-11 23:03 ` tbm at cyrius dot com
2006-10-11 23:06 ` pinskia at gcc dot gnu dot org
` (15 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: tbm at cyrius dot com @ 2006-10-11 23:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from tbm at cyrius dot com 2006-10-11 23:02 -------
Ignore my comment about x86_64. I also see this on mips.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29435
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/29435] [4.1 Regression] segmentation fault
2006-10-11 23:00 [Bug c++/29435] New: [4.1 Regression] segmentation fault tbm at cyrius dot com
2006-10-11 23:01 ` [Bug c++/29435] " tbm at cyrius dot com
2006-10-11 23:03 ` tbm at cyrius dot com
@ 2006-10-11 23:06 ` pinskia at gcc dot gnu dot org
2006-10-11 23:19 ` tbm at cyrius dot com
` (14 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-11 23:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2006-10-11 23:05 -------
I think this is a sizeof issue:
sizeof (Rgb < XYindex >)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29435
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/29435] [4.1 Regression] segmentation fault
2006-10-11 23:00 [Bug c++/29435] New: [4.1 Regression] segmentation fault tbm at cyrius dot com
` (2 preceding siblings ...)
2006-10-11 23:06 ` pinskia at gcc dot gnu dot org
@ 2006-10-11 23:19 ` tbm at cyrius dot com
2006-10-12 3:36 ` pinskia at gcc dot gnu dot org
` (13 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: tbm at cyrius dot com @ 2006-10-11 23:19 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1194 bytes --]
------- Comment #4 from tbm at cyrius dot com 2006-10-11 23:19 -------
(gdb) where
#0 0x000000000045a5ce in cxx_sizeof_or_alignof_type (type=0x2b29cf3e6b00,
op=214, complain=1 '\001')
at /home/tbm/scratch/gcc-4.1/gcc/cp/typeck.c:1251
#1 0x000000000044a947 in cp_parser_unary_expression (parser=0x2b29cf261460,
address_p=0 '\0',
cast_p=0 '\0') at /home/tbm/scratch/gcc-4.1/gcc/cp/parser.c:4850
#2 0x000000000044ae15 in cp_parser_assignment_expression
(parser=0x2b29cf261460, cast_p=Variable "cast_p" is not available.
)
at /home/tbm/scratch/gcc-4.1/gcc/cp/parser.c:5579
#3 0x000000000044ba72 in cp_parser_parenthesized_expression_list
(parser=0x2b29cf261460,
is_attribute_list=240 'â', cast_p=0 '\0', non_constant_p=0x0)
at /home/tbm/scratch/gcc-4.1/gcc/cp/parser.c:4659
#4 0x000000000044a324 in cp_parser_unary_expression (parser=0x2b29cf261460,
address_p=0 '\0',
cast_p=1 '\001') at /home/tbm/scratch/gcc-4.1/gcc/cp/parser.c:4204
#5 0x000000000044ac41 in cp_parser_cast_expression (parser=0x2b29cf261460,
address_p=0 '\0',
cast_p=0 '\0') at /home/tbm/scratch/gcc-4.1/gcc/cp/parser.c:5455
...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29435
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/29435] [4.1 Regression] segmentation fault
2006-10-11 23:00 [Bug c++/29435] New: [4.1 Regression] segmentation fault tbm at cyrius dot com
` (3 preceding siblings ...)
2006-10-11 23:19 ` tbm at cyrius dot com
@ 2006-10-12 3:36 ` pinskia at gcc dot gnu dot org
2006-10-12 3:37 ` pinskia at gcc dot gnu dot org
` (12 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-12 3:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pinskia at gcc dot gnu dot org 2006-10-12 03:36 -------
Reduced testcase:
template < class T > struct Rgb;
template < int>int Camera1 ()
{
sizeof (Rgb < int>);
}
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |ice-on-invalid-code, ice-on-
| |valid-code
Last reconfirmed|0000-00-00 00:00:00 |2006-10-12 03:36:29
date| |
Target Milestone|--- |4.1.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29435
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/29435] [4.1 Regression] segmentation fault
2006-10-11 23:00 [Bug c++/29435] New: [4.1 Regression] segmentation fault tbm at cyrius dot com
` (4 preceding siblings ...)
2006-10-12 3:36 ` pinskia at gcc dot gnu dot org
@ 2006-10-12 3:37 ` pinskia at gcc dot gnu dot org
2006-10-12 3:39 ` pinskia at gcc dot gnu dot org
` (11 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-12 3:37 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from pinskia at gcc dot gnu dot org 2006-10-12 03:37 -------
The code in comment # 5 is invalid but even if we make it valid like below, it
still ICEs:
template < class T > struct Rgb{};
template < int>int Camera1 ()
{
sizeof (Rgb < int>);
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29435
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/29435] [4.1 Regression] segmentation fault
2006-10-11 23:00 [Bug c++/29435] New: [4.1 Regression] segmentation fault tbm at cyrius dot com
` (5 preceding siblings ...)
2006-10-12 3:37 ` pinskia at gcc dot gnu dot org
@ 2006-10-12 3:39 ` pinskia at gcc dot gnu dot org
2006-10-12 3:44 ` pinskia at gcc dot gnu dot org
` (10 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-12 3:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from pinskia at gcc dot gnu dot org 2006-10-12 03:39 -------
Works in 4.0.4 20061011.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |4.0.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29435
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/29435] [4.1 Regression] segmentation fault
2006-10-11 23:00 [Bug c++/29435] New: [4.1 Regression] segmentation fault tbm at cyrius dot com
` (6 preceding siblings ...)
2006-10-12 3:39 ` pinskia at gcc dot gnu dot org
@ 2006-10-12 3:44 ` pinskia at gcc dot gnu dot org
2006-10-12 3:48 ` [Bug c++/29435] [4.1/4.2 " pinskia at gcc dot gnu dot org
` (9 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-12 3:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from pinskia at gcc dot gnu dot org 2006-10-12 03:44 -------
I think this was caused by PR 29226.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
BugsThisDependsOn| |29226
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29435
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/29435] [4.1/4.2 Regression] segmentation fault
2006-10-11 23:00 [Bug c++/29435] New: [4.1 Regression] segmentation fault tbm at cyrius dot com
` (7 preceding siblings ...)
2006-10-12 3:44 ` pinskia at gcc dot gnu dot org
@ 2006-10-12 3:48 ` pinskia at gcc dot gnu dot org
2006-10-12 3:58 ` pinskia at gcc dot gnu dot org
` (8 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-12 3:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from pinskia at gcc dot gnu dot org 2006-10-12 03:48 -------
Also ICEs with 4.2.0 20061012 but did not with 4.2.0 20061002 (which I think
was built before PR 29226 came in).
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |blocker
Known to fail|4.1.2 |4.1.2 4.2.0
Summary|[4.1 Regression] |[4.1/4.2 Regression]
|segmentation fault |segmentation fault
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29435
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/29435] [4.1/4.2 Regression] segmentation fault
2006-10-11 23:00 [Bug c++/29435] New: [4.1 Regression] segmentation fault tbm at cyrius dot com
` (8 preceding siblings ...)
2006-10-12 3:48 ` [Bug c++/29435] [4.1/4.2 " pinskia at gcc dot gnu dot org
@ 2006-10-12 3:58 ` pinskia at gcc dot gnu dot org
2006-10-15 21:24 ` mmitchel at gcc dot gnu dot org
` (7 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-12 3:58 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from pinskia at gcc dot gnu dot org 2006-10-12 03:57 -------
The problem is that we have not layouted out the type yet, if we had with
something like:
template < class T >
struct Rgb{};
Rgb<int> t;
template < int>int Camera1 ()
{
sizeof (Rgb < int>);
}
We don't crash.
Something like this fixes the ICE but I don't know if we should not call
dependent_type_p twice or not, I have not checked if does causes an ICE for the
testcase of PR 29226 or not:
Index: ../../gcc/cp/typeck.c
===================================================================
--- ../../gcc/cp/typeck.c (revision 117656)
+++ ../../gcc/cp/typeck.c (working copy)
@@ -1256,6 +1256,9 @@ cxx_sizeof_or_alignof_type (tree type, e
value = size_one_node;
}
+ if (!dependent_type_p (type))
+ type = complete_type (type);
+
if (dependent_type_p (type)
/* VLA types will have a non-constant size. In the body of an
uninstantiated template, we don't need to try to compute the
@@ -1271,7 +1274,7 @@ cxx_sizeof_or_alignof_type (tree type, e
return value;
}
- return c_sizeof_or_alignof_type (complete_type (type),
+ return c_sizeof_or_alignof_type (type,
op == SIZEOF_EXPR,
complain);
}
--
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=29435
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/29435] [4.1/4.2 Regression] segmentation fault
2006-10-11 23:00 [Bug c++/29435] New: [4.1 Regression] segmentation fault tbm at cyrius dot com
` (9 preceding siblings ...)
2006-10-12 3:58 ` pinskia at gcc dot gnu dot org
@ 2006-10-15 21:24 ` mmitchel at gcc dot gnu dot org
2006-10-16 17:38 ` [Bug c++/29435] [4.1/4.2 Regression] seg fault with sizeof and templates mmitchel at gcc dot gnu dot org
` (6 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-10-15 21:24 UTC (permalink / raw)
To: gcc-bugs
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29435
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/29435] [4.1/4.2 Regression] seg fault with sizeof and templates
2006-10-11 23:00 [Bug c++/29435] New: [4.1 Regression] segmentation fault tbm at cyrius dot com
` (10 preceding siblings ...)
2006-10-15 21:24 ` mmitchel at gcc dot gnu dot org
@ 2006-10-16 17:38 ` mmitchel at gcc dot gnu dot org
2006-10-16 23:06 ` mmitchel at gcc dot gnu dot org
` (5 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-10-16 17:38 UTC (permalink / raw)
To: gcc-bugs
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |mark at codesourcery dot com
|dot org |
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29435
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/29435] [4.1/4.2 Regression] seg fault with sizeof and templates
2006-10-11 23:00 [Bug c++/29435] New: [4.1 Regression] segmentation fault tbm at cyrius dot com
` (11 preceding siblings ...)
2006-10-16 17:38 ` [Bug c++/29435] [4.1/4.2 Regression] seg fault with sizeof and templates mmitchel at gcc dot gnu dot org
@ 2006-10-16 23:06 ` mmitchel at gcc dot gnu dot org
2006-10-16 23:11 ` [Bug c++/29435] [4.1 " mmitchel at gcc dot gnu dot org
` (4 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-10-16 23:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from mmitchel at gcc dot gnu dot org 2006-10-16 23:06 -------
Subject: Bug 29435
Author: mmitchel
Date: Mon Oct 16 23:06:35 2006
New Revision: 117799
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117799
Log:
PR c++/29435
* typeck.c (cxx_sizeof_or_alignof_type): Complete non-dependent
types when their sizes are required. Refine test for VLAs.
PR c++/29435
* g++.dg/template/sizeof11.C: New test.
Added:
trunk/gcc/testsuite/g++.dg/template/sizeof11.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/typeck.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29435
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/29435] [4.1 Regression] seg fault with sizeof and templates
2006-10-11 23:00 [Bug c++/29435] New: [4.1 Regression] segmentation fault tbm at cyrius dot com
` (12 preceding siblings ...)
2006-10-16 23:06 ` mmitchel at gcc dot gnu dot org
@ 2006-10-16 23:11 ` mmitchel at gcc dot gnu dot org
2006-10-17 1:56 ` mmitchel at gcc dot gnu dot org
` (3 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-10-16 23:11 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from mmitchel at gcc dot gnu dot org 2006-10-16 23:11 -------
Fixed in 4.2.0.
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.1/4.2 Regression] seg |[4.1 Regression] seg fault
|fault with sizeof and |with sizeof and templates
|templates |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29435
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/29435] [4.1 Regression] seg fault with sizeof and templates
2006-10-11 23:00 [Bug c++/29435] New: [4.1 Regression] segmentation fault tbm at cyrius dot com
` (13 preceding siblings ...)
2006-10-16 23:11 ` [Bug c++/29435] [4.1 " mmitchel at gcc dot gnu dot org
@ 2006-10-17 1:56 ` mmitchel at gcc dot gnu dot org
2006-10-17 1:57 ` mmitchel at gcc dot gnu dot org
` (2 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-10-17 1:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from mmitchel at gcc dot gnu dot org 2006-10-17 01:56 -------
Subject: Bug 29435
Author: mmitchel
Date: Tue Oct 17 01:56:23 2006
New Revision: 117813
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117813
Log:
PR c++/29435
* typeck.c (cxx_sizeof_or_alignof_type): Complete non-dependent
types when their sizes are required. Refine test for VLAs.
PR c++/29435
* g++.dg/template/sizeof11.C: New test.
Added:
branches/gcc-4_1-branch/gcc/testsuite/g++.dg/template/sizeof11.C
Modified:
branches/gcc-4_1-branch/gcc/cp/ChangeLog
branches/gcc-4_1-branch/gcc/cp/typeck.c
branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29435
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/29435] [4.1 Regression] seg fault with sizeof and templates
2006-10-11 23:00 [Bug c++/29435] New: [4.1 Regression] segmentation fault tbm at cyrius dot com
` (14 preceding siblings ...)
2006-10-17 1:56 ` mmitchel at gcc dot gnu dot org
@ 2006-10-17 1:57 ` mmitchel at gcc dot gnu dot org
2006-11-03 18:30 ` pinskia at gcc dot gnu dot org
2006-12-02 7:35 ` pinskia at gcc dot gnu dot org
17 siblings, 0 replies; 19+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-10-17 1:57 UTC (permalink / raw)
To: gcc-bugs
------- Comment #14 from mmitchel at gcc dot gnu dot org 2006-10-17 01:56 -------
Fixed in 4.1.2.
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29435
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/29435] [4.1 Regression] seg fault with sizeof and templates
2006-10-11 23:00 [Bug c++/29435] New: [4.1 Regression] segmentation fault tbm at cyrius dot com
` (15 preceding siblings ...)
2006-10-17 1:57 ` mmitchel at gcc dot gnu dot org
@ 2006-11-03 18:30 ` pinskia at gcc dot gnu dot org
2006-12-02 7:35 ` pinskia at gcc dot gnu dot org
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-11-03 18:30 UTC (permalink / raw)
To: gcc-bugs
------- Comment #15 from pinskia at gcc dot gnu dot org 2006-11-03 18:29 -------
*** Bug 29698 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |skalaren_alpinist at abv dot
| |bg
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29435
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/29435] [4.1 Regression] seg fault with sizeof and templates
2006-10-11 23:00 [Bug c++/29435] New: [4.1 Regression] segmentation fault tbm at cyrius dot com
` (16 preceding siblings ...)
2006-11-03 18:30 ` pinskia at gcc dot gnu dot org
@ 2006-12-02 7:35 ` pinskia at gcc dot gnu dot org
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-12-02 7:35 UTC (permalink / raw)
To: gcc-bugs
------- Comment #16 from pinskia at gcc dot gnu dot org 2006-12-02 07:35 -------
*** Bug 30042 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bagnara at cs dot unipr dot
| |it
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29435
^ permalink raw reply [flat|nested] 19+ messages in thread