[Bug c++/45303] Compile error when not using -ftree-ter

2010-08-18 Thread jobnoorman at gmail dot com
--- 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 the asm

[Bug c++/45303] Compile error when not using -ftree-ter

2010-08-18 Thread ian at airs dot com
--- 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

[Bug c++/45303] Compile error when not using -ftree-ter

2010-08-18 Thread pinskia at gcc dot gnu dot org
--- 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

[Bug c++/45303] Compile error when not using -ftree-ter

2010-08-17 Thread jakub at gcc dot gnu dot org
--- 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. --

[Bug c++/45303] Compile error when not using -ftree-ter

2010-08-17 Thread redi at gcc dot gnu dot org
--- 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

[Bug c++/45303] Compile error when not using -ftree-ter

2010-08-17 Thread redi at gcc dot gnu dot org
--- 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

[Bug c++/45303] Compile error when not using -ftree-ter

2010-08-17 Thread jobnoorman at gmail dot com
--- 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

[Bug c++/45303] Compile error when not using -ftree-ter

2010-08-17 Thread jakub at gcc dot gnu dot org
--- 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. --

[Bug c++/45303] Compile error when not using -ftree-ter

2010-08-17 Thread jobnoorman at gmail dot com
--- 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, for exactly