Bug 37417 - [4.4 Regression] error: type mismatch in binary expression, verify_gimple failed
Summary: [4.4 Regression] error: type mismatch in binary expression, verify_gimple failed
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.4.0
: P1 normal
Target Milestone: 4.4.0
Assignee: Jakub Jelinek
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2008-09-08 08:46 UTC by Martin Michlmayr
Modified: 2008-09-09 22:13 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-09-09 16:41:19


Attachments
Preprocessed code (169.25 KB, application/octet-stream)
2008-09-08 08:53 UTC, Martin Michlmayr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Michlmayr 2008-09-08 08:46:18 UTC
With current trunk (revision 140100):

(sid)1089:tbm@em64t: ~] /usr/lib/gcc-snapshot/bin/gcc -c -O2 asc-edgen.ii
./../../edgen.cpp: In member function 'void tmapgenerator::init()':
./../../edgen.cpp:71: error: type mismatch in binary expression
long unsigned int

long unsigned int

int

D.95017 = D.95016 + 1;

./../../edgen.cpp:71: internal compiler error: verify_gimple failed
Please submit a full bug report,
Comment 1 Martin Michlmayr 2008-09-08 08:48:12 UTC
Forgot to mention that this also happens with -O0
Comment 2 Martin Michlmayr 2008-09-08 08:53:31 UTC
Created attachment 16251 [details]
Preprocessed code
Comment 3 Martin Michlmayr 2008-09-08 10:08:25 UTC
/* Testcase by Martin Michlmayr <tbm@cyrius.com> */

class tplasma
{
  public: int maxx;
};
tplasma plasma;
void init (void)
{
  new (char[plasma.maxx]);
}
Comment 4 Andrew Pinski 2008-09-08 21:05:56 UTC
Even more reduced testcase:
void init (int a)
{
  new (char[a]);
}
Comment 5 Jakub Jelinek 2008-09-09 16:41:19 UTC
FE bug:
tree
array_type_nelts_top (tree type)
{
  return fold_build2 (PLUS_EXPR, sizetype,
                      array_type_nelts (type),
                      integer_one_node);
}
Should use size_one_node instead.
Comment 6 Jakub Jelinek 2008-09-09 22:10:13 UTC
Subject: Bug 37417

Author: jakub
Date: Tue Sep  9 22:08:46 2008
New Revision: 140178

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140178
Log:
	PR c++/37417
	* tree.c (array_type_nelts_top): Add size_one_node instead of
	integer_one_node.

	* g++.dg/ext/vla5.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/ext/vla5.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/tree.c
    trunk/gcc/testsuite/ChangeLog

Comment 7 Jakub Jelinek 2008-09-09 22:13:41 UTC
Fixed.