--- Comment #9 from pinskia at gcc dot gnu dot org 2010-08-18 22:42 ---
*** This bug has been marked as a duplicate of 23200 ***
--
pinskia at gcc dot gnu dot org changed:
What|Removed |Added
--
--- Comment #8 from ian at airs dot com 2010-08-18 17:44 ---
Just for the record, I'm with Jakub: the general rule should be that "r" always
works for a value that fits in a register, and anything else requires enabling
optimization to work reliably.
I don't see why we should sign up to
--- Comment #7 from jobnoorman at gmail dot com 2010-08-18 14:03 ---
(In reply to comment #3)
> Looking at the diagnostics issued when -pedantic is added, I think the right
> conversion is
>
> (void*)(plain_foobar_t)&Foo::foobar
>
> That still uses the G++ extension, and doesn't give t
--- Comment #6 from jobnoorman at gmail dot com 2010-08-17 10:49 ---
(In reply to comment #5)
> For inline-asm? Certainly not. Consider much simpler:
> void foo (void)
> {
> int i;
> i = 6;
> asm volatile ("" : : "i" (i));
> }
> which will work with -O and above, but not for -O0,
--- Comment #5 from jakub at gcc dot gnu dot org 2010-08-17 10:16 ---
For inline-asm? Certainly not. Consider much simpler:
void foo (void)
{
int i;
i = 6;
asm volatile ("" : : "i" (i));
}
which will work with -O and above, but not for -O0, for exactly the same
reason.
--
ht
--- Comment #4 from jobnoorman at gmail dot com 2010-08-17 10:04 ---
(In reply to comment #1)
> IMHO this isn't a bug, to simplify that into an integer you really need some
> optimizations. The conversion looks very weird, if you use something saner
> like (void *)&Foo::foobar, it will
--- Comment #3 from redi at gcc dot gnu dot org 2010-08-17 09:42 ---
Looking at the diagnostics issued when -pedantic is added, I think the right
conversion is
(void*)(plain_foobar_t)&Foo::foobar
That still uses the G++ extension, and doesn't give the asm error even without
optimisatio
--- Comment #2 from redi at gcc dot gnu dot org 2010-08-17 09:38 ---
(In reply to comment #1)
> IMHO this isn't a bug, to simplify that into an integer you really need some
> optimizations. The conversion looks very weird, if you use something saner
The conversion uses this extension
h
--- Comment #1 from jakub at gcc dot gnu dot org 2010-08-17 09:21 ---
IMHO this isn't a bug, to simplify that into an integer you really need some
optimizations. The conversion looks very weird, if you use something saner
like (void *)&Foo::foobar, it will even work with -O0.
--
ht