This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug inline-asm/17346] [3.5 Regression] linux kernel: handwritten offsetof break inline asm
- From: "matz at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Sep 2004 12:48:57 -0000
- Subject: [Bug inline-asm/17346] [3.5 Regression] linux kernel: handwritten offsetof break inline asm
- References: <20040907113458.17346.matz@suse.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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