From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by sourceware.org (Postfix) with ESMTPS id AEEDA3858D32 for ; Mon, 16 Jan 2023 11:37:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AEEDA3858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-x102f.google.com with SMTP id q23-20020a17090a065700b002290913a521so11380931pje.5 for ; Mon, 16 Jan 2023 03:37:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=R9lVNNPO1mHqysqY3qXwCvOdVdVf0SgV4A6stpNVaa8=; b=qogic86v+o5TQZ2QGUeh40AefyFD6wT9c94oCsYDefyPJ3D+8DcuOnUt9X+HdyV9yT FWT97DBVeEjMEiSPlcmPtKrBvSTKiNZBcToFctub3/PwIQ5PQJSH4OFpOmwmtEfIxPJY iCtQkIc4jDIqmDkaw3jhUiWel3gVlknoU6AwjrZnCeGUcW4pDl9FrZ/8xnepJTeCxE5p jYG7C2elPoqU4WCBcEx0UZeoMPUO/zN/EAyhZGVOFfhoHWik7U9lTqs/fWKIzLqMD2FR xQzBcSbpSgmQD8ejTjSGNyakeSTC+HvijXOM/gYJ2qwyou5X0sH18x1xfqeX+t8iTkCq xcCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=R9lVNNPO1mHqysqY3qXwCvOdVdVf0SgV4A6stpNVaa8=; b=voIi6ZgFQ4fIFWCUXhow/HLsgxy/VHrGglrtkQ1r32DgjVAqyNE4g0yuY/XtFSNtrF N0J1CRG3l9wkOcymv2mIR5dTDldBwgdqsJZojpRCcx/mJ8vu/DGSm1KDwZxaAzFOjgQY NWdomRCk8K5dr4DwgoZeZvHKrkaZ4IgaGfX20jvVPIhk/68VWffpKOKD1Ry566LbNiCG cbtbRTOspertR9/4SOLm1DySO0v8zbcIVy/Ns8sjUg9JtRG3TE6ttynFbCLNpXplyoC+ 7/ZYm4uvWiXBdUzbuIQDjtJKSn6TK9o2RdwXYLjYUNV1RiHEMVdTTHkTABpmy2ieDwSi UAmg== X-Gm-Message-State: AFqh2kow/NWlUfTlf6/77Jdx8Kt81xGY56UmqpcmUpXnVIvqSye/gqI9 yHzVD7MM0KZoQSlZrp09eeIwU42RiLA= X-Google-Smtp-Source: AMrXdXvXESBpiCSHqJkpugnLOQ0MP8QwzrN+g9+VCoN6lkkDtM66QeCmPZl7uFjCyXWiho1RhPNcnw== X-Received: by 2002:a17:902:ccc4:b0:186:e434:6265 with SMTP id z4-20020a170902ccc400b00186e4346265mr107080694ple.2.1673869032531; Mon, 16 Jan 2023 03:37:12 -0800 (PST) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id a16-20020a170902ecd000b001868ed86a95sm19131213plh.174.2023.01.16.03.37.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 03:37:12 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id B99DA1140A04; Mon, 16 Jan 2023 22:07:09 +1030 (ACDT) Date: Mon, 16 Jan 2023 22:07:09 +1030 From: Alan Modra To: binutils@sourceware.org Subject: PR29991, MicroMIPS flag erased after align directives Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3035.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: PR 29991 * config/tc-mips.c (s_align): Call file_mips_check_options and mips_mark_labels. * testsuite/gas/mips/align-after-label.s, * testsuite/gas/mips/mips-align-after-label.d, * testsuite/gas/mips/micromips-align-after-label.d: New test. * testsuite/gas/mips/mips.exp: Run it. diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 077993cf7cb..e59021ee191 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -16262,6 +16262,8 @@ s_align (int x ATTRIBUTE_UNUSED) int temp, fill_value, *fill_ptr; long max_alignment = 28; + file_mips_check_options (); + /* o Note that the assembler pulls down any immediately preceding label to the aligned address. o It's not documented but auto alignment is reinstated by @@ -16286,6 +16288,9 @@ s_align (int x ATTRIBUTE_UNUSED) } else fill_ptr = 0; + + mips_mark_labels (); + if (temp) { segment_info_type *si = seg_info (now_seg); diff --git a/gas/testsuite/gas/mips/align-after-label.s b/gas/testsuite/gas/mips/align-after-label.s new file mode 100644 index 00000000000..75e1c1bb6d0 --- /dev/null +++ b/gas/testsuite/gas/mips/align-after-label.s @@ -0,0 +1,3 @@ +seg1: + .align 2 + ADDIU $0, $0, 1 diff --git a/gas/testsuite/gas/mips/micromips-align-after-label.d b/gas/testsuite/gas/mips/micromips-align-after-label.d new file mode 100644 index 00000000000..9358b912626 --- /dev/null +++ b/gas/testsuite/gas/mips/micromips-align-after-label.d @@ -0,0 +1,13 @@ +#objdump: -dr --show-raw-insn +#name: microMIPSr3 (align after label) +#as: -mips32r3 -32 -mmicromips -EB +#source: align-after-label.s + +.*: +file format .*mips.* + +Disassembly of section \.text: + +[0-9a-f]+ : +[ 0-9a-f]+: 4c02 addiu zero,zero,1 +[ 0-9a-f]+: 0c00 nop +#pass diff --git a/gas/testsuite/gas/mips/mips-align-after-label.d b/gas/testsuite/gas/mips/mips-align-after-label.d new file mode 100644 index 00000000000..8f3d40df8a8 --- /dev/null +++ b/gas/testsuite/gas/mips/mips-align-after-label.d @@ -0,0 +1,12 @@ +#objdump: -dr --show-raw-insn +#name: MIPS32r3 (align after label) +#as: -mips32r3 -32 -mno-micromips -EB +#source: align-after-label.s + +.*: +file format .*mips.* + +Disassembly of section \.text: + +[0-9a-f]+ : +[ 0-9a-f]+: 24000001 li zero,1 +#pass diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp index fafed2dcc0c..e358c9716a6 100644 --- a/gas/testsuite/gas/mips/mips.exp +++ b/gas/testsuite/gas/mips/mips.exp @@ -1518,6 +1518,8 @@ if { [istarget mips*-*-vxworks*] } { run_dump_test "align2" run_dump_test "align2-el" run_dump_test "align3" + run_dump_test "mips-align-after-label" + run_dump_test "micromips-align-after-label" run_dump_test "odd-float" run_dump_test "insn-opts" -- Alan Modra Australia Development Lab, IBM