public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: trauscher@loytec.com
To: gcc-gnats@gcc.gnu.org
Subject: target/3218: ARM/Thumb: Illegal byte-oriented stack instructions
Date: Mon, 18 Jun 2001 01:16:00 -0000	[thread overview]
Message-ID: <200106180810.f5I8Ahe13239@lexx.office.loytec.com> (raw)

>Number:         3218
>Category:       target
>Synopsis:       ARM/Thumb: Illegal byte-oriented stack instructions
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 18 01:16:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Thomas Rauscher
>Release:        3.0 20010528 (prerelease)
>Organization:
LoyTec electronics
>Environment:
System: Linux lexx 2.2.17 #1 Thu Oct 12 11:50:54 CEST 2000 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: arm-rtems-elf
configured with: ./configure --prefix=/prj/rtems/test --target=arm-rtems-elf --enable-languages=c --with-newlib
>Description:
	Under some cirumstances (after some byte-oriented stack access), the compiler
        generates sp-relative strb instructions, which are not supported by 
        the Thumb instruction set. When the code is less complex than the example
        below, the sp register gets copied into an accessible low register before
        accessing the stack, so the problem only occurs in more complex functions.
        Switches: -mthumb -mbig-endian -mthumb-interwork -O3
>How-To-Repeat:
Preprocessor output:
# 16 "strb.c"
typedef struct
{
  char x1, x2, x3, x4, x5, *x6;
} s1;

typedef struct
{
  char x, y[8];
} s2;

extern int *a1;
extern s2 *a2;
void f1(void *p1, void *p2);

void f2(int n, char *p, int *out)
{
  s1 in;

  in.x1 = p[0];
  in.x2 = p[1];
  in.x3 = p[2];
  in.x4 = p[3];
  in.x5 = p[4];
  in.x6 = p;

  if(!in.x1)
  {
    f1(&a2[n].x, in.x1);
    f1(&a2[n].x, &a1[n]);
    if (n) *out = 0;
    if (in.x1) *out = 0;
  }
}
>Fix:
	Probably the thumb_movqi_insn should not contain the 
        ldrb/strb/ldrh/strh instructions in conjunction with
        the high registers for thumb mode.
>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2001-06-18  1:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-18  1:16 trauscher [this message]
2002-01-22  3:12 pb
2002-01-22  3:26 Momchil Velikov
2002-09-30  5:08 rearnsha

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=200106180810.f5I8Ahe13239@lexx.office.loytec.com \
    --to=trauscher@loytec.com \
    --cc=gcc-gnats@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).