c: support attribs starting with '_'

Message ID 6876baac-15f9-0450-72ec-1f0b85348392@suse.cz
State New, archived
Headers
Series c: support attribs starting with '_' |

Commit Message

Martin Liška Oct. 5, 2022, 11:42 a.m. UTC
  Support attributes starting with dash (like _noreturn, or __Noreturn).
Note the only consumer of lookup_attribute_by_prefix comes from IPA ICF.

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Ready to be installed?
Thanks,
Martin

	PR c/107156

gcc/ChangeLog:

	* attribs.h (lookup_attribute_by_prefix): Support attributes
	starting with dash (like _noreturn, or __Noreturn).
---
 gcc/attribs.h | 2 --
 1 file changed, 2 deletions(-)
  

Comments

Andreas Schwab Oct. 5, 2022, 11:48 a.m. UTC | #1
On Okt 05 2022, Martin Liška wrote:

> 	* attribs.h (lookup_attribute_by_prefix): Support attributes
> 	starting with dash (like _noreturn, or __Noreturn).

s/dash/underscore/
  

Patch

diff --git a/gcc/attribs.h b/gcc/attribs.h
index b2836560fc2..706d35e63d8 100644
--- a/gcc/attribs.h
+++ b/gcc/attribs.h
@@ -274,8 +274,6 @@  lookup_attribute_by_prefix (const char *attr_name, tree list)
 	    }
 
 	  const char *p = IDENTIFIER_POINTER (name);
-	  gcc_checking_assert (attr_len == 0 || p[0] != '_');
-
 	  if (strncmp (attr_name, p, attr_len) == 0)
 	    break;