From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D15593858C62; Wed, 8 Feb 2023 15:09:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D15593858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675868952; bh=gpV1DZcZZuJUvjZ0vEUvy7Wm6cS6++VRC5ASrski8MM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CesuEbX6gQlbWkcsYlFlO8TCTj/5g1Fa2QV2RBFcPnY/WORC32RMvqGY8xztqY8z8 2LF0rv5i1YcUzOqjsN0m87GjSefpGpd08Nid0XrKd662QPLoQsxIOwtkEndzv2B4HC cvk5rmSfHqwBqFWhNuSv1fgKBAVItYnvGx3aZNZw= From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/108695] [13 Regression] Wrong code since r13-5215-gb1f30bf42d8d47 for dd_rescue package Date: Wed, 08 Feb 2023 15:09:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: lto, needs-reduction, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin at gcc dot gnu.org X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108695 --- Comment #9 from Martin Li=C5=A1ka --- Actually, looking at the tree dumps before and after the revision, it's lea= ding to a different place: First difference happens in: test_aes.ltrans0.ltrans.116t.dse2 [local count: 8687547526]: - _118 =3D MEM[(ulong *)iv_4(D)]; - _120 =3D MEM[(ulong *)input_19]; - _121 =3D _118 ^ _120; - MEM[(ulong *)iv_4(D)] =3D _121; - _129 =3D MEM[(ulong *)iv_4(D) + 8B]; - _131 =3D MEM[(ulong *)input_19 + 8B]; - _132 =3D _129 ^ _131; - MEM[(ulong *)iv_4(D) + 8B] =3D _132; (there's one more optimized out block like this. Which maps to: int AES_Gen_CBC_Enc(AES_Crypt_Blk_fn *cryptfn, const uchar* rkeys, uint rounds, uchar *iv, uint pad, const uchar *input, uchar *output, ssize_t len, ssize_t *olen) { *olen =3D len; while (len >=3D 16) { XOR16(iv, input, iv); cryptfn(rkeys, rounds, iv, iv); memcpy(output, iv, 16); len -=3D 16; input +=3D 16; output +=3D 16; } if (len || pad =3D=3D PAD_ALWAYS) { uchar *in =3D crypto->blkbuf2; fill_blk(input, in, len, pad); XOR16(iv, in, iv); cryptfn(rkeys, rounds, iv, output); /* Store last IV */ memcpy(iv, output, 16); *olen +=3D 16-(len&15); //memset(in, 0, 16); //LFENCE; } return (pad =3D=3D PAD_ALWAYS || (len&15))? 16-(len&15): 0; } where the XOR16 is implemented as: #define XORN(in1,in2,out,len) \ do { \ uint _i; \ for (_i =3D 0; _i < len/sizeof(ulong); ++_i) \ *((ulong*)(out)+_i) =3D *((ulong*)(in1)+_i) ^ *((ulong*)(in2)+_i); \ } while(0)=