This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/70344] [6 Regression] ICE on valid code at -O1 and above on x86_64-linux-gnu in adjust_temp_type, at cp/constexpr.c:1078
- From: "ppalka at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 23 Mar 2016 02:05:23 +0000
- Subject: [Bug c++/70344] [6 Regression] ICE on valid code at -O1 and above on x86_64-linux-gnu in adjust_temp_type, at cp/constexpr.c:1078
- Auto-submitted: auto-generated
- References: <bug-70344-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70344
--- Comment #3 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Problem ultimately seems to be that we're calling cp_fold_function on fn()
before we call cp_genericize on it which is responsible for fixing up fn()'s
parameter 'v' which is passed by invisible reference. The TREE_TYPE of v is a
RECORD_TYPE before the fix-up, but after the fix-up it's a REFERENCE_TYPE to a
RECORD_TYPE. The 1st argument to the recursive call to fn() however is a
REFERENCE_TYPE. So in cxx_eval_call_expression (called indirectly from
cp_fold_function) we see that fn() expects a RECORD_TYPE (because its parms
haven't been fixed up yet) but the call passes a REFERENCE_TYPE. This type
confusion triggers the ICE.