gcc question

HON LUU hon@dreambigsemi.com
Wed Sep 8 17:05:06 GMT 2021


Hi Segher,

Let me work on stand alone setup to show the problem.

Thank you for your help.
Regards,
Hon

-----Original Message-----
From: Segher Boessenkool <segher@kernel.crashing.org> 
Sent: Wednesday, September 8, 2021 9:20 AM
To: HON LUU <hon@dreambigsemi.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: gcc question

Hi!

On Wed, Sep 08, 2021 at 03:06:54PM +0000, HON  LUU wrote:
>       + The modified gcc command did not compile. The error message would look like this.
> In file included from ././include/linux/compiler_types.h:58,
>                  from <command-line>:
> ./arch/x86/include/asm/jump_label.h: In function ‘unmap_user_buf.part.3’:
> ./include/linux/compiler-gcc.h:305:38: error: asm operand 0 probably 
> doesn’t match constraints [-Werror] #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
>                                       ^~~
> ./arch/x86/include/asm/jump_label.h:38:2: note: in expansion of macro ‘asm_volatile_goto’
>   asm_volatile_goto("1:"
>   ^~~~~~~~~~~~~~~~~
> ./include/linux/compiler-gcc.h:305:38: error: impossible constraint in 
> ‘asm’ #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
>                                       ^~~
> ./arch/x86/include/asm/jump_label.h:38:2: note: in expansion of macro ‘asm_volatile_goto’
>   asm_volatile_goto("1:"
>   ^~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors

(Use LANG=C or LC_ALL=C to not get those weird quotes, just like you would use this to get error messages that aren't translated, that the compiler developers can actually read :-) )

You need to show the full code of the asm_volatile_goto, and the declarations of everything used in its operands, for us to get a handle on what is going on here.  Bonus points if you manage to make a stand- alone compilable testcase that shows the problem.

GL;HF,


Segher


More information about the Gcc-help mailing list