Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1674349
| From | Al Viro <viro@ZenIV.linux.org.uk> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: gcc 4.6.3 miscompile on ppc32 (was Re: Regression in kernel 4.12-rc1 for Powerpc 32 - bisected to commit 3448890c32c3) |
| Date | 2017-06-26 00:30 +0200 |
| Message-ID | <tWocx-2o4-9@gated-at.bofh.it> (permalink) |
| References | (5 earlier) <tVX2F-2dc-1@gated-at.bofh.it> <tWcuJ-3q1-7@gated-at.bofh.it> <tWdKa-4oh-9@gated-at.bofh.it> <tWmNs-1oF-21@gated-at.bofh.it> <tWnzP-1VX-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Sun, Jun 25, 2017 at 04:44:09PM -0500, Segher Boessenkool wrote:
> Do you have a short stand-alone testcase? 4.6 is ancient, of course, but
> the actual problem may still exist in more recent compilers (if it _is_
> a compiler problem; if it's not, you *really* want to know :-) )
Enjoy. At least 6.3 doesn't step into that. Look for mtctr in the resulting
asm...
cat <<'EOF' >a.c
struct iovec
{
void *iov_base;
unsigned iov_len;
};
unsigned long v;
extern void * barf(void *,int,unsigned);
extern unsigned long bar(void *to, const void *from, unsigned long size);
static inline unsigned long __bar(void *to, const void *from, unsigned long n)
{
unsigned long res = n;
if (__builtin_expect(!!(((void)0, (((( unsigned long)(from)) <= v) && ((((n)) == 0) || ((((n)) - 1) <= (v - (( unsigned long)(from)))))))), 1))
res = bar(to, from, n);
if (res)
barf(to + (n - res), 0, res);
return res;
}
int foo(int type, const struct iovec * uvector,
unsigned long nr_segs, unsigned long fast_segs,
struct iovec *iov,
struct iovec **ret_pointer)
{
unsigned long seg;
int ret;
if (nr_segs == 0) {
ret = 0;
goto out;
}
if (nr_segs > 1024) {
ret = -22;
goto out;
}
if (__bar(iov, uvector, nr_segs*sizeof(*uvector))) {
ret = -14;
goto out;
}
ret = 0;
for (seg = 0; seg < nr_segs; seg++) {
void *buf = iov[seg].iov_base;
int len = (int)iov[seg].iov_len;
if (len < 0) {
ret = -22;
goto out;
}
if (type >= 0
&& __builtin_expect(!!(!((void)0, (((( unsigned long)(buf)) <= v) && ((((len)) == 0) || ((((len)) - 1) <= (v - (( unsigned long)(buf)))))))), 0)) {
ret = -14;
goto out;
}
ret += len;
}
out:
*ret_pointer = iov;
return ret;
}
EOF
powerpc-linux-gcc -m32 -fno-strict-aliasing -fno-common -std=gnu89 -fno-PIE -msoft-float -pipe -ffixed-r2 -mmultiple -mno-altivec -mno-vsx -mno-spe -mspe=no -funit-at-a-time -fno-dwarf2-cfi-asm -mno-string -mcpu=powerpc -Wa,-maltivec -mbig-endian -fno-delete-null-pointer-checks -Os -fno-stack-protector -Wno-unused-but-set-variable -fomit-frame-pointer -fno-var-tracking-assignments -femit-struct-debug-baseonly -fno-var-tracking -fno-strict-overflow -fconserve-stack -fverbose-asm -S a.c
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: Regression in kernel 4.12-rc1 for Powerpc 32 - bisected to commit 3448890c32c3 Larry Finger <Larry.Finger@lwfinger.net> - 2017-06-21 17:20 +0200
Re: Regression in kernel 4.12-rc1 for Powerpc 32 - bisected to commit 3448890c32c3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-06-21 23:30 +0200
Re: Regression in kernel 4.12-rc1 for Powerpc 32 - bisected to commit 3448890c32c3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-06-21 23:40 +0200
Re: Regression in kernel 4.12-rc1 for Powerpc 32 - bisected to commit 3448890c32c3 Larry Finger <Larry.Finger@lwfinger.net> - 2017-06-21 23:50 +0200
Re: Regression in kernel 4.12-rc1 for Powerpc 32 - bisected to commit 3448890c32c3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-06-22 16:20 +0200
Re: Regression in kernel 4.12-rc1 for Powerpc 32 - bisected to commit 3448890c32c3 Larry Finger <Larry.Finger@lwfinger.net> - 2017-06-22 16:30 +0200
Re: Regression in kernel 4.12-rc1 for Powerpc 32 - bisected to commit 3448890c32c3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-06-22 21:30 +0200
Re: Regression in kernel 4.12-rc1 for Powerpc 32 - bisected to commit 3448890c32c3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-06-22 23:50 +0200
Re: Regression in kernel 4.12-rc1 for Powerpc 32 - bisected to commit 3448890c32c3 Larry Finger <Larry.Finger@lwfinger.net> - 2017-06-23 20:50 +0200
Re: Regression in kernel 4.12-rc1 for Powerpc 32 - bisected to commit 3448890c32c3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-06-23 22:40 +0200
Re: Regression in kernel 4.12-rc1 for Powerpc 32 - bisected to commit 3448890c32c3 Larry Finger <Larry.Finger@lwfinger.net> - 2017-06-24 19:30 +0200
Re: Regression in kernel 4.12-rc1 for Powerpc 32 - bisected to commit 3448890c32c3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-06-25 12:00 +0200
Re: Regression in kernel 4.12-rc1 for Powerpc 32 - bisected to commit 3448890c32c3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-06-25 13:20 +0200
gcc 4.6.3 miscompile on ppc32 (was Re: Regression in kernel 4.12-rc1 for Powerpc 32 - bisected to commit 3448890c32c3) Al Viro <viro@ZenIV.linux.org.uk> - 2017-06-25 23:00 +0200
Re: gcc 4.6.3 miscompile on ppc32 (was Re: Regression in kernel 4.12-rc1 for Powerpc 32 - bisected to commit 3448890c32c3) Segher Boessenkool <segher@kernel.crashing.org> - 2017-06-25 23:50 +0200
Re: gcc 4.6.3 miscompile on ppc32 (was Re: Regression in kernel 4.12-rc1 for Powerpc 32 - bisected to commit 3448890c32c3) Al Viro <viro@ZenIV.linux.org.uk> - 2017-06-26 00:30 +0200
Re: gcc 4.6.3 miscompile on ppc32 (was Re: Regression in kernel 4.12-rc1 for Powerpc 32 - bisected to commit 3448890c32c3) Michael Ellerman <mpe@ellerman.id.au> - 2017-06-26 15:40 +0200
Re: Regression in kernel 4.12-rc1 for Powerpc 32 - bisected to commit 3448890c32c3 Michael Ellerman <mpe@ellerman.id.au> - 2017-06-26 15:50 +0200
csiph-web