From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16193 invoked by alias); 30 Dec 2014 13:09:11 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 16145 invoked by uid 48); 30 Dec 2014 13:09:07 -0000 From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/64412] [regression] ICE in offload compiler: in extract_insn, at recog.c:2327 Date: Tue, 30 Dec 2014 13:09:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ubizjak at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: component 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 X-SW-Source: 2014-12/txt/msg02935.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D64412 Uro=C5=A1 Bizjak changed: What |Removed |Added ---------------------------------------------------------------------------- Component|target |middle-end --- Comment #13 from Uro=C5=A1 Bizjak --- (In reply to H.J. Lu from comment #12) > Created attachment 34361 [details] > A new patch >=20 > Please try the new patch. No, this approach is wrong. ix86_fixup_binary_operands should not be used to legitimize PIC address. The -fpic expansion is already wrong, since it produces: ;; ivtmp.9_4 =3D (unsigned long) _37; (insn 59 58 0 (parallel [ (set (reg:DI 123 [ ivtmp.9 ]) (plus:DI (reg:DI 124 [ D.3980 ]) (symbol_ref:DI ("G") ))) (clobber (reg:CC 17 flags)) ]) -1 (nil)) This is similar to: --cut here-- typedef __SIZE_TYPE__ size_t; extern char G[8]; char *a (size_t z) { return &G[z]; } --cut here-- Without -fpic, the compiler expands to: 6: {r90:DI=3Dr89:DI+`G';clobber flags:CC;} Compare this with -fpic expansion: 6: r92:DI=3D[const(unspec[`G'] 2)] 7: r91:DI=3Dr92:DI REG_EQUAL `G' 8: {r90:DI=3Dr89:DI+r91:DI;clobber flags:CC;} Looking at the above, it looks the problem is in the middle-end, where symb= ol address should be legitimized through ix86_legitimize_address (a.k.a TARGET_LEGITIMIZE_ADDRESS). >>From gcc-bugs-return-471929-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Dec 30 13:13:33 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 17795 invoked by alias); 30 Dec 2014 13:13:32 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 17762 invoked by uid 48); 30 Dec 2014 13:13:28 -0000 From: "colin.pitrat+gcc at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/64442] -O1 modify output of a simple computation with rounding Date: Tue, 30 Dec 2014 13:13:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 4.9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: colin.pitrat+gcc at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-12/txt/msg02936.txt.bz2 Content-length: 377 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64442 --- Comment #2 from Colin Pitrat --- Yes I'm building on i686. But I thought -O1 and -O2 were safe optimization that weren't supposed to change the behaviour. Moreover, I'm surprised that providing the list of -f flags -O1 is supposed to enable doesn't allow me to reproduce the issue.