From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 127FC38930F7; Fri, 24 Apr 2020 13:12:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 127FC38930F7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587733921; bh=bbgoQRZsP8/nwAj8YcmeiCPE5rz9tUle26C4SgkWDZo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pW48kjItPLfukepweKUvjxy5iSnwZNCDn6AIVJ3SUmB5fEofa7lHzl8pcnMmPH3AF qt0frKJ+R3/42CnBRpDcuo05UsEFnHDli81LPUooAO1IW6//asppArUmcPg0HA9LlZ 6+TVPooUQhavLpp4PT3Vpgvz7+XUmIZIUuLhssNU= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/90448] [8/9 Regression] decltype-based lambda parameter pack is rejected Date: Fri, 24 Apr 2020 13:11:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 9.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 8.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Apr 2020 13:12:01 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D90448 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hubicka at gcc dot gnu.org, | |segher at gcc dot gnu.org --- Comment #7 from Jakub Jelinek --- So, seems the second argument of the call is some empty class - struct ._anon_2, 1 byte long, and the FE in the CALL_EXPR passes an empty CONSTRUC= TOR of that type. The gimplifier then creates a temporary for that (and doesn't initialize it= ), so we have: struct ._anon_2 D.3223; : =3D fooV<{const char*, int, double, char, float, short int, unsi= gned int}>::::operator()::, const char= *, int, double, char, float, short int, unsigned int> (0B, D.3223, _2(D) , _3(D), _4(D), _5(D), _6(D), _7(D), _8(D)); [return slot optimization] up to *.optimized in a thunk, D.3223 is not initialized (contains just padd= ing) and is passed by value to the call. Now, on powerpc -m32, the ABI wants to pass that by reference - if (pass_by_reference (args_so_far_pnt, arg)) is true, and we enter: /* If we're compiling a thunk, pass through invisible references instead of making a copy. */ if (call_from_thunk_p || (callee_copies && !TREE_ADDRESSABLE (type) && (base =3D get_base_address (args[i].tree_value)) && TREE_CODE (base) !=3D SSA_NAME && (!DECL_P (base) || MEM_P (DECL_RTL (base))))) block because call_from_thunk_p is true. But, base is a DECL with DECL_RTL= of a (reg:QI ...). The code calls mark_addressable on args[i].tree_value, but that doesn't do anything immediately, because currently_expanding_to_rtl is true (but even = if it would, that doesn't change DECL_RTL of the arg being passed). Later the code calls build_fold_addr_expr_loc and ICEs when expanding that, because trying to expand ADDR_EXPR on a VAR_DECL with DECL_RTL of (reg:QI .= ..) doesn't work. I don't see how this can be implemented other than actually making a copy, so wonder if the condition shouldn't be if ((call_from_thunk_p || callee_copies) && !TREE_ADDRESSABLE (type) && ... instead. But what do I know about thunks.=