From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E687D3861808; Wed, 6 Dec 2023 07:33:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E687D3861808 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701848024; bh=9s+bS3Ow1o3ckuIwuVoM5M9TESW8s5mabxxta2PvOGE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JyeAM0HFUmxsxJjuDP11yI+bU28Be8viPrUbUasqVS4+hHlTzzdwTiczkBE82CO27 IfBb9+sPV0llVlEWqsf7P0B7rFfjyNF5FQ1T10bjsMS2EW+XeIHtWUVdkT9VirBFlK BoFHlu75H577o08nGWgKaQQe6GGAe9QRooC25Dek= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/112830] internal compiler error: in convert_memory_address_addr_space_1, at explow.cc:302 Date: Wed, 06 Dec 2023 07:33:43 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: addr-space, ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112830 --- Comment #16 from Richard Biener --- (In reply to Georg-Johann Lay from comment #15) > (In reply to Richard Biener from comment #13) > > The master branch has been updated by Richard Biener : > >=20 > > https://gcc.gnu.org/g:68d32d02035fc081384ec6d6fd275e49ffa5d016 > >=20 > > commit r14-6182-g68d32d02035fc081384ec6d6fd275e49ffa5d016 > > Author: Richard Biener > > Date: Mon Dec 4 10:35:38 2023 +0100 > >=20 > > middle-end/112830 - avoid gimplifying non-default addr-space assign= to > > memcpy > >=20=20=20=20=20 > > The following avoids turning aggregate copy involving non-default > > address-spaces to memcpy since that is not prepared for that. >=20 > avr.md cpymemhi currently only accepts const_int sizes. Does your change > mean it's not possible (or unsafe) to implement that insn with variable > sizes for better code? >=20 > The middle end still tries to expand cpymemhi for variable sizes (but > currently the expander FAILs), so I think I don't understand that part of > the commit message. It specifically avoids expanding __builtin_memcpy since that goes off rails, losing address-space info. And a user using memcpy () himself for copying between address-spaces is doing invalid things anyway. The middle-end should still try to use cpymem and as fallback will emit a loop IIRC. Tuning from within the backend should be still possible, also for variable-size. It might be the middle-end needs improvements as well, feel free to open new bugreports with testcases where things do not work as expected from the middle-end side.=