public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "marcus at mc dot pp dot se" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug optimization/10392] [3.3/3.4 regression] [SH] optimizer generates faulty array indexing
Date: Fri, 12 Sep 2003 19:12:00 -0000	[thread overview]
Message-ID: <20030912190655.5556.qmail@sources.redhat.com> (raw)
In-Reply-To: <20030413145600.10392.marcus@mc.pp.se>

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10392



------- Additional Comments From marcus at mc dot pp dot se  2003-09-12 19:06 -------
Subject: Re:  [3.3/3.4 regression] [SH] optimizer generates faulty array indexing


Here is the reproduction recipe reworked as a runnable testsuite test.
If the program exits with code 0, the compiler is ok.  If it exits
with code 1 or segfaults, the compiler is not ok.

---8<--- test.c ---8<---
#include <stdio.h>
#include <string.h>

char res[128];

char *use(char *z)
{
  strncat(res, z, 10);
  return "X";
}

void func(char *a, char *b)
{
  char buf[128];
  unsigned char i; 
  char *item[] = {
    "one",
    "two",
  };
  strcpy(buf, "buf");
  for(i=0; i<2; i++) {
    char *x;
    use(item[i]);
    x = use(buf);
    use(a);
    use(b);
    use(x);
  }
}

int main()
{
  strcpy(res, "<");
  func("A", "B");
  strcat(res, ">");
  /* printf("res=\"%s\"\n", res); */
  return strcmp(res, "<onebufABXtwobufABX>")? 1 : 0;
}
---8<---


  parent reply	other threads:[~2003-09-12 19:06 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20030413145600.10392.marcus@mc.pp.se>
2003-06-01 17:57 ` marcus@mc.pp.se
2003-06-08 18:58 ` pinskia@physics.uc.edu
2003-06-28  1:00 ` giovannibajo at libero dot it
2003-07-11 22:55 ` mmitchel at gcc dot gnu dot org
2003-09-07 14:28 ` ebotcazou at gcc dot gnu dot org
2003-09-12  6:56 ` ebotcazou at gcc dot gnu dot org
2003-09-12  7:42 ` dank at kegel dot com
2003-09-12  8:18 ` ebotcazou at gcc dot gnu dot org
2003-09-12 19:12 ` marcus at mc dot pp dot se [this message]
2003-09-12 22:27 ` ebotcazou at gcc dot gnu dot org
2003-09-12 22:27 ` marcus at mc dot pp dot se
2003-09-13  0:13 ` dkegel at ixiacom dot com
2003-09-13  1:25 ` dkegel at ixiacom dot com
2003-09-13  9:58 ` ebotcazou at gcc dot gnu dot org
2003-09-13 13:53 ` marcus at mc dot pp dot se
2003-09-13 13:58 ` ebotcazou at gcc dot gnu dot org
2003-09-13 17:55 ` dank at kegel dot com
2003-09-13 22:24 ` marcus at mc dot pp dot se
2003-09-15 17:44 ` dank at kegel dot com
2003-09-15 19:34 ` marcus at mc dot pp dot se
2003-09-16  5:11 ` dank at kegel dot com
2003-09-16 13:22 ` marcus at mc dot pp dot se
2003-09-16 18:43 ` dank at kegel dot com
2003-09-17 10:05 ` ebotcazou at gcc dot gnu dot org
2003-09-17 17:49 ` dank at kegel dot com
2003-09-18  5:41 ` ebotcazou at gcc dot gnu dot org
2003-09-18  6:09 ` dank at kegel dot com
2003-10-16  2:58 ` mmitchel at gcc dot gnu dot org
2003-10-16  4:29 ` ebotcazou at gcc dot gnu dot org
2003-10-16  6:40 ` dank at kegel dot com
2003-10-16  6:52 ` ebotcazou at gcc dot gnu dot org
2003-10-25 15:12 ` ebotcazou at gcc dot gnu dot org
2003-12-21 18:53 ` gdr at gcc dot gnu dot org
2004-01-14  8:08 ` gdr at gcc dot gnu dot org
2004-01-14 19:03 ` joern dot rennecke at superh dot com
2004-01-14 19:37 ` joern dot rennecke at superh dot com
2004-01-14 19:49 ` [Bug optimization/10392] [3.3 " pinskia at gcc dot gnu dot org
2004-01-15 20:22 ` cvs-commit at gcc dot gnu dot org
2004-01-16 18:24 ` cvs-commit at gcc dot gnu dot org
2004-01-16 18:28 ` amylaar at gcc dot gnu dot org
2004-01-21 12:46 ` ebotcazou at gcc dot gnu dot org
2004-01-21 12:46 ` ebotcazou at gcc dot gnu dot org
2004-01-21 14:09 ` gdr at integrable-solutions dot net
2004-01-25  7:14 ` ebotcazou at gcc dot gnu dot 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=20030912190655.5556.qmail@sources.redhat.com \
    --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).