From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5188 invoked by alias); 27 Mar 2003 10:46:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 5143 invoked by uid 71); 27 Mar 2003 10:46:01 -0000 Resent-Date: 27 Mar 2003 10:46:01 -0000 Resent-Message-ID: <20030327104601.5142.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, gni@gecko.de Received: (qmail 1685 invoked from network); 27 Mar 2003 10:36:15 -0000 Received: from unknown (HELO kirk.baltic.net) (193.189.247.10) by sources.redhat.com with SMTP; 27 Mar 2003 10:36:15 -0000 Received: (qmail 13689 invoked from network); 27 Mar 2003 10:34:22 -0000 Received: from waldorf.gecko.de (HELO kermit.int.gecko.de) (193.189.247.200) by kirk.baltic.net with SMTP; 27 Mar 2003 10:34:22 -0000 Received: from lorien.int.gecko.de (lorien [192.168.120.159]) by kermit.int.gecko.de (8.10.1/8.10.1) with ESMTP id h2RAbHB10724 for ; Thu, 27 Mar 2003 11:37:17 +0100 (MET) Received: from lorien.int.gecko.de (localhost [127.0.0.1]) by lorien.int.gecko.de (8.12.8/8.12.7) with ESMTP id h2RAX46v062897 for ; Thu, 27 Mar 2003 11:33:04 +0100 (MET) (envelope-from munk@lorien.int.gecko.de) Received: (from munk@localhost) by lorien.int.gecko.de (8.12.8/8.12.8/Submit) id h2RAX4Ux062896; Thu, 27 Mar 2003 11:33:04 +0100 (MET) Message-Id: <200303271033.h2RAX4Ux062896@lorien.int.gecko.de> Date: Thu, 27 Mar 2003 10:56:00 -0000 From: gni@gecko.de To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: 3.113 Subject: optimization/10239: m68k assembler error X-SW-Source: 2003-03/txt/msg01882.txt.bz2 List-Id: >Number: 10239 >Category: optimization >Synopsis: switch jumptable causes assembler error on m68k >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Thu Mar 27 10:46:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Gunther Nikl >Release: 3.3 20030303 (prerelease) >Organization: >Environment: host: i386-unknown-freebsd4.8 build: i386-unknown-freebsd4.8 target: m68k-unknown-linux-gnu configured with: ../gcc-20030303/configure --target=m68k-linux >Description: The compiler emits unused and incomplete switch jump-tables when compiling with -O1 which cause assembler errors. >How-To-Repeat: The testcase was extracted from ra-colorize.c. $ cat x.c enum node_type { INITIAL = 0, FREE, PRECOLORED, SIMPLIFY, SIMPLIFY_SPILL, SIMPLIFY_FAT, FREEZE, SPILL, SELECT, SPILLED, COALESCED, COLORED, LAST_NODE_TYPE }; inline void put_web (enum node_type type) { switch (type) { case INITIAL: case FREE: case FREEZE: case SPILL: foo(); break; case PRECOLORED: bar(); break; default: baz (); } } void reset_lists () { put_web (INITIAL); } $ ./xgcc -B./ -O -S x.c -o - .file "x.c" .text .align 2 .globl reset_lists .type reset_lists, @function reset_lists: link.w %a6,#0 jbra .L6 .align 2 .L9: .word .L6-.L9 .word .L6-.L9 .word .L7-.L9 .word .L8-.L9 .word .L8-.L9 .word .L8-.L9 .word .L6-.L9 .word .L6-.L9 .align 2 .L6: jbsr foo unlk %a6 rts .size reset_lists, .-reset_lists .ident "GCC: (GNU) 3.3 20030303 (prerelease)" $ The jumptable references labels that aren't emitted (L7,L8,L9) thus gas barfs. Since the table is unused it shouldn't be emitted. >Fix: Compiling with -fgcse added (or with -O2 which enables it by default) $ ./xgcc -B./ -O -fgcse -S x.c -o - .file "x.c" .text .align 2 .globl reset_lists .type reset_lists, @function reset_lists: link.w %a6,#0 jbsr foo unlk %a6 rts .size reset_lists, .-reset_lists .ident "GCC: (GNU) 3.3 20030303 (prerelease)" $ >Release-Note: >Audit-Trail: >Unformatted: