This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: [Unreviewed PATCH] h8300 #pragma interrupt works only forfirst ISR with -O3
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: dhananjayd at kpit dot com
- Cc: gcc-patches at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, gnuh8 at gnuh8 dot org dot uk
- Date: Tue, 18 Jun 2002 15:45:52 -0400 (EDT)
- Subject: Re: [Unreviewed PATCH] h8300 #pragma interrupt works only forfirst ISR with -O3
- References: <69595093233BB547BB70CF5E492B63F23A869E@sohm.kpit.com>
Hi Dhananjay,
> If there are multiple functions in one file with #pragma interrupt,
> then with optimization level -O3, only first function is compiled as
> interrupt function and rest all are compiled as normal functions.
Thank you for fixing this. I have a question before I commit this.
> +static void
> +h8300_insert_attributes (node, attributes)
> + tree node;
> + tree * attributes;
> +{
> + if (! interrupt_handler
> + || TREE_CODE (node) != FUNCTION_DECL)
> + return;
> +
> + /* We are only interested in fields. */
> + if (TREE_CODE_CLASS (TREE_CODE (node)) != 'd')
> + return;
> +
> + /* Add a 'interrupt_handler' attribute. */
> + * attributes = tree_cons (get_identifier ("interrupt_handler"), NULL, * attributes);
> +
> + return;
> }
Is the second if statement ever triggered? FUNCTION_DECL but not 'd'?
Maybe I don't understand something.
Kazu Hirata