Re: Bug#804536: gcc-5: [mips,mipsel] regression in optimization causes FTBFS for gsoap

Aurelien Jarno <[email protected]>
Newsgroups gmane.linux.debian.ports.mips
Message-ID <[email protected]>
control: forwarded -1 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68273

On 2015-11-10 13:22, Aurelien Jarno wrote:
> On 2015-11-09 11:53, Mattias Ellert wrote:
> > Package: gcc-5
> > Version: 5.2.1-23
> > Severity: serious
> > Justification: causes gsoap to FTBFS
> > Control: affects -1 gsoap
> > Control: block 804455 by -1
> > X-Debbugs-Cc: [email protected]
> > 
> > Hi!
> > 
> > The binnmu of gsoap 2.8.22-1 due to the openssl transition failed on
> > mips and mipsel, but succeeded on the other architectures.
> > 
> > https://buildd.debian.org/status/package.php?p=gsoap
> > 
> > (It also succeeded on mip64le - but the mips64el build used gcc-5
> > 5.2.1-21 while mips and mipsel used 5.2.1-23. I am not sure if this is
> > relevant information.)
> > 
> > The failure is a segmentation fault when running the soapcpp2 binary
> > that has been compiled as part of the build. The soapcpp2 binary is not
> > linked to openssl, so the issue is not due to the new openssl library
> > that triggered the binnmu rebuild.
> > 
> > I can reproduce the failure on the eder.debian.org porterbox.
> > 
> > However, if I on the porterbox reduce the optimization from -O2 to -O1,
> > the build succeeds. This therefore looks like a regression in
> > mips/mipsel optimization.
> 
> The wrongly compiled code is in soapcpp2_yacc.y (generated from
> soapcpp2.y) on line 2272 and following:
> 
> |   case 34:
> | #line 436 "soapcpp2_yacc.y" /* yacc.c:1646  */
> |     { if ((yyvsp[-1].rec).sto & Stypedef)
> |                           {     sprintf(errbuf, "invalid typedef qualifier for '%s'", (yyvsp[0].sym)->name);
> |                                 semwarn(errbuf);
> |                           }
> |                           printf("%p\n", (yyvsp[0].sym));
> |                           p = enter(sp->table, (yyvsp[0].sym));
> |                           p->info.typ = (yyvsp[-1].rec).typ;
> |                           p->info.sto = (yyvsp[-1].rec).sto;
> |                           p->info.hasval = False;
> |                           p->info.offset = sp->offset;
> |                           if (sp->grow)
> |                                 sp->offset += p->info.typ->width;
> |                           else if (p->info.typ->width > sp->offset)
> |                                 sp->offset = p->info.typ->width;
> |                           sp->entry = p;
> |                         }
> | #line 2290 "soapcpp2_yacc.c" /* yacc.c:1646  */
> |     break;
> 
> The call to enter is translated into the following code:
> 
> | $L129:  
> |         .loc 1 436 0
> |         lw      $2,-60($20)
> |         sw      $2,188($sp)
> |         andi    $2,$2,0x10
> |         bne     $2,$0,$L384
> |         lui     $7,%hi($LC36)
> | 
> |         lw      $6,0($20)
> | $LVL335 = .
> | $L385:  
> |         .loc 1 440 0
> |         lw      $22,%got(sp)($28)
> |         lw      $25,%call16(enter)($28)
> |         lw      $2,0($22)
> |         .reloc  1f,R_MIPS_JALR,enter
> | 1:      jalr    $25
> |         lw      $4,0($2)
> 
> Register a2 ($6) is loaded with (yyvsp[0].sym) instead of a1 ($5).
> 
> I still have to check if it is reproducible with trunk and to find the
> optimization option causing the issue. Then we can report the bug
> upstream.

Bug submitted upstream as PR68273.

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
[email protected]                 http://www.aurel32.net
signature.asc (application/pgp-signature, 819 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJWQgQdAAoJELqceAYd3YybcA4QAJuMXTyhZEdKMNGAjHSuG99U
aLh6N1bvw7JD5fRZK3eC5d+y78FbrxCdeAOCXWXn5PFqk8gTDny3D3LtuPHWM3Ti
rK0sfwLICcvQ/FX5WQZA2qCda+niB6U654HPwxCMERvWRTNPjXwKyLWp5i8rP2j/
yKFDgkhD1wS0igPbz5Gu7quAosnzfbzQs6t9uk2wxOinN2N6m1seCKrqvMNMTtol
M+IvKx9iHoItuQfxfFlwlzWZO6JuDYo1XTSjS1oQogG+bj3vXHI6pJ/lTpkMWt3g
iQrJVKoz76XTZFT6otMDIDDkbw1T+rZbC4T5ixiBCSBec98YyA6yVWUpiIq8RaJd
qzvUZjKVUrhF3M49i2QAHk9UA/O2a2jPaTxhzXMlbMpLdp53frZu0YcpnXRAptWL
JCSRuorcDlPCnInCMaUuBetatwG8fH0M/DrCHIGOMg5R9mWn3kPImKLEB31CAfbi
OO1hE440d/HXjftGbcPWtslW9O9+tcLp4BeInW+D3Uu5WAvUZ3w1u7gK8NTS2IEb
/bH8X9i5cyDLXyjwgCoHPXHcJ1l6dmP9PDorp/XNuv8gwG/9KKTOWoYGSfYuSghJ
bSan2vQVBO1BKFayRNztvVspnbH1lKM5nRWkLUjL/RvnhT9ysQ6P7Vq4yG8HNRGv
nAtcqB6+DbuFF32o8hWs
=Jyfn
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.