Bug 16288

Summary: Specifying an ISA in a .set directive causes a warning if "lower" than set from command-line
Product: binutils Reporter: Hans-Peter Nilsson <hp>
Component: gasAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: macro
Priority: P2    
Version: 2.25   
Target Milestone: ---   
Host: Target: mips*-*
Build: Last reconfirmed:

Description Hans-Peter Nilsson 2013-12-03 02:20:32 UTC
Seen with recent master of binutils, for example 310bf259c3524c2954; from code-inspection likely to be present for 2.24 as well.

The following construct is common with in-lined code (seen in alsa-lib and userspace-rcu), but gets a warning if the setting is "lower" than one specified on the command-line.

For a mips-elf target and a file s.s, with the contents:

 .set push
 .set mips2
 nop
 .set pop

Observe:
$ gas/as-new s.s
$ gas/as-new -march=34kc s.s
s.s: Assembler messages:
s.s:2: Warning: the `dsp' extension requires MIPS32 revision 2 or greater
s.s:2: Warning: the `mt' extension requires MIPS32 revision 2 or greater

Note that the warning comes from the ".set mips2" directive, regardless of whether it's followed by code; the test-case can actually be reduced to that single line.  The -march option comes from gcc when specifying the same option or from the configuration.

The warning is bogus; the .set implementation seems to miss clearing command-line-specified ASEs when specifying an ISA.  I believe that is how it's intuitively should work; this warning is a regression from, like, 8 months ago.
Comment 1 Maciej W. Rozycki 2017-02-22 21:40:20 UTC
This seems to have been fixed long ago with:

commit 919731affbef19fcad8dddb0a595bb05755cb345
Author: mfortune <matthew.fortune@imgtec.com>
Date:   Tue May 20 13:28:20 2014 +0100

    Add MIPS .module directive

so I am closing this bug.