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

           Summary: [x32] FAIL: gcc.c-torture/execute/builtins/strcat.c
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: hjl.to...@gmail.com


[hjl@gnu-33 gcc]$ cat /tmp/x.c
extern void abort (void);
typedef __SIZE_TYPE__ size_t;
extern char *strcat (char *, const char *);
extern char *strcpy (char *, const char *);
extern void *memset (void *, int, size_t);
extern int memcmp (const void *, const void *, size_t);
#define RESET_DST_WITH(FILLER) \
  do { memset (dst, 'X', sizeof (dst)); strcpy (dst, (FILLER)); } while (0)

void main_test (void)
{
  const char *const s1 = "hello world";
  const char *const s2 = "";
  char dst[64], *d2;


  RESET_DST_WITH (s1);
  strcat (strcat (strcat (strcat (strcat (strcat (dst, ": this "), ""),
                  "is "), "a "), "test"), ".");
  if (memcmp (dst, "hello world: this is a test.\0X", 30))
    abort();
}
[hjl@gnu-33 gcc]$ ./xgcc -B./ -S -mx32 -O1 /tmp/x.c
/tmp/x.c: In function ‘main_test’:
/tmp/x.c:22:1: internal compiler error: in change_address_1, at emit-rtl.c:1933
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
[hjl@gnu-33 gcc]$

Reply via email to