Re: RFC: Support non-standard extension (call via casted function pointer)

2016-01-28 Thread Richard Biener
On Thu, Jan 28, 2016 at 11:11 AM, Florian Weimer wrote: > On 01/27/2016 04:17 PM, Richard Biener wrote: > >> We are trying to support >> >> t.c >> --- >> void *foo(); >> >> int bar() >> { >> return ((int (*)())foo) (); >> }

Re: RFC: Support non-standard extension (call via casted function pointer)

2016-01-27 Thread Richard Biener
first?) > > Conclusion: IMHO, If ghc fetches the return value from the wrong register, > then ghc is broken, not gcc. We are trying to support t.c --- void *foo(); int bar() { return ((int (*)())foo) (); } t2.c - int foo () { return 0; } thus doing a direct call to a function with a

Re: RFC: Support non-standard extension (call via casted function pointer)

2016-01-27 Thread Richard Biener
On Tue, Jan 26, 2016 at 9:54 PM, Michael Karcher wrote: > On 26.01.2016 21:47, Richard Biener wrote: >>>> So, hookize and change to >>>> >>>> if (outgoing && POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (func >>>> ... >&

Re: RFC: Support non-standard extension (call via casted function pointer)

2016-01-26 Thread Richard Biener
On January 26, 2016 8:03:35 PM GMT+01:00, Michael Karcher wrote: >On 26.01.2016 16:40, Richard Biener wrote: >> No, the patch looks somewhat broken to me. A complete fix would >replace >> the target macro FUNCTION_VALUE implementation by implementing the >> function_val

Re: RFC: Support non-standard extension (call via casted function pointer)

2016-01-26 Thread Richard Biener
On Tue, Jan 26, 2016 at 10:21 AM, John Paul Adrian Glaubitz wrote: > Hi Richard! > > On 01/26/2016 08:01 AM, Richard Biener wrote: >>> I developed a gcc patch that does not change the code generation for >>> conforming programs but fixes this non-conforming use-ca

Re: RFC: Support non-standard extension (call via casted function pointer)

2016-01-26 Thread Richard Biener
On January 26, 2016 8:25:50 AM GMT+01:00, Jeff Law wrote: >On 01/26/2016 12:01 AM, Richard Biener wrote: >> On January 25, 2016 10:47:10 PM GMT+01:00, Michael Karcher > wrote: >>> Hello gcc developers, >>> >>> as discussed in https://ghc.haskell.org/trac/gh

Re: RFC: Support non-standard extension (call via casted function pointer)

2016-01-25 Thread Richard Biener
On January 25, 2016 10:47:10 PM GMT+01:00, Michael Karcher wrote: >Hello gcc developers, > >as discussed in https://ghc.haskell.org/trac/ghc/ticket/11395 (and >forwarded as PR c/69221), ghc generates non-compliant C code that is >not >compiled as intended on m68k. This is because its internal Cmm