From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26054 invoked by alias); 14 Jul 2012 19:25:45 -0000 Received: (qmail 26044 invoked by uid 22791); 14 Jul 2012 19:25:44 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-lb0-f175.google.com (HELO mail-lb0-f175.google.com) (209.85.217.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 14 Jul 2012 19:25:31 +0000 Received: by lbol5 with SMTP id l5so6506001lbo.20 for ; Sat, 14 Jul 2012 12:25:29 -0700 (PDT) Received: by 10.152.102.137 with SMTP id fo9mr5825269lab.35.1342293929576; Sat, 14 Jul 2012 12:25:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.4.229 with HTTP; Sat, 14 Jul 2012 12:25:09 -0700 (PDT) From: Steven Bosscher Date: Sat, 14 Jul 2012 19:25:00 -0000 Message-ID: Subject: [patch] Bail out if the same label is emitted twice To: GCC Patches Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-07/txt/msg00562.txt.bz2 Hello, Just another small cleanup. This probably made sense before function-at-a-time became the norm, 10 years ago. Bootstrapped&tested on powerpc64-unknown-linux-gnu and x86_64-unknown-linux-gnu. OK for trunk? Ciao! Steven * emit-rtl.c (emit_label_before): Do not allow the same label to be emitted twice. (emit_label_after): Likewise. (emit_label): Likewise. Index: emit-rtl.c =================================================================== --- emit-rtl.c (revision 189482) +++ emit-rtl.c (working copy) @@ -4221,14 +4221,9 @@ emit_barrier_before (rtx before) rtx emit_label_before (rtx label, rtx before) { - /* This can be called twice for the same label as a result of the - confusion that follows a syntax error! So make it harmless. */ - if (INSN_UID (label) == 0) - { - INSN_UID (label) = cur_insn_uid++; - add_insn_before (label, before, NULL); - } - + gcc_checking_assert (INSN_UID (label) == 0); + INSN_UID (label) = cur_insn_uid++; + add_insn_before (label, before, NULL); return label; } @@ -4387,15 +4382,9 @@ emit_barrier_after (rtx after) rtx emit_label_after (rtx label, rtx after) { - /* This can be called twice for the same label - as a result of the confusion that follows a syntax error! - So make it harmless. */ - if (INSN_UID (label) == 0) - { - INSN_UID (label) = cur_insn_uid++; - add_insn_after (label, after, NULL); - } - + gcc_checking_assert (INSN_UID (label) == 0); + INSN_UID (label) = cur_insn_uid++; + add_insn_after (label, after, NULL); return label; } @@ -4811,14 +4800,9 @@ emit_call_insn (rtx x) rtx emit_label (rtx label) { - /* This can be called twice for the same label - as a result of the confusion that follows a syntax error! - So make it harmless. */ - if (INSN_UID (label) == 0) - { - INSN_UID (label) = cur_insn_uid++; - add_insn (label); - } + gcc_checking_assert (INSN_UID (label) == 0); + INSN_UID (label) = cur_insn_uid++; + add_insn (label); return label; }