Re: Can offsetting a non-null pointer result in a null one?

2018-08-14 Thread Liu Hao
在 2018-08-15 12:48, Jeff Law 写道: I just don't think anyone's ever bothered to catch this case. I believe there is a BZ which touches on this issue. Yes, here it is: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78655 This PR uses a placement new as the example, which in GCC 8 assumes the poi

Re: Trying to convert to LRA, running into an ICE (infinite reload loop)

2018-08-14 Thread Jeff Law
On 08/14/2018 01:32 PM, Paul Koning wrote: > I'm trying to convert the pdp11 target to use LRA. > > A lot of it "just works". But one of the test suite files fails in a way > that I can't figure out at all. I'm hoping for some help or hints to track > down the cause and come up with a fix. >

Re: Can offsetting a non-null pointer result in a null one?

2018-08-14 Thread Jeff Law
On 08/14/2018 09:45 PM, Liu Hao wrote: > Dear GCC people, > > At the moment, with GCC 8.2, I compile the program > > ``` > int foo(const char *p) > { >     if(p == 0) >     return 2; >     const char *q = p + 1; >     if(q == 0) >     return 1; >     return 0; > } > ``` > > using > > ``

Can offsetting a non-null pointer result in a null one?

2018-08-14 Thread Liu Hao
Dear GCC people, At the moment, with GCC 8.2, I compile the program ``` int foo(const char *p) { if(p == 0) return 2; const char *q = p + 1; if(q == 0) return 1; return 0; } ``` using ``` gcc-8 test.c -Wall -Wextra -Wpedantic -O3 -S ``` and get the following as

Re: Questions related to creation of libgcov.so

2018-08-14 Thread Joseph Myers
On Tue, 14 Aug 2018, Martin Liška wrote: > 2) Do I understand that correctly that I need to build .o files twice: > once with hidden visibility and second time without for the shared > library? Yes. -- Joseph S. Myers jos...@codesourcery.com

Trying to convert to LRA, running into an ICE (infinite reload loop)

2018-08-14 Thread Paul Koning
I'm trying to convert the pdp11 target to use LRA. A lot of it "just works". But one of the test suite files fails in a way that I can't figure out at all. I'm hoping for some help or hints to track down the cause and come up with a fix. The failing program is testsuite/gcc.c-torture/compile/

Re: Questions related to creation of libgcov.so

2018-08-14 Thread Michael Matz
Hi, On Tue, 14 Aug 2018, Martin Liška wrote: > I'm sending second version of the patch candidate. I was able to create > a mapfile and generate versioned symbols for libgcov.so file. > > Unresolved issues: > 1) I still see linking with static library: > > $ find /home/marxin/bin/gcc -name libgc

Why did Intel change his static branch prediction mechanism over these years?

2018-08-14 Thread 2016 quekong
( I don't know if it's allowed to ask such question, if not, please remind me. ) I know Intel implemented several static branch prediction mechanisms these years: * 80486 age: Always-not-take * Pentium4 age: Backwards Taken/Forwards Not-Taken * PM, Core2: Didn't use static prediction, ra

Re: Questions related to creation of libgcov.so

2018-08-14 Thread Martin Liška
On 08/03/2018 04:42 PM, Joseph Myers wrote: > On Fri, 3 Aug 2018, Jakub Jelinek wrote: > >>> 3) Should I come up with a symbol versioning of the libgcov API? >> >> Certainly. > > Furthermore, make sure that the libgcov.a symbols remain hidden (via > building the static objects with $(vis_hide),

Re: [MIPS] hsdis need non-executable PT_GNU_STACK support

2018-08-14 Thread Leslie Zhai
Hi Joseph, Thanks for your response! hsdis is just able to workaround when linking with -Wl,-z,noexecstack flag, and my environment: $ uname -a Linux localhost.localdomain 3.10.84-19.fc21.loongson.2.mips64el #1 SMP PREEMPT Fri Jul 6 18:47:47 CST 2018 mips64 mips64 mips64 GNU/Linux $ gcc -v

Re: [MIPS] hsdis need non-executable PT_GNU_STACK support

2018-08-14 Thread Joseph Myers
On Tue, 14 Aug 2018, Leslie Zhai wrote: > The root cause is the patch [MIPS] Enable non-executable PT_GNU_STACK support, > contributed by Faraz in 2016 February, had not been merged by GCC toolchain > upstream. > > https://gcc.gnu.org/ml/gcc-patches/2016-02/msg00444.html Was there a non-RFC GCC

[MIPS] hsdis need non-executable PT_GNU_STACK support

2018-08-14 Thread Leslie Zhai
Hi all, hsdis PrintLIRWithAssembly failed to work for mips64el after upgraded to jdk8u181-b13. http://mail.openjdk.java.net/pipermail/jdk8u-dev/2018-August/007753.html The root cause is the patch [MIPS] Enable non-executable PT_GNU_STACK support, contributed by Faraz in 2016 February, had no