public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "olegendo at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-115148-4-LxzC1J6nFy@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-115148-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115148

--- Comment #8 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Oleg Endo from comment #7)
> (In reply to Oleg Endo from comment #5)
> > 
> > The following hunk seems to fix the ".align 1" following the short byte table
> > 
> > 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))
> >                    <= (unsigned) 1 << (CACHE_LOG - 2)))
> > -             ? 1 : align_jumps.levels[0].log);
> > +             ? 2 : align_jumps.levels[0].log);
> >      }
> >  
> >    rtx_insn *next = next_active_insn (barrier_or_label);
> > 
> > 
> 
> Sorry, I forgot that ".align 1" actually means alignment on 2-byte boundary.
> 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 >= (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 >= (off_t) n_read);


This puts the labels LVL110, LBE111, LBE110 at the wrong odd byte alignment. 
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 wrongly as
an insn or something like that ..... 

Adrian, if you have the means, can you bisect it to pinpoint the commit where
this error starts occuring?

  parent reply	other threads:[~2024-05-19 15:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-18 13:58 [Bug target/115148] New: " glaubitz at physik dot fu-berlin.de
2024-05-18 14:02 ` [Bug target/115148] " glaubitz at physik dot fu-berlin.de
2024-05-18 14:20 ` glaubitz at physik dot fu-berlin.de
2024-05-19  5:48 ` olegendo at gcc dot gnu.org
2024-05-19 11:24 ` glaubitz at physik dot fu-berlin.de
2024-05-19 13:46 ` olegendo at gcc dot gnu.org
2024-05-19 13:52 ` glaubitz at physik dot fu-berlin.de
2024-05-19 14:13 ` olegendo at gcc dot gnu.org
2024-05-19 15:20 ` olegendo at gcc dot gnu.org [this message]
2024-05-19 15:21 ` olegendo at gcc dot gnu.org
2024-05-20  7:52 ` glaubitz at physik dot fu-berlin.de
2024-05-20  7:57 ` olegendo at gcc dot gnu.org
2024-05-20 20:40 ` glaubitz at physik dot fu-berlin.de
2024-05-20 21:12 ` glaubitz at physik dot fu-berlin.de
2024-05-20 23:20 ` olegendo at gcc dot gnu.org
2024-05-21  6:35 ` [Bug target/115148] [12/13/14/15 Regression][SH]: " rguenth at gcc dot gnu.org
2024-05-21  7:39 ` glaubitz at physik dot fu-berlin.de
2024-05-21  8:28 ` olegendo at gcc dot gnu.org
2024-06-20  9:15 ` rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-115148-4-LxzC1J6nFy@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).