This is the mail archive of the
mailing list for the GCC project.
Should invalid __RTL testcase "startwith" passes emit a warning?
- From: Matthew Malcomson <Matthew dot Malcomson at arm dot com>
- To: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Cc: nd <nd at arm dot com>
- Date: Tue, 19 Feb 2019 14:29:26 +0000
- Subject: Should invalid __RTL testcase "startwith" passes emit a warning?
I'd like to make handling of the __RTL function testcases where the
startwith pass name is either invalid, not used for that optimisation
level, or non-existant more understandable.
Currently a problem with the pass name leaves around state that causes
the compiler to ICE on other functions.
If the pass name is invalid or one not used for the current optimisation
level then "dfinit" is run, but "dfinish" is not, which breaks an
assertion in the `rest_of_handle_df_finish` function.
For any of the problems the "*clean_state" pass is not run, which causes
an ICE on the first C function in the TU.
The ICE's I've seen can be avoided by always running the "*clean_state"
pass (including if the startwith pass of the function is not specified)
and by always running the "dfinish" pass if the "dfinit" pass is run and
I am working on a patch to do this.
Since the function will not emit any code for any of these problems, I
was wondering whether to emit a -Wunused-function warning pointing to
the bad name (or to the area where a name should be), since it's
unlikely to be intended.
The current behaviour (apart from causing an ICE on other functions) is
to silently do nothing.
Example for "ICE after a bad name".
int __RTL (startwith ("badname")) foo2 ()
(edge-from entry (flags "FALLTHRU"))
(cnote 3 [bb 2] NOTE_INSN_BASIC_BLOCK)
(cinsn 101 (set (reg:DI x19) (reg:DI x0)))
(cinsn 10 (use (reg/i:SI x19)))
(edge-to exit (flags "FALLTHRU"))
) ;; block 2
) ;; insn-chain
) ;; function "foo2"