Bug 53209 - [4.7 Regression] tree check ICE: expected tree_vec, have error_mark in comp_template_args_with_info, at cp/pt.c:7038
Summary: [4.7 Regression] tree check ICE: expected tree_vec, have error_mark in comp_t...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: 4.8.0
Assignee: Alexandre Oliva
URL:
Keywords:
: 53177 53244 53280 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-05-03 10:57 UTC by Martin Jambor
Modified: 2012-05-15 04:33 UTC (History)
8 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2012-05-04 00:00:00


Attachments
Testcase (181.46 KB, application/x-bzip)
2012-05-03 10:57 UTC, Martin Jambor
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Jambor 2012-05-03 10:57:09 UTC
Created attachment 27302 [details]
Testcase

Hi,

starting with revision 186789, a native i686 compiler ICEs on the
attached testcase with the following message:

--------------------------------------------------
jamborm@gcc45:~/tmp$ ~/gcc/trunk/inst/bin/g++ -g -O2 -D_GNU_SOURCE -c -fPIC -std=gnu++11 -fno-implicit-templates  functexcept.ii

In file included from /home/mjambor/gcc/trunk/obj/i686-pc-linux-gnu/libstdc++-v3/include/future:38:0,            
                 from /home/mjambor/gcc/trunk/src/libstdc++-v3/src/c++11/functexcept.cc:32:
/home/mjambor/gcc/trunk/obj/i686-pc-linux-gnu/libstdc++-v3/include/functional: In member function ‘std::__regex::_StateIdT std::__regex::_Nfa::_M_insert_accept()’:
/home/mjambor/gcc/trunk/obj/i686-pc-linux-gnu/libstdc++-v3/include/functional:2057:63: internal compiler error: tree check: expected tree_vec, have error_mark in comp_template_args_with_info, at cp/pt.c:7038
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
--------------------------------------------------

I'm sorry the testcase is not at all reduced but multidelta has only
managed to produce something that makes GCC run out of memory on my
i686 desktop.  I may try again over the next night.

One particular problem with this ICE is that starting with revision
186948 (a libstdc++ change), I cannot build gcc on my i686 desktop,
(which means that until this is resolved I cannot follow trunk when
doing my work!), although I do not have this problem on a i686 machine
on the compile farm (gcc45).  However, when I take the pre-processed
source to that machine, the trunk compiler ICEs there too (with the
same exact error).

The ICE has started to appear with the following commit (that is the
reason why I filed the component as target):

------------------------------------------------------------------------
r186789 | tmsriram | 2012-04-25 02:08:37 +0200 (Wed, 25 Apr 2012) | 61 lines

2012-04-24  Sriraman Tallam  <tmsriram@google.com>

This patch adds new builtins to check for cpu type and features.

* __builtin_cpu_is ("<CPUNAME>")
* __builtin_cpu_supports ("<FEATURE>")

apart from the cpu init builtin, __builtin_cpu_init.

List of CPU names :

* "amd"
* "intel"
* "atom"
* "core2"
* "corei7"
* "nehalem"                    
* "westmere"                   
* "sandybridge"                
* "amdfam10h"                  
* "barcelona"                  
* "shanghai"                   
* "istanbul"                   
* "bdver1"                     
* "bdver2"                     
                               
List of CPU features :         
                               
* "cmov"                       
* "mmx"                        
* "popcnt"                     
* "sse"                        
* "sse2"                       
* "sse3"                       
* "ssse3"                      
* "sse4.1"                     
* "sse4.2"                     
* "avx"                        
                               
        * config/i386/i386.c (build_processor_model_struct): New function.
        (make_var_decl): New function.
        (fold_builtin_cpu): New function.
        (ix86_fold_builtin): New function.
        (make_cpu_type_builtin): New function.
        (ix86_init_platform_type_builtins): New function.
        (ix86_expand_builtin): Expand new builtins by folding them.
        (ix86_init_builtins): Make new builtins to detect CPU type.
        (TARGET_FOLD_BUILTIN): New macro.
        (IX86_BUILTIN_CPU_INIT): New enum value.
        (IX86_BUILTIN_CPU_IS): New enum value.
        (IX86_BUILTIN_CPU_SUPPORTS): New enum value.
        * config/i386/i386-builtin-types.def: New function type.
        * testsuite/gcc.target/builtin_target.c: New testcase.
        * doc/extend.texi: Document builtins.
                               
        * libgcc/config/i386/i386-cpuinfo.c: New file.
        * libgcc/config/i386/t-cpuinfo: New file.
        * libgcc/config.host: Include t-cpuinfo.
        * libgcc/config/i386/libgcc-glibc.ver: Version symbol __cpu_model.
Comment 1 H.J. Lu 2012-05-03 15:56:07 UTC
I think this is the same as PR 53177.
Comment 2 H.J. Lu 2012-05-04 02:42:22 UTC
*** Bug 53177 has been marked as a duplicate of this bug. ***
Comment 3 H.J. Lu 2012-05-04 14:32:12 UTC
The failure is the same as

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53177#c4

and also happens on 4.7.  It is caused by revision 181118:

http://gcc.gnu.org/ml/gcc-cvs/2011-11/msg00406.html
Comment 4 Paolo Carlini 2012-05-04 14:38:17 UTC
Hey HJ, is your regression hunting machine back to life?
Comment 5 H.J. Lu 2012-05-04 14:42:08 UTC
(In reply to comment #4)
> Hey HJ, is your regression hunting machine back to life?

Yes.
Comment 6 Martin Jambor 2012-05-04 14:55:49 UTC
It seems to me that Alexandre has posted a patch to address this
issue:

http://gcc.gnu.org/ml/gcc-patches/2012-05/msg00280.html

Hm, it does seem far more probable that the problem is caused by
revision 181118 rather than 186789 as I stated in the bug summary, but
I have double checked that yesterday (on gcc45 on compile farm).
Strange.
Comment 7 Igor Zamyatin 2012-05-05 06:46:26 UTC
This patch fixes problem for me
Comment 8 Paolo Carlini 2012-05-05 09:59:58 UTC
*** Bug 53244 has been marked as a duplicate of this bug. ***
Comment 9 H.J. Lu 2012-05-08 14:27:43 UTC
*** Bug 53280 has been marked as a duplicate of this bug. ***
Comment 10 Alexandre Oliva 2012-05-11 13:25:38 UTC
Mine
Comment 11 Alexandre Oliva 2012-05-11 13:27:15 UTC
Author: aoliva
Date: Fri May 11 13:27:03 2012
New Revision: 187404

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187404
Log:
PR c++/53209
* pt.c (tsubst_decl): Bail out if argvec is error_mark_node.

Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
Comment 12 Alexandre Oliva 2012-05-11 13:52:00 UTC
Fixed
Comment 13 Alexandre Oliva 2012-05-11 13:52:58 UTC
Fixed, really!
Comment 14 Richard Biener 2012-05-11 14:16:00 UTC
What about the branch?
Comment 15 Alexandre Oliva 2012-05-14 05:27:18 UTC
Sorry, I didn't realize the problem affected the 4.7 branch as well.  I've just asked for approval to install it there, and I'm reopening the bug (with a narrower regression branch set) until it's fixed there.
Comment 16 Alexandre Oliva 2012-05-15 04:25:40 UTC
Author: aoliva
Date: Tue May 15 04:25:25 2012
New Revision: 187497

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187497
Log:
PR c++/53209
* pt.c (tsubst_decl): Bail out if argvec is error_mark_node.

Modified:
    branches/gcc-4_7-branch/gcc/cp/ChangeLog
    branches/gcc-4_7-branch/gcc/cp/pt.c
Comment 17 Alexandre Oliva 2012-05-15 04:33:42 UTC
Fixed in the 4.7 branch too.