From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 272283858D37; Sun, 19 May 2024 15:20:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 272283858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1716132001; bh=J0QN4dT6vdJePWltD3PCsVsEQkUNKctUfkNMcZtIiNw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DK3t82+VV/TpJbS6pL8lc/RLRW/4JZEWKdHvJV5JG3mzrojiWh4wM//5Q0XQUjzV5 5ctuat0SoLPkRcjnEkl8d1ogrZQNZENITcaEBOk5GLP5akiVvhm3KzXIDui14NsKGF DKaOlSF0Bz2k501g6xmVx1l8pGbXy2MtvhHw6IMU= From: "olegendo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/115148] [SH] [12/13/14 Regression]: libcanberra fails with 'unaligned opcodes detected in executable segment' Date: Sun, 19 May 2024 15:20:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: olegendo at gcc dot gnu.org X-Bugzilla-Status: NEW 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: 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=3D115148 --- Comment #8 from Oleg Endo --- (In reply to Oleg Endo from comment #7) > (In reply to Oleg Endo from comment #5) > >=20 > > The following hunk seems to fix the ".align 1" following the short byte= table > >=20 > > diff --git a/gcc/config/sh/sh.cc b/gcc/config/sh/sh.cc > > index ef3c2e6791d..01349328171 100644 > > --- a/gcc/config/sh/sh.cc > > +++ b/gcc/config/sh/sh.cc > > @@ -5755,7 +5755,7 @@ barrier_align (rtx_insn *barrier_or_label) > > return ((optimize_size > > || ((unsigned) XVECLEN (pat, 1) * GET_MODE_SIZE (GET_MODE > > (pat)) > > <=3D (unsigned) 1 << (CACHE_LOG - 2))) > > - ? 1 : align_jumps.levels[0].log); > > + ? 2 : align_jumps.levels[0].log); > > } > >=20=20 > > rtx_insn *next =3D next_active_insn (barrier_or_label); > >=20 > >=20 >=20 > Sorry, I forgot that ".align 1" actually means alignment on 2-byte bounda= ry. > So that shouldn't be the issue there. But indeed, there is something going on with the placement of the .align directive after the short byte table. -------------------- GCC 11: .L225: .long ov_read@PLT-(.LPCS29+2-.) .align 2 .L188: .byte .L214-.L189 .byte .L214-.L189 .byte .L197-.L189 .LVL111: .align 1 .L191: .LBE111: .LBE110: .loc 1 234 9 .loc 1 234 14 ! read-vorbis.c:234: ca_assert(v->size >=3D (off_t) n_read); -------------------- GCC 13: .L225: .long ov_read@PLT-(.LPCS29+2-.) .align 2 .L187: .byte .L213-.L188 .byte .L213-.L188 .byte .L179-.L188 .LVL110: .LBE111: .LBE110: .loc 1 234 9 .loc 1 234 14 .align 1 .L285: .align 1 .L286: ! read-vorbis.c:234: ca_assert(v->size >=3D (off_t) n_read); This puts the labels LVL110, LBE111, LBE110 at the wrong odd byte alignment= .=20 Adding a '.align 1' manually after the byte table allows assembling the file without errors. It looks like something dpulicates the ".align 1" directive after the byte table and then also duplicates it. Perhaps the directive is treated wrongl= y as an insn or something like that .....=20 Adrian, if you have the means, can you bisect it to pinpoint the commit whe= re this error starts occuring?=