public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* optimization/6534: Miscompiled expr from sh-utils on ia64
@ 2002-05-01 11:26 Andreas Schwab
0 siblings, 0 replies; 3+ messages in thread
From: Andreas Schwab @ 2002-05-01 11:26 UTC (permalink / raw)
To: gcc-gnats
>Number: 6534
>Category: optimization
>Synopsis: Miscompiled expr from sh-utils on ia64
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Wed May 01 11:26:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:
>Release: 3.1 20020429 (prerelease)
>Organization:
>Environment:
System: Linux sykes 2.4.18-SMP #1 SMP Sat Apr 13 18:56:25 UTC 2002 ia64 unknown
Architecture: ia64
host: ia64-suse-linux-gnu
build: ia64-suse-linux-gnu
target: ia64-suse-linux-gnu
configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --enable-languages=c,c++,f77,objc,java,ada --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib --with-system-zlib --enable-shared --enable-checking ia64-suse-linux
>Description:
Miscompiled code at -O2. Example comes from sh-utils-2.0.12:expr.c.
inttostr:
.prologue
.body
.mlx
adds r8 = 127, r33
movl r14 = -3689348814741910323
.mmi
cmp.le p6, p7 = r0, r32
;;
setf.sig f6 = r14
(p7) sub r32 = r0, r32
;;
.mii
st1 [r8] = r0
cmp.le p8, p9 = r0, r32 <--- r32 alread negated
nop.i 0
.L3:
.pred.rel.mutex p8, p9
>How-To-Repeat:
$ cat inttostr.c
void abort (void);
static char *
inttostr (long i, char buf[128])
{
unsigned long ui = i;
char *p = buf + 127;
*p = '\0';
if (i < 0)
ui = -ui;
do
*--p = '0' + ui % 10;
while ((ui /= 10) != 0);
if (i < 0)
*--p = '-';
return p;
}
int
main ()
{
char buf[128], *p;
p = inttostr (-1, buf);
if (*p != '-')
abort ();
return 0;
}
$ gcc -v -O2 inttostr.c -o inttostr
Reading specs from /usr/lib/gcc-lib/ia64-suse-linux/3.1/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --enable-languages=c,c++,f77,objc,java,ada --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib --with-system-zlib --enable-shared --enable-checking ia64-suse-linux
Thread model: posix
gcc version 3.1 20020429 (prerelease)
/usr/lib/gcc-lib/ia64-suse-linux/3.1/cc1 -lang-c -v -D__GNUC__=3 -D__GNUC_MINOR__=1 -D__GNUC_PATCHLEVEL__=0 -D__gnu_linux__ -D__linux -D__linux__ -D_LONGLONG -Dlinux -Dunix -D__gnu_linux__ -D__linux -D__linux__ -D_LONGLONG -D__linux__ -D__unix__ -D__linux -D__unix -Asystem=linux -D__OPTIMIZE__ -D__STDC_HOSTED__=1 -Acpu=ia64 -Amachine=ia64 -D__ia64 -D__ia64__ -D_LP64 -D__LP64__ -D__ELF__ -D__LONG_MAX__=9223372036854775807L inttostr.c -quiet -dumpbase inttostr.c -O2 -version -o /tmp/ccEHmqPC.s
GNU CPP version 3.1 20020429 (prerelease) (cpplib) (IA-64) Linux
GNU C version 3.1 20020429 (prerelease) (ia64-suse-linux)
compiled by GNU C version 3.1 20020429 (prerelease).
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/lib/gcc-lib/ia64-suse-linux/3.1/include
/usr/ia64-suse-linux/include
/usr/include
End of search list.
/usr/lib/gcc-lib/ia64-suse-linux/3.1/../../../../ia64-suse-linux/bin/as -x -o /tmp/cceo8stm.o /tmp/ccEHmqPC.s
/usr/lib/gcc-lib/ia64-suse-linux/3.1/collect2 -dynamic-linker /lib/ld-linux-ia64.so.2 -o inttostr /usr/lib/gcc-lib/ia64-suse-linux/3.1/../../../crt1.o /usr/lib/gcc-lib/ia64-suse-linux/3.1/../../../crti.o /usr/lib/gcc-lib/ia64-suse-linux/3.1/crtbegin.o -L/usr/lib/gcc-lib/ia64-suse-linux/3.1 -L/usr/lib/gcc-lib/ia64-suse-linux/3.1/../../../../ia64-suse-linux/lib -L/usr/lib/gcc-lib/ia64-suse-linux/3.1/../../.. /tmp/cceo8stm.o -lgcc -lgcc_eh -lc -lgcc -lgcc_eh /usr/lib/gcc-lib/ia64-suse-linux/3.1/crtend.o /usr/lib/gcc-lib/ia64-suse-linux/3.1/../../../crtn.o
$ ./inttostr
Aborted
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: optimization/6534: Miscompiled expr from sh-utils on ia64
@ 2002-05-03 13:30 rth
0 siblings, 0 replies; 3+ messages in thread
From: rth @ 2002-05-03 13:30 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, rth, schwab
Synopsis: Miscompiled expr from sh-utils on ia64
State-Changed-From-To: analyzed->closed
State-Changed-By: rth
State-Changed-When: Fri May 3 13:30:51 2002
State-Changed-Why:
http://gcc.gnu.org/ml/gcc-patches/2002-05/msg00081.html
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6534
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: optimization/6534: Miscompiled expr from sh-utils on ia64
@ 2002-05-01 14:48 rth
0 siblings, 0 replies; 3+ messages in thread
From: rth @ 2002-05-01 14:48 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, rth, schwab
Synopsis: Miscompiled expr from sh-utils on ia64
Responsible-Changed-From-To: unassigned->rth
Responsible-Changed-By: rth
Responsible-Changed-When: Wed May 1 14:48:47 2002
Responsible-Changed-Why:
.
State-Changed-From-To: open->analyzed
State-Changed-By: rth
State-Changed-When: Wed May 1 14:48:47 2002
State-Changed-Why:
This is the same ifcvt problem Jan reported for x86-64,
only this time with a testcase that is demonstrably a
regression.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6534
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-05-03 20:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-01 11:26 optimization/6534: Miscompiled expr from sh-utils on ia64 Andreas Schwab
2002-05-01 14:48 rth
2002-05-03 13:30 rth
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).