This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug inline-asm/17346] [3.5 Regression] linux kernel: handwritten offsetof break inline asm


------- Additional Comments From matz at suse dot de  2004-09-09 12:48 -------
The kernel does use offsetof().  But of course it has its own headers, 
defining this macro to the usual construct, instead of using 
__builtin_offsetof (which didn't exist in older compilers).  I was merely 
expanding the offsetof macro in the testcase by hand, in order to make it 
visible, where exactly it breaks. 
 
And I would extend this to not just const-fold in asms.  There is no reason 
to not do this optimization also outside.  There is enough code out there 
which still uses the legacy definition of offsetof.  Why pessimize it? 
(This doesn't mean that this construct should be regarded as a constant 
in the language sense.  My point was, that it does boil down to a constant, 
no matter what the language says). 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17346


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]