This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Unreviewed PATCH] h8300 #pragma interrupt works only forfirst ISR with -O3


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]