From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1F4883858D37; Wed, 17 Apr 2024 21:18:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1F4883858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713388688; bh=1kgPn+z4azreIwa0PzzB5JVjEwtFDLXmfh9kuwmEiXU=; h=From:To:Subject:Date:From; b=sOPpIwrhHBOP1u4N9WSHL9pZhJW6EK9zOpo0L8RLvYOKMIPcfiAm2QqriNzmG6l7o j57D1r33v8guzhVRc9BHTaMeiewny9NuE0SY7XOThYsuP5jOJfU9N0Qa3BZDj8l3j2 zfL5Df5tfXDgOz9ti5Odxs+rk/OabIV0caBmhRtw= From: "bergner at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/114759] New: Power: multiple issues with -mrop-protect Date: Wed, 17 Apr 2024 21:18:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: bergner at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D114759 Bug ID: 114759 Summary: Power: multiple issues with -mrop-protect Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: bergner at gcc dot gnu.org Target Milestone: --- There are multiple issues with the -mrop-protect option which are all inter-related. 1. We always define the __ROP_PROTECT__ predefined macro when using -mrop-protect, even when we've silently disabled ROP protection because of a too old -mcpu=3DCPU value. We should only emit __ROP_PROTECT__ when it's l= egal to emit the ROP insns. 2. We always disable shrink-wrapping when -mrop-protect is used, even when we've silently disabled ROP protection because of a too old -mcpu=3DCPU val= ue.=20 We should not disable shrink-wrapping if we've disabled ROP protection. 3. We silently disable ROP protection for everything other than -mcpu=3Dpow= er10.=20 The binutils assembler accepts the ROP insns back to Power8, so we should e= mit them for Power8 and later. 4. We give an error when -mrop-protect is used with any -mabi=3DABI value n= ot equal to ELFv2, whereas a too old -mcpu=3DCPU value only causes us to silen= tly disable ROP protection. I think both scenarios should behave similarly, so either we silently disable ROP protection for both or we give an error for both. This is not a regression. I consider 1. to be a correctness/wrong code bug= .=