From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25939 invoked by alias); 8 Jan 2015 16:46:58 -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 25858 invoked by uid 48); 8 Jan 2015 16:46:49 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/64536] [4.9/5 Regression] Undefined .L* symbol starting with jump2 on s390x Date: Thu, 08 Jan 2015 16:46:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created 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: 2015-01/txt/msg00491.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64536 --- Comment #3 from Jakub Jelinek --- Created attachment 34404 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34404&action=edit gcc5-pr64536.patch Given that tidy_fallthru_edge seems to be called only rarely, I think adding too much code to handle tablejumps with single successor is not a good idea. So I think we should just give up on tablejumps there. And perhaps make sure we optimize single successor tablejumps somewhere else, where it is run often enough that it will be actually beneficial. E.g. int a; #define A(n) case n: a++; break; #define B(n) A(n##0) A(n##1) A(n##2) A(n##3) A(n##4) \ A(n##5) A(n##6) A(n##7) A(n##8) A(n##9) #define C(n) B(n##0) B(n##1) B(n##2) B(n##3) B(n##4) \ B(n##5) B(n##6) B(n##7) B(n##8) B(n##9) void foo (int x) { switch (x) { C(1) } } on x86_64 with -O2 or -O2 -fpic isn't optimized, because tidy_fallthru_edges isn't called and so we do not even attempt to do anything about it. On the s390x testcase it is called just because some other cleanup in another part of the function created unreachable blocks that need cleanup. And, wonder why tree-ssa-tail-merge.c doesn't want to optimize this. Perhaps it gives up because of the load and store?