[llvm-bugs] [Bug 47487] New: support for GNU C label attributes

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 11 01:14:21 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=47487

            Bug ID: 47487
           Summary: support for GNU C label attributes
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ndesaulniers at google.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, isanbard at gmail.com,
                    jyknight at google.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

https://gcc.gnu.org/onlinedocs/gcc/Label-Attributes.html#Label-Attributes
https://godbolt.org/z/Er3rP8

#include <stdio.h>
int foo(void) {
       asm goto ("some asm" : : : : NoError);

/* This branch (the fall-through from the asm) is less commonly used */
ErrorHandling: 
   __attribute__((cold, unused)); /* Semi-colon is required here */
   printf("error\n");
   return 0;

NoError:
   printf("no error\n");
   return 1;
}

clang:
warning: 'cold' attribute only applies to functions [-Wignored-attributes]

   __attribute__((cold, unused)); /* Semi-colon is required here */

                  ^

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200911/16a792ba/attachment.html>


More information about the llvm-bugs mailing list