public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/33709] New: [4.3 Regression] Type verification failure with new expression
@ 2007-10-09 9:39 rguenth at gcc dot gnu dot org
2007-10-22 8:37 ` [Bug c++/33709] " pinskia at gcc dot gnu dot org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-10-09 9:39 UTC (permalink / raw)
To: gcc-bugs
template <typename T>
struct Tuple {
T* base;
void AllocateMoreSpace(unsigned size) {
base = (new T[1]) - size;
}
};
class ErrorInfo {
virtual void getErrorMessage();
};
template class Tuple<ErrorInfo>;
body.3.ii: In member function 'void Tuple<T>::AllocateMoreSpace(unsigned int)
[with T = ErrorInfo]':
body.3.ii:11: instantiated from here
body.3.ii:4: error: type mismatch in pointer plus expression
struct ErrorInfo *
struct ErrorInfo[1] *
long unsigned int
D.2076 = D.2044 + D.2075
body.3.ii:4: internal compiler error: verify_gimple failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
--
Summary: [4.3 Regression] Type verification failure with new
expression
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code, ice-checking
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rguenth at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33709
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/33709] [4.3 Regression] Type verification failure with new expression
2007-10-09 9:39 [Bug c++/33709] New: [4.3 Regression] Type verification failure with new expression rguenth at gcc dot gnu dot org
@ 2007-10-22 8:37 ` pinskia at gcc dot gnu dot org
2007-10-28 0:49 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-22 8:37 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2007-10-22 08:37 -------
Confirmed.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-10-22 08:37:45
date| |
Target Milestone|--- |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33709
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/33709] [4.3 Regression] Type verification failure with new expression
2007-10-09 9:39 [Bug c++/33709] New: [4.3 Regression] Type verification failure with new expression rguenth at gcc dot gnu dot org
2007-10-22 8:37 ` [Bug c++/33709] " pinskia at gcc dot gnu dot org
@ 2007-10-28 0:49 ` pinskia at gcc dot gnu dot org
2007-10-30 13:13 ` jakub at gcc dot gnu dot org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-28 0:49 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2007-10-28 00:49 -------
(void) (((struct Tuple *) this)->base = TARGET_EXPR <D.2023, (struct
ErrorInfo[1] *) operator new [] (4)>;, try
Note, this is not related to templates, you can reproduce the ICE with the
following source too (I think ErrorInfo just needs to be a non-POD):
class ErrorInfo {
virtual void getErrorMessage();
};
struct Tuple {
ErrorInfo* base;
void AllocateMoreSpace(unsigned size) {
base = (new ErrorInfo[1]) - size;
}
};
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33709
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/33709] [4.3 Regression] Type verification failure with new expression
2007-10-09 9:39 [Bug c++/33709] New: [4.3 Regression] Type verification failure with new expression rguenth at gcc dot gnu dot org
2007-10-22 8:37 ` [Bug c++/33709] " pinskia at gcc dot gnu dot org
2007-10-28 0:49 ` pinskia at gcc dot gnu dot org
@ 2007-10-30 13:13 ` jakub at gcc dot gnu dot org
2007-10-30 13:24 ` rguenther at suse dot de
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-10-30 13:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from jakub at gcc dot gnu dot org 2007-10-30 13:12 -------
Testing a fix:
--- gcc/fold-const.c.jj 2007-10-19 14:39:55.000000000 +0200
+++ gcc/fold-const.c 2007-10-30 14:09:39.000000000 +0100
@@ -9504,12 +9504,15 @@ fold_binary (enum tree_code code, tree t
if (TREE_CODE (arg0) == COMPOUND_EXPR)
return build2 (COMPOUND_EXPR, type, TREE_OPERAND (arg0, 0),
fold_build2 (code, type,
- TREE_OPERAND (arg0, 1), op1));
+ fold_convert (TREE_TYPE (op0),
+ TREE_OPERAND (arg0, 1)),
+ op1));
if (TREE_CODE (arg1) == COMPOUND_EXPR
&& reorder_operands_p (arg0, TREE_OPERAND (arg1, 0)))
return build2 (COMPOUND_EXPR, type, TREE_OPERAND (arg1, 0),
- fold_build2 (code, type,
- op0, TREE_OPERAND (arg1, 1)));
+ fold_build2 (code, type, op0,
+ fold_convert (TREE_TYPE (op1),
+ TREE_OPERAND (arg1, 1))));
if (TREE_CODE (arg0) == COND_EXPR || COMPARISON_CLASS_P (arg0))
{
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jakub at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
Last reconfirmed|2007-10-22 08:37:45 |2007-10-30 13:13:00
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33709
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/33709] [4.3 Regression] Type verification failure with new expression
2007-10-09 9:39 [Bug c++/33709] New: [4.3 Regression] Type verification failure with new expression rguenth at gcc dot gnu dot org
` (2 preceding siblings ...)
2007-10-30 13:13 ` jakub at gcc dot gnu dot org
@ 2007-10-30 13:24 ` rguenther at suse dot de
2007-10-30 22:40 ` jakub at gcc dot gnu dot org
2007-10-30 22:42 ` jakub at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: rguenther at suse dot de @ 2007-10-30 13:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from rguenther at suse dot de 2007-10-30 13:24 -------
Subject: Re: [4.3 Regression] Type verification failure with
new expression
On Tue, 30 Oct 2007, jakub at gcc dot gnu dot org wrote:
> ------- Comment #3 from jakub at gcc dot gnu dot org 2007-10-30 13:12 -------
> Testing a fix:
> --- gcc/fold-const.c.jj 2007-10-19 14:39:55.000000000 +0200
> +++ gcc/fold-const.c 2007-10-30 14:09:39.000000000 +0100
> @@ -9504,12 +9504,15 @@ fold_binary (enum tree_code code, tree t
> if (TREE_CODE (arg0) == COMPOUND_EXPR)
> return build2 (COMPOUND_EXPR, type, TREE_OPERAND (arg0, 0),
> fold_build2 (code, type,
> - TREE_OPERAND (arg0, 1), op1));
> + fold_convert (TREE_TYPE (op0),
> + TREE_OPERAND (arg0, 1)),
> + op1));
> if (TREE_CODE (arg1) == COMPOUND_EXPR
> && reorder_operands_p (arg0, TREE_OPERAND (arg1, 0)))
> return build2 (COMPOUND_EXPR, type, TREE_OPERAND (arg1, 0),
> - fold_build2 (code, type,
> - op0, TREE_OPERAND (arg1, 1)));
> + fold_build2 (code, type, op0,
> + fold_convert (TREE_TYPE (op1),
> + TREE_OPERAND (arg1, 1))));
>
> if (TREE_CODE (arg0) == COND_EXPR || COMPARISON_CLASS_P (arg0))
> {
Pre-approved if it works (it looks obvious). Thanks.
Richard.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33709
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/33709] [4.3 Regression] Type verification failure with new expression
2007-10-09 9:39 [Bug c++/33709] New: [4.3 Regression] Type verification failure with new expression rguenth at gcc dot gnu dot org
` (3 preceding siblings ...)
2007-10-30 13:24 ` rguenther at suse dot de
@ 2007-10-30 22:40 ` jakub at gcc dot gnu dot org
2007-10-30 22:42 ` jakub at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-10-30 22:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from jakub at gcc dot gnu dot org 2007-10-30 22:40 -------
Subject: Bug 33709
Author: jakub
Date: Tue Oct 30 22:40:13 2007
New Revision: 129785
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129785
Log:
PR c++/33709
* fold-const.c (fold_binary): If one argument is COMPOUND_EXPR,
convert second operand of COMPOUND_EXPR to the original type of
that argument.
* g++.dg/opt/compound1.C: New test.
Added:
trunk/gcc/testsuite/g++.dg/opt/compound1.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/fold-const.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33709
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/33709] [4.3 Regression] Type verification failure with new expression
2007-10-09 9:39 [Bug c++/33709] New: [4.3 Regression] Type verification failure with new expression rguenth at gcc dot gnu dot org
` (4 preceding siblings ...)
2007-10-30 22:40 ` jakub at gcc dot gnu dot org
@ 2007-10-30 22:42 ` jakub at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-10-30 22:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from jakub at gcc dot gnu dot org 2007-10-30 22:42 -------
Fixed.
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33709
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-10-30 22:42 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-09 9:39 [Bug c++/33709] New: [4.3 Regression] Type verification failure with new expression rguenth at gcc dot gnu dot org
2007-10-22 8:37 ` [Bug c++/33709] " pinskia at gcc dot gnu dot org
2007-10-28 0:49 ` pinskia at gcc dot gnu dot org
2007-10-30 13:13 ` jakub at gcc dot gnu dot org
2007-10-30 13:24 ` rguenther at suse dot de
2007-10-30 22:40 ` jakub at gcc dot gnu dot org
2007-10-30 22:42 ` jakub 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).