Re: Help! Regarding Bug 17896

2016-01-28 Thread Prasad Ghangal
On 26 January 2016 at 03:24, Manuel López-Ibáñez wrote: > On 25 January 2016 at 20:17, Mikhail Maltsev wrote: >> As I understand, the bug report suggests that we say "suggest || instead of | >> when joining booleans" instead. We now have the API to show fix-it hints, so >> it >> would be nice to

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

2016-01-28 Thread Andreas Schwab
Richard Biener writes: > I think that's reasonable and what GHC expects - declare "there is a function > foo defined, no idea what prototype yet", unfortunately C requires to specify > a return type. Like void, f.ex. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA

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

2016-01-28 Thread John Paul Adrian Glaubitz
On 01/28/2016 09:55 AM, Andreas Schwab wrote: > Richard Biener writes: > >> I think that's reasonable and what GHC expects - declare "there is a function >> foo defined, no idea what prototype yet", unfortunately C requires to specify >> a return type. > > Like void, f.ex. Wait. Do you think th

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

2016-01-28 Thread Andreas Schwab
John Paul Adrian Glaubitz writes: > Wait. Do you think this would actually allow ghc to determine the > return type later? If I remember correctly, ghc currently initially > declares the function prototype with return type void*, doesn't it? Replace a lie with a different lie. Spot the pattern?

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

2016-01-28 Thread Florian Weimer
On 01/27/2016 04:17 PM, Richard Biener wrote: > 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 (wrong) prototype via a function > pointer c

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) (); >> } >> >> t2.c >> - >> int foo () { return 0; } >> >> thus doing a direc

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

2016-01-28 Thread Eric Botcazou
> I suspect Ada needs something like this already. I expect the following > to work (although it is quite hideous). > > with System; > > package Import is > >function Foo return System.Address; >pragma Import (C, Foo); > >function Bar return Integer; > > end Import; > > package b

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

2016-01-28 Thread Arnaud Charlet
> > package Import is > > > >function Foo return System.Address; > >pragma Import (C, Foo); > > > >function Bar return Integer; > > > > end Import; > > > > package body Import is > > > >function Bar return Integer is > > function Foo_2 return Integer; > > pragma Imp

Re: [RFC PR43721] Optimize a/b and a%b to single divmod call

2016-01-28 Thread Richard Biener
On Wed, 27 Jan 2016, Prathamesh Kulkarni wrote: > On 11 November 2015 at 19:04, Richard Biener wrote: > > On Wed, 11 Nov 2015, Prathamesh Kulkarni wrote: > > > >> On 11 November 2015 at 16:03, Richard Biener wrote: > >> > On Wed, 11 Nov 2015, Prathamesh Kulkarni wrote: > >> > > >> >> On 10 Novem

Compiling with -m64 using attribute interrupt emits IRET not IRETQ

2016-01-28 Thread Wink Saville
I using hjl/interrupt/gcc-5-branch and my program is crashing when I issue an INT xx. The problem appears to me to be that using __attribute__ ((interrupt)) causes the a IRET to be emitted when an IRETQ should be emitted. Below is my trivial do nothing main.c which I compile with and then use objdu

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

2016-01-28 Thread Michael Karcher
On 28.01.2016 11:04, Andreas Schwab wrote: > John Paul Adrian Glaubitz writes: > >> [suggestion to use "void" as dummy return type] >> >> Wait. Do you think this would actually allow ghc to determine the >> return type later? If I remember correctly, ghc currently initially >> declares the functio

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

2016-01-28 Thread Andreas Schwab
Why does the dummy declaration need to use a pointer type? Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

libstdc++ and c library compatible issue when bootstrap GCC

2016-01-28 Thread Bin.Cheng
Hi, I ran into below error message at stage2 of bootstrap GCC: /work/obj/gcc-bootstrap/./prev-gcc/xg++ -B/work/obj/gcc-bootstrap/./prev-gcc/ -B//aarch64-none-linux-gnu/bin/ -nostdinc++ -B/work/obj/gcc-bootstrap/prev-aarch64-none-linux-gnu/libstdc++-v3/src/.libs -B/work/obj/gcc-bootstrap/prev-aarc

Re: Compiling with -m64 using attribute interrupt emits IRET not IRETQ

2016-01-28 Thread H.J. Lu
On Thu, Jan 28, 2016 at 9:06 AM, Wink Saville wrote: > I using hjl/interrupt/gcc-5-branch and my program is crashing when I > issue an INT xx. The problem appears to me to be that using > __attribute__ ((interrupt)) causes the a IRET to be emitted when an > IRETQ should be emitted. Below is my tri

Re: Compiling with -m64 using attribute interrupt emits IRET not IRETQ

2016-01-28 Thread H.J. Lu
On Thu, Jan 28, 2016 at 10:26 AM, H.J. Lu wrote: > On Thu, Jan 28, 2016 at 9:06 AM, Wink Saville wrote: >> I using hjl/interrupt/gcc-5-branch and my program is crashing when I >> issue an INT xx. The problem appears to me to be that using >> __attribute__ ((interrupt)) causes the a IRET to be emi

Re: Compiling with -m64 using attribute interrupt emits IRET not IRETQ

2016-01-28 Thread H.J. Lu
On Thu, Jan 28, 2016 at 11:06 AM, Wink Saville wrote: > Thanks. How are you testing? > > * { dg-do compile } */ /* { dg-options "-O2 -Wall -g" } */ void __attribute__((interrupt)) fn (void *frame) { } /* { dg-final { scan-assembler-not "add(l|q)\[\\t \]*\\$\[0-9\]*,\[\\t \]*%\[re\]?sp" } } */ /

Strange diagnostics behavior with patch

2016-01-28 Thread Thomas Koenig
Hello world, the attached patch fixes the regression of PR 60526 by checking for the presence of a type with the same name as the variable. Types effectively have their separate namespace because the names of their symtrees start with an uppercase letter. So far, so good. However, the error me

Re: Strange diagnostics behavior with patch

2016-01-28 Thread David Malcolm
On Thu, 2016-01-28 at 21:07 +0100, Thomas Koenig wrote: > Hello world, > > the attached patch fixes the regression of PR 60526 by checking for > the presence of a type with the same name as the variable. Types > effectively have their separate namespace because the names of their > symtrees start

Re: [RFC PR43721] Optimize a/b and a%b to single divmod call

2016-01-28 Thread Jim Wilson
On Thu, Jan 28, 2016 at 5:37 AM, Richard Biener wrote: >> To workaround this, I defined a new hook expand_divmod_libfunc, which >> targets must override for expanding call to target-specific dimovd. >> The "default" hook default_expand_divmod_libfunc() expands call to >> libgcc2.c:__udivmoddi4() s