[PATCH] Error about alias attribute with body definition (PR c/87483).

Martin Liška mliska@suse.cz
Thu Oct 4 09:29:00 GMT 2018


Hi.

That's new warnings that warns about ifunc having a function body.
It provides following warning:

/home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/pr87483.c: In function ‘g’:
/home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/pr87483.c:5:35: warning: ‘alias’ attribute ignored because function is defined [-Wattributes]
5 | __attribute__ ((alias ("f"))) int g () { return 1; } /* { dg-warning "attribute ignored because function is defined" } */
  |                                   ^

Hope I found proper place in cgraphunit.c for the warning.
Patch survives bootstrap and tests on x86_64-linux-gnu.

Ready for trunk?
Martin

gcc/ChangeLog:

2018-10-03  Martin Liska  <mliska@suse.cz>

	PR c/87483
	* cgraphunit.c (cgraph_node::finalize_function):
	Print error for functions with alias attribute and
	body.

gcc/testsuite/ChangeLog:

2018-10-03  Martin Liska  <mliska@suse.cz>

	PR c/87483
	* gcc.dg/pr87483.c: New test.
---
 gcc/cgraphunit.c               |  6 ++++++
 gcc/testsuite/gcc.dg/pr87483.c | 16 ++++++++++++++++
 2 files changed, 22 insertions(+)
 create mode 100644 gcc/testsuite/gcc.dg/pr87483.c


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Error-about-alias-attribute-with-body-definition-PR-.patch
Type: text/x-patch
Size: 1088 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20181004/f6dfdd08/attachment.bin>


More information about the Gcc-patches mailing list