Bug 48749 - [4.6/4.7 Regression] internal compiler error: tree check: expected field_decl
Summary: [4.6/4.7 Regression] internal compiler error: tree check: expected field_decl
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.7.0
: P1 normal
Target Milestone: 4.6.1
Assignee: Jason Merrill
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-24 08:23 UTC by miles
Modified: 2011-05-05 15:03 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-04-24 13:18:23


Attachments
source code demonstrating bug (329 bytes, text/x-c++src)
2011-04-24 08:23 UTC, miles
Details

Note You need to log in before you can comment on or make changes to this bug.
Description miles 2011-04-24 08:23:38 UTC
Created attachment 24088 [details]
source code demonstrating bug

Compile the attached code with g++, and:

$ g++-snapshot -c ,barf.i.cc
,barf.i.cc: In member function 'virtual T CylinderMapTex<T>::eval(const TexCoords&) const':
,barf.i.cc:46:16: internal compiler error: tree check: expected field_decl, have identifier_node in fixed_type_or_null, at cp/class.c:5885
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-snapshot/README.Bugs> for instructions.

$ g++-snapshot --version
g++ (Debian 20110419-1) 4.7.0 20110419 (experimental) [trunk revision 172699]
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Thanks,

-miles
Comment 1 Paolo Carlini 2011-04-24 13:18:04 UTC
Looks like a regression in mainline.
Comment 2 Jakub Jelinek 2011-05-04 08:54:07 UTC
Started with http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171461
The patch has been backported to 4.6 branch as well and if built with --enable-checking=yes, it ICEs there the same way.

In:
5880	    case COMPONENT_REF:
5881	      /* If this component is really a base class reference, then the field
5882		 itself isn't definitive.  */
5883	      if (DECL_FIELD_IS_BASE (TREE_OPERAND (instance, 1)))
5884		return RECUR (TREE_OPERAND (instance, 0));
5885	      return RECUR (TREE_OPERAND (instance, 1));

instance is a COMPONENT_REF with type Pos, TREE_OPERAND (instance, 0) is
INDIRECT_REF - *coords and TREE_OPERAND (instance, 1) is not FIELD_DECL, but
IDENTIFIER_NODE pos.
Comment 3 Jason Merrill 2011-05-05 02:20:17 UTC
Author: jason
Date: Thu May  5 02:20:12 2011
New Revision: 173412

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173412
Log:
	PR c++/48749
	* class.c (resolves_to_fixed_type_p): Don't look closely
	in templates.

Added:
    trunk/gcc/testsuite/g++.dg/conversion/base1.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/class.c
    trunk/gcc/testsuite/ChangeLog
Comment 4 Jason Merrill 2011-05-05 02:51:06 UTC
Author: jason
Date: Thu May  5 02:51:01 2011
New Revision: 173414

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173414
Log:
	PR c++/48749
	* class.c (resolves_to_fixed_type_p): Don't look closely
	in templates.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/conversion/base1.C
Modified:
    branches/gcc-4_6-branch/gcc/cp/ChangeLog
    branches/gcc-4_6-branch/gcc/cp/class.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
Comment 5 Jason Merrill 2011-05-05 15:03:34 UTC
Fixed.