How to insert a new function in plugin?

2019-08-22 Thread John Reed
Hi, I want to insert a new function `test_fn` in plugin and call it in `main`, but got `undefined reference to `test_fn’ in `ld`. Can someone please give any help? Thanks. Here is the example code, //== plugin.c #include "gcc-plugin.h" #include "plugin-version.h" #include "

gcc vs clang for non-power-2 atomic structures

2019-08-22 Thread Jim Wilson
We got a change request for the RISC-V psABI to define the atomic structure size and alignment. And looking at this, it turned out that gcc and clang are implementing this differently. Consider this testcase rohan:2274$ cat tmp.c #include struct s { int a; int b; int c;}; int main(void) { pri

gcc-7-20190822 is now available

2019-08-22 Thread gccadmin
Snapshot gcc-7-20190822 is now available on ftp://gcc.gnu.org/pub/gcc/snapshots/7-20190822/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 7 SVN branch with the following options: svn://gcc.gnu.org/svn/gcc/branches/gcc-7

Re: [EXT] Re: How does one traverse all the global decls

2019-08-22 Thread Gary Oblock
On 8/22/19 2:16 AM, Martin Jambor wrote: > External Email > > -- > Hi, > > On Wed, Aug 21 2019, Gary Oblock wrote: >> I'm trying to do some analysis code for an optimization >> that involves my code looking at all the declarations

Re: [PATCH] Builtin function roundeven folding implementation

2019-08-22 Thread Joseph Myers
On Thu, 22 Aug 2019, Tejas Joshi wrote: > > I think you should have at least four tests of sign of zero result > > (arguments -0.5, -0.0, 0.0 and 0.5). Probably also tests of values > > between +/- 0.5 and 0, e.g. test -0.25 and 0.25 as well. > > Okay, I have made the following changes and again

Re: [PATCH] Builtin function roundeven folding implementation

2019-08-22 Thread Tejas Joshi
> I think you should have at least four tests of sign of zero result > (arguments -0.5, -0.0, 0.0 and 0.5). Probably also tests of values > between +/- 0.5 and 0, e.g. test -0.25 and 0.25 as well. Okay, I have made the following changes and again, the tests pass for roundeven. void real_roundeve

Re: [PATCH] Builtin function roundeven folding implementation

2019-08-22 Thread Joseph Myers
On Thu, 22 Aug 2019, Tejas Joshi wrote: > > I'm concerned that this would produce +0.0 for an argument of -0.5 (via > > -0.5 - 0.5 - -1.0 producing +0.0) when it needs to produce -0.0. > > Would the following overhaul be acceptable as the condition is > specialized for -0.5 and +0.5 only. This se

Re: [PATCH] Builtin function roundeven folding implementation

2019-08-22 Thread Tejas Joshi
> I'm concerned that this would produce +0.0 for an argument of -0.5 (via > -0.5 - 0.5 - -1.0 producing +0.0) when it needs to produce -0.0. Would the following overhaul be acceptable as the condition is specialized for -0.5 and +0.5 only. This seems to solve the problem. I did test the roundeven

Re: How does one traverse all the global decls

2019-08-22 Thread Richard Biener
On Thu, Aug 22, 2019 at 11:16 AM Martin Jambor wrote: > > Hi, > > On Wed, Aug 21 2019, Gary Oblock wrote: > > I'm trying to do some analysis code for an optimization > > that involves my code looking at all the declarations and > > types there of during the link time optimizations. > > > > Note, d

Re: Expansion of narrowing math built-ins into power instructions

2019-08-22 Thread Segher Boessenkool
> > Hi Tejas, > > > > [ Please do not top-post. ] On Thu, Aug 22, 2019 at 01:27:06PM +0530, Tejas Joshi wrote: > > What happens then? "It does not work" is very very vague. At least it > > seems the compiler does build now? > > Oh, compiler builds but instruction is still "bl fadd". It should b

Re: How does one traverse all the global decls

2019-08-22 Thread Martin Jambor
Hi, On Wed, Aug 21 2019, Gary Oblock wrote: > I'm trying to do some analysis code for an optimization > that involves my code looking at all the declarations and > types there of during the link time optimizations. > > Note, doing this for the local variables seems to be trivial > because of FOR_E

Re: Expansion of narrowing math built-ins into power instructions

2019-08-22 Thread Tejas Joshi
> What happens then? "It does not work" is very very vague. At least it > seems the compiler does build now? Oh, compiler builds but instruction is still "bl fadd". It should be "fadds" right? On Thu, 22 Aug 2019 at 11:55, Segher Boessenkool wrote: > > Hi Tejas, > > [ Please do not top-post.