https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70646

--- Comment #23 from Martin Jambor <jamborm at gcc dot gnu.org> ---
(In reply to Josh Poimboeuf from comment #20)
> Thanks very much to everyone who has looked into this so far.  It would be
> very helpful to get answers to the following questions, so we can understand
> the impact to the kernel:
> 
> 1) Is there a reliable way to avoid the bug, either in code or with a gcc
> flag?

If you mean in general, then unfortunately no, except for disabling
inlining altogether and removing all always_inline's.  In addition to
the main bug, I found out that I check --param ipa-max-agg-items only
after incrementing it, so even setting that to zero does not help.
I'll prepare a patch for that too.

If you want to avoid it at a particular place where you know it
already occurs, then it depends on how the code looks like.  Would for
the following work for you?

  void __attribute__((noinline,noclone)) broken(u64* shost)
  {
   u8 node_name[8];
   memset (&node_name, 0xFF, sizeof (node_name));
   *shost = wwn_to_u64(node_name);
  }

> 
> 2) Is there a reliable way to detect the bug by looking at the object code?

I cannot think of any.

Reply via email to