This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix undefined behavior on g++.dg/pr77550.C (PR 77748)


On Wed, 28 Sep 2016, Bernd Edlinger wrote:

> Hi,
> 
> in this test case, c-reduce had created various forms of undefined
> behaviour, which did only show up on m68k and arm-none-eabi.
> 
> Most notably the original problem did only happen when
> 512/sizeof(basic_string) = 7, but with a non-zero remainder.
> In the way that c-reduce used to reduce that structure
> there is an array of enum as a place holder.
> But that depends on sizeof(enum) to be 4, which is
> not the case on arm-none-eabi.
> 
> Other problems come from a not-initialized _M_string_length
> which ends up in a memcmp crash.
> 
> And the _Alloc_hider constructor, which is linked to
> libstdc++, but that works only as long as the signature
> of that function is not changed, so it turned out
> the test case would not link with gcc-6 for instance.
> 
> I found no way how to write that template specialization
> without breaking the purpose of reproducing the
> original PR, because __attribute((noinline, noclone))
> seems to be completely ignored in this case.
> 
> I made sure that PR 77550 can still be reproduced
> with this test case both on gcc-6 and trunk.
> 
> 
> Bootstrapped and reg-tested on x86_64-pc-linux-gnu.
> Is it OK for trunk?

Yes.

Thanks,
Richard.

> 
> Thanks
> Bernd.

-- 
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]