diff mbox

Fix PR tree-optimization/77550

Message ID AM4PR0701MB2162B57BDD37C524ADED5AE2E4F60@AM4PR0701MB2162.eurprd07.prod.outlook.com
State New
Headers show

Commit Message

Bernd Edlinger Sept. 21, 2016, 8:20 p.m. UTC
On 09/21/16 21:57, Christophe Lyon wrote:
> Hi,

>

> The new testcase pr77550.C fails on arm:

> /testsuite/g++.dg/pr77550.C:39:43: error: 'operator new' takes type

> 'size_t' ('unsigned int') as first parameter [-fpermissive]

> compiler exited with status 1

>

> Christophe

>


Yes, I see, thanks.  This should fix it.

OK for trunk, gcc-6 after a while ?


Bernd.

Comments

Richard Biener Sept. 22, 2016, 7:41 a.m. UTC | #1
On Wed, 21 Sep 2016, Bernd Edlinger wrote:

> On 09/21/16 21:57, Christophe Lyon wrote:
> > Hi,
> >
> > The new testcase pr77550.C fails on arm:
> > /testsuite/g++.dg/pr77550.C:39:43: error: 'operator new' takes type
> > 'size_t' ('unsigned int') as first parameter [-fpermissive]
> > compiler exited with status 1
> >
> > Christophe
> >
> 
> Yes, I see, thanks.  This should fix it.
> 
> OK for trunk, gcc-6 after a while ?

Ok.

Richard.
Christophe Lyon Sept. 22, 2016, 7:30 p.m. UTC | #2
On 21 September 2016 at 22:20, Bernd Edlinger <bernd.edlinger@hotmail.de> wrote:
> On 09/21/16 21:57, Christophe Lyon wrote:
>> Hi,
>>
>> The new testcase pr77550.C fails on arm:
>> /testsuite/g++.dg/pr77550.C:39:43: error: 'operator new' takes type
>> 'size_t' ('unsigned int') as first parameter [-fpermissive]
>> compiler exited with status 1
>>
>> Christophe
>>
>
> Yes, I see, thanks.  This should fix it.
>
> OK for trunk, gcc-6 after a while ?
>
>
> Bernd.

Hi,

The test now compiles and runs OK on most arm configurations, but
on arm-none-eabi --with-cpu=cortex-a9, execution fails:
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
FAIL: g++.dg/pr77550.C   execution test

And on arm-none-eabi with default cpu, the test still does not compile.

Christophe
Bernd Edlinger Sept. 22, 2016, 8:30 p.m. UTC | #3
On 09/22/16 21:30, Christophe Lyon wrote:
> On 21 September 2016 at 22:20, Bernd Edlinger <bernd.edlinger@hotmail.de> wrote:

>> On 09/21/16 21:57, Christophe Lyon wrote:

>>> Hi,

>>>

>>> The new testcase pr77550.C fails on arm:

>>> /testsuite/g++.dg/pr77550.C:39:43: error: 'operator new' takes type

>>> 'size_t' ('unsigned int') as first parameter [-fpermissive]

>>> compiler exited with status 1

>>>

>>> Christophe

>>>

>>

>> Yes, I see, thanks.  This should fix it.

>>

>> OK for trunk, gcc-6 after a while ?

>>

>>

>> Bernd.

>

> Hi,

>

> The test now compiles and runs OK on most arm configurations, but

> on arm-none-eabi --with-cpu=cortex-a9, execution fails:

> qemu: uncaught target signal 11 (Segmentation fault) - core dumped

> FAIL: g++.dg/pr77550.C   execution test

>

> And on arm-none-eabi with default cpu, the test still does not compile.

>

> Christophe

>


Hmm.  This test case is hardly worth it, because on my armv7hf target
it doesn't even reproduce the original problem :(

Could you send me the exact compile-flags and the error message
please?


Bernd.
Christophe Lyon Sept. 26, 2016, 7:19 p.m. UTC | #4
On 22 September 2016 at 22:30, Bernd Edlinger <bernd.edlinger@hotmail.de> wrote:
> On 09/22/16 21:30, Christophe Lyon wrote:
>> On 21 September 2016 at 22:20, Bernd Edlinger <bernd.edlinger@hotmail.de> wrote:
>>> On 09/21/16 21:57, Christophe Lyon wrote:
>>>> Hi,
>>>>
>>>> The new testcase pr77550.C fails on arm:
>>>> /testsuite/g++.dg/pr77550.C:39:43: error: 'operator new' takes type
>>>> 'size_t' ('unsigned int') as first parameter [-fpermissive]
>>>> compiler exited with status 1
>>>>
>>>> Christophe
>>>>
>>>
>>> Yes, I see, thanks.  This should fix it.
>>>
>>> OK for trunk, gcc-6 after a while ?
>>>
>>>
>>> Bernd.
>>
>> Hi,
>>
>> The test now compiles and runs OK on most arm configurations, but
>> on arm-none-eabi --with-cpu=cortex-a9, execution fails:
>> qemu: uncaught target signal 11 (Segmentation fault) - core dumped
>> FAIL: g++.dg/pr77550.C   execution test
>>
>> And on arm-none-eabi with default cpu, the test still does not compile.
>>
>> Christophe
>>
>
> Hmm.  This test case is hardly worth it, because on my armv7hf target
> it doesn't even reproduce the original problem :(
>
> Could you send me the exact compile-flags and the error message
> please?
>

Sorry for the delay, I've been travelling.

Compilation is:
.../xg++ -B/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/gcc/testsuite/g++/../../
/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/g++.dg/pr77550.C
g++_tg.o -fno-diagnostics-show-caret -fdiagnostics-color=never
-nostdinc++ -I/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/libstdc++-v3/include/arm-none-eabi
-I/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/libstdc++-v3/include
-I/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libstdc++-v3/libsupc++
-I/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libstdc++-v3/include/backward
-I/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libstdc++-v3/testsuite/util
-fmessage-length=0 -std=c++14 -O3
-L/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/./libstdc++-v3/src/.libs
-B/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/./libstdc++-v3/src/.libs
-Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort -lm -o
./pr77550.exe

Then, during execution, I have:
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
and that's all

My gcc configuration flags are:
--target=arm-none-eabi --disable-libgomp --disable-libmudflap
--disable-libcilkrts --enable-checking --enable-languages=c,c++
--with-newlib --disable-tls --with-mode=arm --with-cpu=cortex-a9

Christophe


>
> Bernd.
Bernd Edlinger Sept. 26, 2016, 8:09 p.m. UTC | #5
On 09/26/16 21:19, Christophe Lyon wrote:
>

> Sorry for the delay, I've been travelling.

>

> Compilation is:

> .../xg++ -B/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/gcc/testsuite/g++/../../

> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/g++.dg/pr77550.C

> g++_tg.o -fno-diagnostics-show-caret -fdiagnostics-color=never

> -nostdinc++ -I/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/libstdc++-v3/include/arm-none-eabi

> -I/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/libstdc++-v3/include

> -I/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libstdc++-v3/libsupc++

> -I/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libstdc++-v3/include/backward

> -I/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libstdc++-v3/testsuite/util

> -fmessage-length=0 -std=c++14 -O3

> -L/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/./libstdc++-v3/src/.libs

> -B/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/./libstdc++-v3/src/.libs

> -Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort -lm -o

> ./pr77550.exe

>

> Then, during execution, I have:

> qemu: uncaught target signal 11 (Segmentation fault) - core dumped

> and that's all

>

> My gcc configuration flags are:

> --target=arm-none-eabi --disable-libgomp --disable-libmudflap

> --disable-libcilkrts --enable-checking --enable-languages=c,c++

> --with-newlib --disable-tls --with-mode=arm --with-cpu=cortex-a9

>

> Christophe

>


Interesting.  At this point it might be OK to open a new PR.

So far, I cannot reproduce, but I used also cortex-a9 but
target=arm-linux-gnueabihf.

Could you please start the command above manually and add
-save-temps ?


Thanks
Bernd.
Christophe Lyon Sept. 27, 2016, 1:18 a.m. UTC | #6
On 26 September 2016 at 22:09, Bernd Edlinger <bernd.edlinger@hotmail.de> wrote:
> On 09/26/16 21:19, Christophe Lyon wrote:
>>
>> Sorry for the delay, I've been travelling.
>>
>> Compilation is:
>> .../xg++ -B/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/gcc/testsuite/g++/../../
>> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/g++.dg/pr77550.C
>> g++_tg.o -fno-diagnostics-show-caret -fdiagnostics-color=never
>> -nostdinc++ -I/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/libstdc++-v3/include/arm-none-eabi
>> -I/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/libstdc++-v3/include
>> -I/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libstdc++-v3/libsupc++
>> -I/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libstdc++-v3/include/backward
>> -I/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libstdc++-v3/testsuite/util
>> -fmessage-length=0 -std=c++14 -O3
>> -L/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/./libstdc++-v3/src/.libs
>> -B/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/./libstdc++-v3/src/.libs
>> -Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort -lm -o
>> ./pr77550.exe
>>
>> Then, during execution, I have:
>> qemu: uncaught target signal 11 (Segmentation fault) - core dumped
>> and that's all
>>
>> My gcc configuration flags are:
>> --target=arm-none-eabi --disable-libgomp --disable-libmudflap
>> --disable-libcilkrts --enable-checking --enable-languages=c,c++
>> --with-newlib --disable-tls --with-mode=arm --with-cpu=cortex-a9
>>
>> Christophe
>>
>
> Interesting.  At this point it might be OK to open a new PR.
>
OK, this is https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77748

> So far, I cannot reproduce, but I used also cortex-a9 but
> target=arm-linux-gnueabihf.
>
It does work for me with this configuration.
arm-non-eabi makes the difference.

> Could you please start the command above manually and add
> -save-temps ?
>
>
> Thanks
> Bernd.
diff mbox

Patch

2016-09-21  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* g++.dg/pr77550.C: Use __SIZE_TYPE__.

Index: gcc/testsuite/g++.dg/pr77550.C
===================================================================
--- gcc/testsuite/g++.dg/pr77550.C	(revision 240330)
+++ gcc/testsuite/g++.dg/pr77550.C	(working copy)
@@ -36,7 +36,7 @@  struct B {
 template <typename, typename> using __ptr_rebind = B;
 template <typename _Tp> _Tp max(_Tp p1, _Tp) { return p1; }
 }
-void *operator new(unsigned long, void *p2) { return p2; }
+void *operator new(__SIZE_TYPE__, void *p2) { return p2; }
 template <typename _Tp> struct C {
   typedef _Tp *pointer;
   pointer allocate(int p1) {
@@ -47,7 +47,7 @@  template <typename _Tp> struct C {
 namespace std {
 template <typename _Tp> using __allocator_base = C<_Tp>;
 template <typename _Tp> struct allocator : __allocator_base<_Tp> {
-  typedef unsigned long size_type;
+  typedef __SIZE_TYPE__ size_type;
   template <typename _Tp1> struct rebind { typedef allocator<_Tp1> other; };
 };
 struct D {