This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Tcsh - Gentoo
- From: Markus Trippelsdorf <markus at trippelsdorf dot de>
- To: David Kredba <nheghathivhistha at gmail dot com>
- Cc: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Mon, 30 Mar 2015 23:17:41 +0200
- Subject: Re: Tcsh - Gentoo
- Authentication-results: sourceware.org; auth=none
- References: <CALFdCy99Z-GyX7E1a46ieHui4W-+UkcuyuxzrqC9d=+uxX_yZg at mail dot gmail dot com>
On 2015.03.30 at 21:45 +0200, David Kredba wrote:
> Could you plese help me?
> What information I have to provide as good enough for gcc-5 possible
> bug report if Gentoo tcsh-6.18.01-r2 is maybe miscompiled with "-g O2
> -march=core2 -mtune=core2"?
markus@x4 tmp % cat tc.alloc.i
typedef long unsigned int size_t;
extern void *memset(void *__s, int __c, size_t __n);
extern void *malloc(size_t __size);
void *calloc(size_t i, size_t j) {
char *cp;
i *= j;
cp = malloc(i);
memset(cp, 0, i);
return ((void *)cp);
}
markus@x4 tmp % gcc -O2 -S tc.alloc.i
markus@x4 tmp % cat tc.alloc.s
.file "tc.alloc.i"
.section .text.unlikely,"ax",@progbits
.LCOLDB0:
.text
.LHOTB0:
.p2align 4,,15
.globl calloc
.type calloc, @function
calloc:
.LFB0:
.cfi_startproc
imulq %rsi, %rdi
movl $1, %esi
jmp calloc
.cfi_endproc
.LFE0:
.size calloc, .-calloc
.section .text.unlikely
.LCOLDE0:
.text
.LHOTE0:
.ident "GCC: (GNU) 5.0.0 20150330 (experimental)"
.section .note.GNU-stack,"",@progbits
So it gets compiled into an endless loop.
-fno-builtin fixes the issue.
--
Markus