在 2019/3/26 下午7:40, JunMa 写道:
Hi
According to gnu document of function attributes, neither weakref nor
alias
could be attached to a function defined in current translation unit.
Although GCC checks the attributes under some circumstances, it still
fails
on some cases and even causes ICE.
This patch checks whether alias/weakref attribute attaches on a function
declaration which has body, and removes the attribute later.
This also avoid the ICE.
Bootstrapped/regtested on x86_64-linux, ok for GCC10?
Regards
JunMa
gcc/ChangeLog
2019-03-26 Jun Ma <ju...@linux.alibaba.com>
PR89341
* cgraphunit.c (handle_alias_pairs): Check whether alias attribute
attaches
on a function declaration which has body.
gcc/testsuite/ChangeLog
2019-03-26 Jun Ma <ju...@linux.alibaba.com>
PR89341
* gcc.dg/attr-alias-6.c: New test.
* gcc.dg/attr-weakref-5.c: Likewise.
Ping.
Regards
JunMa