public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "glaubitz at physik dot fu-berlin.de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/93808] [9/10/11/12 Regression] [SH] Ruby crashes with 'Illegal Instruction' with -fcrossjumping
Date: Fri, 30 Apr 2021 10:23:33 +0000	[thread overview]
Message-ID: <bug-93808-4-KX72Modcmn@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-93808-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #29 from John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin.de> ---
(In reply to John Paul Adrian Glaubitz from comment #28)
> Adrian, could please apply the following patch to the original string.c file
> and try building & running the whole thing again with the original compiler
> flags, with -fno-cross-jumping and with -O1.  Does one of the added traps go
> off?
> 
> 
> --- "orig ng/string.c.orig"	2019-10-01 20:02:30.000000000 +0900
> +++ "orig ng/string.c"	2020-02-22 18:29:54.904783490 +0900
> @@ -446,13 +446,15 @@
>  # define NONASCII_MASK 0x80808080UL
>  #endif
>  
> +if ( (intptr_t)(e-p) < 0) __builtin_trap ();
> +
>      if (UNALIGNED_WORD_ACCESS || e - p >= SIZEOF_VOIDP) {
>  #if !UNALIGNED_WORD_ACCESS
>  	if ((uintptr_t)p % SIZEOF_VOIDP) {
>  	    int l = SIZEOF_VOIDP - (uintptr_t)p % SIZEOF_VOIDP;
>  	    p += l;
>  	    switch (l) {
> -	      default: UNREACHABLE;
> +	      default: __builtin_trap ();
>  #if SIZEOF_VOIDP > 4
>  	      case 7: if (p[-7]&0x80) return p-7;
>  	      case 6: if (p[-6]&0x80) return p-6;
> @@ -481,7 +483,7 @@
>      }
>  
>      switch (e - p) {
> -      default: UNREACHABLE;
> +      default: __builtin_trap ();
>  #if SIZEOF_VOIDP > 4
>        case 7: if (e[-7]&0x80) return e-7;
>        case 6: if (e[-6]&0x80) return e-6;

I did not see any of the traps fire. With the patch applied, it builds fine and
the Ruby interpreter doesn't crash. I'll attach the full build log.

Without the patch, Ruby crashes, even with the latest gcc-10 version (didn't
test gcc-11 yet as gcc-10 is currently the default for Debian unstable).

  parent reply	other threads:[~2021-04-30 10:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-93808-4@http.gcc.gnu.org/bugzilla/>
2020-03-12 11:58 ` [Bug target/93808] [9 " jakub at gcc dot gnu.org
2021-04-30  8:02 ` [Bug target/93808] [9/10/11/12 " rguenth at gcc dot gnu.org
2021-04-30  8:37 ` glaubitz at physik dot fu-berlin.de
2021-04-30 10:23 ` glaubitz at physik dot fu-berlin.de [this message]
2021-04-30 10:27 ` glaubitz at physik dot fu-berlin.de
2021-05-02  9:22 ` glaubitz at physik dot fu-berlin.de
2021-05-02  9:44 ` glaubitz at physik dot fu-berlin.de
2021-06-01  8:16 ` rguenth at gcc dot gnu.org
2022-03-22 10:37 ` rguenth at gcc dot gnu.org
2022-05-27  9:42 ` [Bug target/93808] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:39 ` jakub at gcc dot gnu.org
2023-07-07 10:36 ` [Bug target/93808] [11/12/13/14 " rguenth at gcc dot gnu.org
2023-10-30  7:37 ` olegendo at gcc dot gnu.org
2023-10-30  7:49 ` glaubitz at physik dot fu-berlin.de

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-93808-4-KX72Modcmn@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).